Solving equation returns a 0x1 sym

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)

Réponses (1)

Walter Roberson
Walter Roberson le 26 Avr 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 commentaires

Gary North
Gary North le 26 Avr 2019
Thanks, that does work to get a solution; but it gives an answer of 0, which isn't right. I've heard that for iterative solve equations you need to give it a guess value?
vpasolve(S1-S2,[1 5000])
Gary North
Gary North le 27 Avr 2019
This gives me a T of 300.5, which is also definitely not accurate. It is possible it is my equations but I've checked them several times so I feel pretty confident they are accurate.
Walter Roberson
Walter Roberson le 27 Avr 2019
Modifié(e) : Walter Roberson le 27 Avr 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Produits

Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by