Hi,
I am new to matlab and I am trying to solve symbolic equations.
Here is my code:
syms h a b p1 p2 r1 r2 d1 d2 p1=1/(1+d1) p2=1/(1+d2) h=((a-b)*(p1*(r1-d1)-p2*(r2-d2))+1)/2 h1=diff(h,d1) h2=diff(h,d2) eqs=[-(-h/(1+d1)^2+h1*p1)*(r1-d1)-(a/(a+b)-h*p1)+h1*p2*(r2-d2)==0, (h2*p2+(1-h)/(1+d2)^2)*(r2-d2)-(a/(a-b)-p2*(1-h))-h2*p1*(r1-d1)==0] unknowns=[p1,p2]
If I use solv=solve(eqs,unknowns) then it says The second argument must be a vector of symbolic variables.
What command should I use to solve for p1 and p2? And how can I put in a values for a, b and r1 to find the relationships between p1,p2 and r2?
Thank you very much.
Best Answer