'ReturnConditions' creates error in 'solve'
Show older comments
Hi! I am trying to solve the following system of equations analytically. Matlab can't solve the general case (in which phi is not specified) so I set its value to -1.
syms i1 i2 gamma phi w r
firstfoc=( (2+r)*w/(1+r) ) * ...
(gamma*i1^phi + (1-gamma)*i2^phi)^(1/phi)*gamma*i1^(phi-1)==1+r
secondfoc=((2+r)*w/(1+r) ) * ...
(gamma*i1^phi + (1-gamma)*i2^phi)^(1/phi)*(1-gamma)*i2^(phi-1)==1
firstfoc=subs(firstfoc,phi,-1)
secondfoc=subs(firstfoc,phi,-1)
[i1sol, i2sol]=solve(firstfoc, secondfoc, i1, i2)
[i1sol, i2sol]=solve(firstfoc, secondfoc, i1, i2,'ReturnConditions',true)
As you can see, the first call to "solve" returns an answer, but warns that it's parameter-dependent and advises setting 'ReturnConditions' to true. However, doing so causes a rather opaque error. What's going on here, and is there an easy way to tell over what regions in the (gamma, w, r) parameter space there is a solution?
Any help would be greatly appreciated!
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






