MATLAB Answers

Matlab / Mupad does not solve definite integral

19 ビュー (過去 30 日間)
Magnus 2014 年 10 月 9 日
コメント済み: Magnus 2014 年 10 月 14 日
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 件のコメント
Magnus 2014 年 10 月 14 日
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


回答 (1 件)

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014 年 10 月 10 日
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 件のコメント
Magnus 2014 年 10 月 14 日
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.


Community Treasure Hunt

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

Start Hunting!

Translated by