solving integral equation where the unknow is the upper limit
5 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
Paul
on 1 Mar 2021
Edited: Paul
on 1 Mar 2021
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 Comments
More Answers (0)
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!