Solving equation returns a 0x1 sym
14 views (last 30 days)
Show older comments
I have two equations which I am trying to set equal to each other and solve, but it keeps returning "empty sym 0X1", and I'm not sure why. Any help? Intent to set S1=S2 and solve for T2. It works to give me a numeric value for S1, but can't get a solution for S2. Code below:
N=1000;
T1=300;
V1=.002;
V2=1*10^-5;
h=6.626*10^-34;
kb=1.38*10^-23;
g=3;
Sigma=2;
Thetav=2256;
m=3*10^-26;
r=(1.21*10^-10)/2;
I=m*r^2;
S1=N*kb*(log(((4*pi*m*kb*T1)/(h^2))*((V1*exp(5/2))/N)) + log((8*pi^2*I*kb*T1)/(Sigma*h^2)) + (Thetav*T1)/(exp(Thetav/T1)-1) - log(1-exp(-Thetav/T1)) + log(g))
S2=S1;
syms T2;
S2==N*kb*(log(((4*pi*m*kb*T2)/(h^2))*((V2*exp(5/2))/N)) + log((8*pi^2*I*kb*T2)/(Sigma*h^2)) + (Thetav*T2)/(exp(Thetav/T2)-1) - log(1-exp(-Thetav/T2)) + log(g));
solve(S2,T2)
0 Comments
Answers (1)
Walter Roberson
on 26 Apr 2019
N=1000;
T1=300;
V1=.002;
V2=1*10^-5;
h=6.626*10^-34;
kb=1.38*10^-23;
g=3;
Sigma=2;
Thetav=2256;
m=3*10^-26;
r=(1.21*10^-10)/2;
I=m*r^2;
S1=N*kb*(log(((4*pi*m*kb*T1)/(h^2))*((V1*exp(5/2))/N)) + log((8*pi^2*I*kb*T1)/(Sigma*h^2)) + (Thetav*T1)/(exp(Thetav/T1)-1) - log(1-exp(-Thetav/T1)) + log(g))
syms T2;
S2=N*kb*(log(((4*pi*m*kb*T2)/(h^2))*((V2*exp(5/2))/N)) + log((8*pi^2*I*kb*T2)/(Sigma*h^2)) + (Thetav*T2)/(exp(Thetav/T2)-1) - log(1-exp(-Thetav/T2)) + log(g));
solve(S1==S2,T2)
4 Comments
Walter Roberson
on 27 Apr 2019
Edited: Walter Roberson
on 27 Apr 2019
T2 of 300.5 is accurate to within the precision expressed by 300.5 .
fplot(S1-S2,[300 305])
You can fplot S2 to see that it is a strictly increasing function over the positives. It starts lower than S1 and increases, so there is a single point of interception.
See Also
Categories
Find more on Calculus 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!