Plotting multiple numerical solutions of a non-polynomial equation
2 views (last 30 days)
Show older comments
Hi all,
I am a rather inexperienced MATLAB user with some very complex issue at hand for my thesis. Essentially, my problem is twofold. First, I want to approximate (all, or at least multiple) solutions for the following equations:
FOCemployee: 2*delta*m == b*exp(-2*m) + 0.5*b*exp(-m)
FOCfirm: (12-b)*0.25*(2*exp(-2*m)+exp(-m)*((2*exp(-2m)+1*exp(-m))/(2*delta-b*0.5(-4*exp(-2*m)-exp(-m))))-0.5(1-exp(-2*m)+1-exp(-m)) == 0
In particular, these equations are non-polynomial and hence vpasolve does not return all its solutions. Unfortunately I have not been able to find any other code that yields multiple solutions for those specific functions.
What I want to do with these solutions is essentially to depict how the optimal effort level (m*) and corresponding bonus (b*) change with the delta, preferably in two seperate graphs where the delta is on the x-axis. In general, I want to do this for some other functions as well, but I reckon that if I understand this particular case I might be able to infer the solutions to those cases.The range of delta for which I want to find the optimal effort and corresponding optimal bonus is from 0 to 1.
Can anybody please help me to accomplish this? I am using MATLAB R2017b. What I want looks essentially similar to Figure 1 on page 19 of this document: http://economics.sas.upenn.edu/~hfang/publication/giuseppe/jme_online.pdf
Kind regards,
Lennart
0 Comments
Answers (1)
Roger Stafford
on 8 Nov 2017
Edited: Roger Stafford
on 8 Nov 2017
One possibility is to use ‘fsolve’ on the two equations. You will need to give initial starting values for ‘m’ and ‘b’, and by varying these it will allow you to seek multiple solutions.
Another method would be to use the first equation to express ‘b’ entirely in terms of ‘m’ and ‘delta’ and then substitute that expression into the two places in the second equation where ‘b’ occurs. That will give you a single equation in the single unknown ‘m’. You can use ‘fzero’, again with various initial starting values.
Also with the above single equation and single unknown you can attempt to solve it symbolically using ‘solve’. Perhaps it would give you multiple solutions.
In all of the above you will need to do the above for numerous values of ‘delta’ in order to produce valid plots. It will presumably require a lot of effort.
2 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!