solving a system of equation using symbolic expressions returns empty solution
Afficher commentaires plus anciens
Hello,
I'm trying to solve a system of equation using symbolic expressions but it outputs empty value.
% values are predefined for the following variables: CG0, HC, R, T, K0, Cm0, beta
syms RH q_H2O CG K Cm
eq1 = q_H2O == Cm * CG*K*RH / ((1-K*RH)*(1+(CG-1)*K*RH));
eq2 = CG == CG0*exp(HC/R/T);
eq3 = K == K0*exp(HK/R/T);
eq4 = Cm == Cm0*exp(beta/T);
eqns = [eq1, eq2, eq3, eq4];
[~, ~, ~, q_H2O] = solve(eqns);
Running this code yields:
ans =
struct with fields:
CG: [0×1 sym]
K: [0×1 sym]
RH: [0×1 sym]
q_H2O: [0×1 sym]
I was expecting a result that is a function of 'RH' (q_H2O = f(RH))
But if I predefine 'RH' and run the code (e.g. RH=0.5), this code outputs a value as a result.
I would appreciate any comments!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!