You do not need to declare "ess". And you don't use "ratio". So your first line is
syms P S Z
"assume" is not the right way to declare equations. See the https://www.mathworks.com/help/symbolic/solve.html. Instead:
ess = (S-P)/(S^2-S*Z)
S1 = -2+2*sqrt(3)*i
ess = subs(ess,S,S1)
eqn = ess == 1/50
Now solve the equation for "P".
sol = solve(eqn,P)
sol =
- Z/25 + (3^(1/2)*54i)/25 - 46/25 + (3^(1/2)*Z*1i)/25
As you can see, it isn't possible to separate "Z" out from the solution to "P". Hence, you cannot get an answer in terms of Z/P.