solving an implicit function with two variables

Hi, I am trying to solve the equation below for a value of P. If I use the command solve, the code is taking too long to run. After half an hour I stopped running the code. Is there a better way to go about this?
syms C Q y P r real
eqn1=(C/r)*((P)^(-r))*(Q^(1-r))+((y)^(1-2*r))*(P)^r*Q^r-(y)^(1-r)==0;
solP=solve(eqn1,P)

 Respuesta aceptada

Torsten
Torsten el 2 de Abr. de 2019

1 voto

Multiply by P^r and substitute P^r = x. You'll get a quadratic equation in x.
Solutions are
P1 = ( (Q^(-r)) / 2 * (1 + sqrt(1 - 4 * C/r * Q* y^(r-1) ) ) ) ^(1/r)
P2 = ( (Q^(-r)) / 2 * (1 - sqrt(1 - 4 * C/r * Q * y^(r-1) ) ) ) ^(1/r)

3 comentarios

Neaketa Chawla
Neaketa Chawla el 2 de Abr. de 2019
Thank you! That was really simple.
Matt J
Matt J el 2 de Abr. de 2019
@Naeketa, you should Accept-click Torsten's answer, since it seems to have addressed your problem.
Neaketa Chawla
Neaketa Chawla el 3 de Abr. de 2019
sorry, I am new to this. Did not know thats how it worked. Thank you. :)

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 2 de Abr. de 2019

Comentada:

el 3 de Abr. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by