Solve for a system of equations

Kwanjai Yoo (view profile)

on 7 Jun 2019
Latest activity Answered by Walter Roberson

Walter Roberson (view profile)

on 7 Jun 2019
Hi, I am trying to solve a system of non-linear equations for 5 variables. I applied 'solve' and expected this code would derive 5 answers but it doesn't. Only a warning message "Unable to find explicit solution" was shown.
I am a beginner of Matlab, so this question might be too easy for someone.
Here is my code.
syms c x e b k %variables
syms alpha beta delta n e_bar%parameters
eqns = [alpha*k^(alpha-1) == n/beta,...
n == beta*(1-alpha)^2*e^(-alpha)*e^alpha*k^alpha,...
n*c == beta*x,...
e^(1-alpha)*e_bar^alpha*(k+(1-alpha)*k^alpha) == b-n*e-c,...
x+n*b == (e^(1-alpha)*e_bar^alpha*(1-alpha)*k^alpha+b-n*e-c)*alpha*k^(alpha-1)]
vars = [c x e b k]
solve(eqns,vars)

John D'Errico (view profile)

on 7 Jun 2019

This is not actually a question about MATLAB.
Why would you assume that every set of complicated nonlinear equations has an explicit, analytical solution?
"Unable to find explicit solution"
It says what it means. Computers are not all powerful. They cannot solve every problem that you might pose. That only happens on TV or in the movies. And that is probably why you assume that mathematics can solve all problems.
If you have explicit values for the parameters, then you can use a nonlinear numerical solver, and hope that it can find a solution. Note that often there may be multiple solutions if any exist at all, and that numerical solver might find the wrong one, or one that you don't like. That means you will need to provide good starting values.