MATLAB: Solve single non linear

fsolvenonlinearsolve

I have a non linear equation and need to solve for P. I tried it but couldn't get the answer for P. Could you help me.
eta*P/(B*h*f) = sqrt((eta*P)/(B*h*f)+ (4*k*T)/(q^2*R*B)+ Id/(q*B))
clear all;
clc;
B= 500*10^6;
l = 1.55 *10^-6;
R = 75;
T = 300;
eta = 0.9;
Id = 5*10^-9;
h = 6.625*10^-34;
c=3*10^8;
q= 1.6*10^-19;
f = c/l;
k = 1.38*10^-23;
% my equation is
eta*P/(B*h*f) = sqrt((eta*P)/(B*h*f)+ (4*k*T)/(q^2*R*B)+ Id/(q*B))
% I need to solve for P

Best Answer

syms P
B= 500*10^6;
l = 1.55 *10^-6;
R = 75;
T = 300;
eta = 0.9;
Id = 5*10^-9;
h = 6.625*10^-34;
c=3*10^8;
q= 1.6*10^-19;
f = c/l;
k = 1.38*10^-23;
% my equation is
eq = eta*P/(B*h*f) == sqrt((eta*P)/(B*h*f)+ (4*k*T)/(q^2*R*B)+ Id/(q*B))
% I need to solve for P
sol = vpasolve(eq,P)