I get a not-expected solution of this 6 equations' non linear system. I have 6 equations, 6 variables and other 5 constants (symbolic).
import sympy as sy
P1,P2,P,k1,k2,d1,d2,delta,teta,d,H=sy.symbols('P1,P2,P,k1,k2,d1,d2,delta,teta,d,H')
#equilibria
eqV=P+P1+P2
eqM=P1*d*sy.cos(teta)-P2*d*sy.cos(teta)-P*H*sy.sin(teta)
#constitutive
soil1=P1+k1*d1
soil2=P2+k2*d2
#congruents
crot=sy.tan(teta)-(d1-d2)/2/d
cvert=delta-(d1+d2)/2
solution=sy.nonlinsolve((eqM,eqV,crot,cvert,soil1,soil2),[d1,d2,P1,P2,teta,delta])
inspecting solution I don't find symbolic constant 'H'. For me is unexpected.
So question is: How to solve in a correct way a system of nonlinear equations using SymPy?
eqMbycos(θ)and introduce a new variable,τ=tan(θ)in the 2 equationseqMandcrot, then you have a linear system ind₁,d₂,P₁,P₂,τ,δ- gboffi{P1: (-H*P**2*k1 - 2*P*d**2*k1*k2)/(H*P*k1 + H*P*k2 + 4*d**2*k1*k2), P2: (-H*P**2*k2 - 2*P*d**2*k1*k2)/(H*P*k1 + H*P*k2 + 4*d**2*k1*k2), d1: (H*P**2 + 2*P*d**2*k2)/(H*P*k1 + H*P*k2 + 4*d**2*k1*k2), d2: (H*P**2 + 2*P*d**2*k1)/(H*P*k1 + H*P*k2 + 4*d**2*k1*k2), delta: (H*P**2 + P*d**2*k1 + P*d**2*k2)/(H*P*k1 + H*P*k2 + 4*d**2*k1*k2), tau: (-P*d*k1 + P*d*k2)/(H*P*k1 + H*P*k2 + 4*d**2*k1*k2)}- gboffi