solving integral equation where the unknow is the upper limit

조회 수: 3 (최근 30일)
Ahmed Hassan
Ahmed Hassan 2021년 3월 1일
편집: Paul 2021년 3월 1일
I have this function
function H = ICPH(T0,T,A,B,C,D)
syms x
f(x) = A+B*x+C*x^2+D*x^(-2);
H = int(f(x),x,T0,T);
end
this function work fine if I put all numerical values
example
y =8.314* ICPH(298.15, 2066, 43.471, 9.502e-3, 0.0, -0.645e5);
vpa(y,6)
ans
802482.0
however if I put this code
syms T real
g = 802482.0 == 8.314* ICPH(298.15, T, 43.471, 9.502e-3, 0.0, -0.645e5);
h5 = vpa(solve(g,T),6)
h5 = 0.585853
In the above code I was trying to solve for the T.
If I enter T manually i got the right answer put I use solve to find the unknow temperature the answer dont make sence.
h5 should be 2066.
what im doing wrong

채택된 답변

Paul
Paul 2021년 3월 1일
편집: Paul 2021년 3월 1일
Assuming T and T0 are positive, it looks like there are two values of T that will satisfy the equation. Not sure why your code is only showing one of them.
>> syms x A B C D T0 T
>> assume(T>0); assume(T0>0);
>> f(x) = A + B*x + C*x^2 + D*x^(-2);
>> H(T0,T,A,B,C,D) = int(f(x),x,T0,T);
>> y = 8.314*H(298.15,2066,43.471,9.502e-3,0,-0.645e5)
y =
14247542159329884584308006054643136629/17754354181814148147445760000000
>> vpa(y,6)
ans =
802482.0
>> g = y == 8.314*H(298.15,T,43.471,9.502e-3,0,-0.645e5);
>> solve(g,T)
ans =
2066
3933927652016390222187165949689002925564648542001^(1/2)/353643035040244080625 - 1919850870251626733553/342345629274195625
>> vpa(ans)
ans =
2066.0
0.58585343344352245862176866442733

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by