At the moment I am stuck with the following code, when specified to use root , quadratic or log utility functions all it fine, only exponentials like:
$\small \left\{-e^{-c_{0,1}}-0.25 e^{-c_{1,1}}-0.25 e^{-c_{2,1}}-0.5 e^{-c_{3,1}}\right\}$ s.t $ \small\left\{\text{pr}_1 \left(c_{1,1}-5\right)+\text{pr}_2 \left(c_{2,1}-10\right)+\text{pr}_3 \left(c_{3,1}-10\right)+c_{0,1}-10\right\}$
won't give out any solution, even when all equations (market-clearing like sum of agents consumption equal to endowments of state) are specified.
The whole file can be downloaded here. Every section is explained. The utility-function is modified from-to:
Subscript[Vf, 1][j_, i_, \[Alpha]_] := consall[[i, j]] - \[Alpha]*consall[[i, j]]^2
Subscript[Vf, 1][j_, i_, \[Alpha]_] := -Exp[-consall[[i, j]]]
First one gives output of the two solutions:
$$\small \left\{\left\{c_{-1,1}\to 0.816667,c_{-1,2}\to 0.883333,c_{0,1}\to 9.16667,c_{0,2}\to 5.83333,c_{1,1}\to 9.16667,c_{1,2}\to 5.83333,c_{2,1}\to 9.16667,c_{2,2}\to 5.83333,c_{3,1}\to 50.,c_{3,2}\to 50.,\text{pr}_1\to 0.25,\text{pr}_2\to 0.25,\text{pr}_3\to 0.\right\},\left\{c_{-1,1}\to 0.824265,c_{-1,2}\to 0.875735,c_{0,1}\to 8.78673,c_{0,2}\to 6.21327,c_{1,1}\to 8.78673,c_{1,2}\to 6.21327,c_{2,1}\to 8.78673,c_{2,2}\to 6.21327,c_{3,1}\to 11.211,c_{3,2}\to 8.78896,\text{pr}_1\to 0.25,\text{pr}_2\to 0.25,\text{pr}_3\to 0.470588\right\}\right\}$$
Exponential only yield the message: "Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Solve require exact input, providing Solve with an exact version of the system may help."
All parameters are given numerical(random or specified) values so that it should solve the system. FindRoot is not suitable as the number of solutions are too big to find the right one even if ranges are specified (ranges of mx(n-1)+n-1 variables would have to be stated !!) Any help would be great, Thanks!
NSolve[]
is really only meant for algebraic equations; once you throw in transcendentals, you useFindRoot[]
along with a good guess, or give up in despair. $\endgroup$NSolve[]
is even less suitable here. Do you really not have any good guesses for the parameters you're solving? $\endgroup$