Problem with integration need help

1 回表示 (過去 30 日間)
Abdulaziz
Abdulaziz 2013 年 12 月 20 日
コメント済み: Walter Roberson 2013 年 12 月 20 日
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 Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by