Matlab / Mupad does not solve definite integral

7 Ansichten (letzte 30 Tage)
Magnus am 9 Okt. 2014
Kommentiert: Magnus am 14 Okt. 2014
Dear all,
I'm trying to solve an integral using both matlab and mupad. However it does not solve the integral although it is definite. It basically just simplifies the expression and returns something like
Does anybody know how to 'force' Matlab/Mupad to give a solution?
Kind regards,
  2 Kommentare
Bruno Pop-Stefanov
Bruno Pop-Stefanov am 10 Okt. 2014
Can you please copy and paste the code to compute the integral so we can take a look? Thanks.
Magnus am 14 Okt. 2014
Dear Bruno, of course. Sorry for that.
Ui=[0.07*Us 0.1*Us 0.2*Us 0.5*Us Us];
di=[0.8*d 0.6*d 0.4*d 0.2*d 0];
Xi=[X1 X2 X3 X4 X5];
Yi=[Y1 Y2 Y3 Y4 Y5];
syms L x Xi X1 X2 X3 X4 X5 Yi Y1 Y2 Y3 Y4 Y5
i=2; %to cut time, it's actually a for-loop

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Bruno Pop-Stefanov
Bruno Pop-Stefanov am 10 Okt. 2014
If you want to "force" MATLAB to give a numeric solution to an integral, you can use the integral function, which computes the integral numerically, as opposed to int and MuPAD, which try to solve the integral symbolically.
Here is a page with the list of numerical integration functions and links to examples:
  1 Kommentar
Magnus am 14 Okt. 2014
Dear Bruno, thanks for your answer! The problem is that for the equation above, I want to solve for L in the next step after the integration from x=0 to x=L/2. I also intend to do so for X1, ...Y5. Numerical integration using integral or quadqk, however, requires only one variable, so I can't keep L, X1,...Y5 as variables but have assign them real values. So I keep x and assign constants to all the other syms values, which works (after transformation to a function handle). I tried to remain L, X1, Y1, etc., as syms but then integral, quadgk etc. wouldn't work.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by