Numeric solution for a set of equations
Show older comments
What's up, guys? I'm new to Matlab, so I apologize for my lack of knowledge. I've been trying to solve a set of 4 equations from a thermodynamics problem but I can't seem to get Matlab to work properly.
The equations are :
0.70*P = 0.35 * Psat1;
0.30*P = 0.65 * Psat2;
log (Psat1) = 13.7819 - 2726.81/(t + 217.572);
log (Psat2) = 13.9726 -3259.93/(t + 212.300);
I want to solve them for P and t (eq. 1 and 2 could eventually go into 3 and 4 thus making a 2 variable system but I chose to write the 4 eqs. anyway). I used the vpasolve function, with eq1 - eq4 being those above, but I got this:
>> syms P t Psat1 Psat2
>> vpasolve([eq1, eq2, eq3, eq4], [P t Psat1 Psat2])
ans =
P: [1x1 sym]
t: [1x1 sym]
Psat1: [1x1 sym]
Psat2: [1x1 sym]
What am I doing wrong? Is there a better function to solve this kind of problem?
Accepted Answer
More Answers (0)
Categories
Find more on Code Performance 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!