Matlab / Mupad does not solve definite integral

22 views (last 30 days)
Magnus on 9 Oct 2014
Commented: Magnus on 14 Oct 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,
Magnus on 14 Oct 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

Sign in to comment.

Answers (1)

Bruno Pop-Stefanov
Bruno Pop-Stefanov on 10 Oct 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 Comment
Magnus on 14 Oct 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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!