In a system of simultaneous equations, Matlab [version R2016a] finds a solution – but fails to find this (still valid) solution when I add an additional (and for the solution irrelevant) equation to the system.
This is (a simpler version of) my code:
syms g p l h1 h2 h3
% set assumptions
g=0;
assume(0<p<1);
assume(0<l<1);
assume(0<h1<1);
assume(0<h2<1);
assume(0<h3<1);
assumeAlso(h2<h1);
assumeAlso(h3<h2);
% equations
H1 = g^2+2*g*p*l*p/(1-g*l)+p^2*l^2;
H2 = g^2*(H1)+2*g*p^2*l^3 + 2*g^2*p^2*l^2/(1-g*l) + p^2*l^4;
H3 = g^2*(H2)+2*g*p^2*l^5 + 2*g^2*p^2*l^4 + 2*g^3*p^2*l^3/(1 - g*l) + p^2*l^6;
Now, using only the first two equations yields a solution for both parameters
solve([H1-h1,H2-h2],[l,p])
solution =
l: [1x1 sym]
p: [1x1 sym]
ans = h2^(1/2)/h1^(1/2) ans = h1/h2^(1/2)
But "offering" all three equations to Matlab, I do not find a solution. Anyone an idea why this might be? I am not very experienced with Matlab, so I might miss something fundamental here.
solution=solve([H1-h1,H2-h2,H3-h3],[l,p])
solution =
l: [0x1 sym]
p: [0x1 sym]