0

I am trying to isolate m, s and h in the following system of equations. I am new to Matlab, so not sure if the code is wrong or if something with equations are off. Hope you can help!

syms l p a m o b s t w c h d g e
eqn1 = l==1/p*(a^{1/e}*m^{(e-1)/e}+b^{1/e}*s^{(e-1)/e}+c^{1/e}*h^{(e-1)/e}+d^{1/e}*g^{(e-1)/e})^{1/(e-1)}*a^{1/e}*m^{-1/e};
eqn2 = l==1/o*(a^{1/e}*m^{(e-1)/e}+b^{1/e}*s^{(e-1)/e}+c^{1/e}*h^{(e-1)/e}+d^{1/e}*g^{(e-1)/e})^{1/(e-1)}*b^{1/e}*s^{-1/e};
eqn3 = l==1/((1-t)*w)*(a^{1/e}*m^{(e-1)/e}+b^{1/e}*s^{(e-1)/e}+c^{1/e}*h^{(e-1)/e}+d^{1/e}*g^{(e-1)/e})^{1/(e-1)}*c^{1/e}*h^{-1/e};
sol = solve([eqn1, eqn2, eqn3], [m, s, h]);
mSol = sol.m
sSol = sol.s
hSol = sol.h
mSol
sSol
hSol

Equations

When I try to run the code I get the following error message, even though I'm pretty sure it's possible to solve:

Warning: Unable to find explicit solution. For options, see help. 
> In solve (line 317)
  In Losning_af_model (line 5) 

Thank you!

Phil Goddard
  • 10,571
  • 1
  • 16
  • 28
Frederik
  • 21
  • 5
  • 2
    Did you try to run it? If so - what happened, and how did that differ from what you expected to get? – Dev-iL Sep 26 '19 at 09:19
  • Sorry, I have now added the error message I get when running the code. As stated, I expected to get expressions for m, s and h – Frederik Sep 26 '19 at 11:45
  • 1) This equation doesn't always have a solution. If e=1, t=1, or anything is zero, there are no solutions. This is enough to prevent Matlab from finding a solution. 2) You can simplify this a lot by noticing that the big set of brackets is the same in each equation. This lets you eliminate it, and write `m`, `s`, and `h` in terms of some other variable, and then solve one equation to get the value of that variable, and hence obtain `m`, `s`, and `h`. Matlab needs a lot of simplifications and assumptions of the values of the parameters to be able to do that. – David Sep 27 '19 at 01:54
  • Why do you want to solve it symbolic? Do you really need an analytic solution? – Thales Sep 27 '19 at 10:10

0 Answers0