I have a system of four nonlinear equations. Some of the exponents are fractions. I was wondering if this is what is causing NSolve
to run for hours without giving any results.
I first create a list of parameters that I eventually want to play around with to see how results change. This parameter list is "dat". I then specify the equations as follows:
dat = {alpha -> 1/3, beta -> 1/3, sigma -> 1/3, gam -> 0.5,
psy -> 0.5, delta -> 0.5, vu -> 0.5, a -> 1, A -> 1/3, B -> 1/3,
C -> 1/3, Ls -> 10, T -> 10, mc -> 1.5}
{p2 - w^psy pw^gam ((psy/gam)^gam + (gam/psy)^psy) == 0,
Ls - (beta/w)^(alpha + sigma) (pw/(alpha (1 + a C r T)))^
alpha (r/sigma)^sigma (w Ls delta + r T A) - (pw psy/w gam)^
gam ((w Ls vu + r T B)/p2) == 0,
T - (sigma/r)^(alpha + beta) (w/beta)^
beta (pw/(alpha (1 + a C r T)))^alpha (w Ls delta + r T A) == 0,
pw - (((((1 + a C r T) alpha)/pw)^(beta + sigma) (w/beta)^
beta (r/sigma)^
sigma (w Ls delta + r T A) + ((w gam)/(psy pw))^
psy ((w Ls vu + r T B)/p2)) mc (1 +
a C r T))/((((1 + a C r T) alpha)/pw)^(beta + sigma) (w/
beta)^beta (r/sigma)^
sigma (w Ls delta + r T A) + ((w gam)/(psy pw))^
psy ((w Ls vu + r T B)/p2) (1 + a C r T)) == 0} /. dat
And then proceed with NSolve
:
NSolve[%, {w, r, p2, pw}, Reals]
But Nothing happens. I tried using Rationalize
but it does not seem to help. I am new to Mathematica so I hope that I am doing something wrong and that I missed something and can solve the system. Any suggestions?
Finally, how can I loop and redo this calculation with different parameters in the "dat" list?
Comments
Post a Comment