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 CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by