Hello, I have a system of equations that I solve with respect to three variables : pd, pf and lambda. I solve it for two different values of a parameter (eqns1 and eqns2) and over a variety of values for cd.
I now want to store the results as a matrix with three rows : cd, lambda from eqns1 and lambda from eqns2 in order to be able to represent graphically the two rows of lambda with respect to cd.
Any suggestions on how to store the results as a unique matrix?
conds = {pd > 0 && pf > 0, pd \[Element] Reals, pf \[Element] Reals,
lambda >= 0, lambda \[Element] Reals}
eqns1 = {
pd + cd (-2 + 1/(2 + ((1 + lambda^(3/4)) 2 pf*2)/pd*2)) == 0,
10 pf == 27/2 + (9 pd*2)/((2 + 8 lambda*3/4 + 4 lambda*3/2) pd*2 + 4 (1 + lambda^(3/4)) 4 pf*2),
4/3 (1 + lambda^(3/4)) 3 lambda*1/4 == (10 (-cd + pd))/(pd*3 (1/pd^2 + 1/((1 + lambda^(3/4))^2 pf^2)) 3/2 pf*2)
}
eqns2 = {
pd + cd (-2 + 1/(2 + ((1 + lambda^(3/4)) 2 pf*2)/pd*2)) == 0,
5 pf == 6 + 1/(1/2 + 2 lambda*3/4 + lambda*3/2 + ((1 + lambda^(3/4)) 4 pf*2)/pd*2),
4/3 (1 + lambda^(3/4)) 3 lambda*1/4 == (10 (-cd + pd))/(pd*3 (1/pd^2 + 1/((1 + lambda^(3/4))^2 pf^2)) 3/2 pf*2)
}
For[cd = 0.1, cd < 0.5, cd += 0.1,
Print[sol1 =
FullSimplify[NSolve[Join[eqns1, conds], {pd, pf, lambda}]],
sol2 = FullSimplify[NSolve[Join[eqns2, conds], {pd, pf, lambda}]]]]