Problem with integration need help

1 次查看(过去 30 天)
Hi guys,
The next code is to solve an integration. The code will keep running without show any result. Please, need your help if you know the reason.
The code is;
syms T1 T2 r1 r2 r w m k Tb
clc
b=(-4*m*w^2*r1^4)/(k*(r2^2-r1^2));
c1=((T2-T1)+(b*r2^2/4)*(((r2/r1)^2)-1))/(log(r2/r1));
c2=T1-((b*r2^4)/(4*r1^2))-(((T2-T1)+(b*r2^2/4)*(((r2/r1)^2)-1))/(log(r2/r1)))*log(r1);
Tb=(int((((c1*r/2)+(c2/r))*((b*r2^4/4*r^2)+(c1*log(r)+c2))*r),r,r1,r2))/....
(int(((((-2*w*r1^2)/(r2^2-r1^2))*(r/2))+(((w*r1^2*r2^2)/(r2^2-r1^2))*(1/r)))*r,r,r1,r2));

采纳的回答

Walter Roberson
Walter Roberson 2013-12-20
Try breaking Tb up into two pieces, numerator and denominator, so that you can figure out which of the two integrations is giving the problem.
In my tests with a different mathematics system, the integrations were fast.
  2 个评论
Abdulaziz
Abdulaziz 2013-12-20
Hi Walter your suggestion was really helpful the problem was in the numerator but i still can not find why
Walter Roberson
Walter Roberson 2013-12-20
In both your original equation and the modified one you give about half an hour ago, none of the b, c1, or c2 involve "r". Because of that, you can do the integration just by
syms b c1 c2 r1 r2 r
Tb1 = int((((c1*r/2)+(c2/r))*((b*r2^4/4*r^2)+(c1*log(r)+c2))*r),r,r1,r2);
and then take that result and substitute in the values for b, c1, c2:
b=(-4*m*w^2*r1^4)/(k*(r2^2-r1^2));
c1=((T2-T1)+(b*r2^2/4)*(((r2/r1)^2)-1))/(log(r2/r1));
c2=T1-((b*r2^4)/(4*r1^2))-(((T2-T1)+(b*r2^2/4)*(((r2/r1)^2)-1))/(log(r2/r1)))*log(r1);
Tb = subs(Tb1);
As the integral will be simpler, it is less likely that it will run indefinitely.

请先登录,再进行评论。

更多回答(1 个)

Abdulaziz
Abdulaziz 2013-12-20
编辑:Walter Roberson 2013-12-20
the code is simplify like next:
clear all
syms T1 T2 r1 r2 r w m k Tb
clc
b=(-4*m*w^2*r1^4)/(k*(r2^2-r1^2));
c1=((T2-T1)+(b*r2^2/4)*(((r2/r1)^2)-1))/(log(r2/r1));
c2=T1-((b*r2^4)/(4*r1^2))-(((T2-T1)+(b*r2^2/4)*(((r2/r1)^2)-1))/(log(r2/r1)))*log(r1);
Tb=(int((((c1*r/2)+(c2/r))*((b*r2^4/4*r^2)+(c1*log(r)+c2))*r),r,r1,r2));
the processor is running endlessly to solve the integration until i stop it by ctl/c

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by