Real solution for a variable in an equation

Hi all, I have an equation and I want to find the real solution (c>0), for eqn, but this code doesn't work. Could you please tell me what is wrong in the below code that I wrote. Thanks in advance for any help
V_plc=0.19;
Kf=0.18;
Kc=0.1;
Kp=0.15;
Kb=0.4;
Kh=0.05;
tau=0.18;
Ktau=0.045;
Vs=0.002;
Kbar=1.5e-5;
Ks=0.1;
Vpm=1.59e-4;
Kpm=0.15;
alpha0=6.81e-6;
alpha1=2.27e-5;
Kce=7;
delta=0.1;
gamma=5.5;
Kplc=0.055;
k_i=2;
ct=0.07;
syms c
p=(V_plc.*c.^2/(c.^2+Kplc.^2))./k_i;
h=Kh.^4./(Kh.^4+c.^4);
Po=((p.^2)*(c.^4).*h)./((p.^2).*(c.^4).*h.*(1+Kb)+Kb.*Kp.^2*(Kc.^4+c.^4-((c.^4*Kh.^4)./(c.^4+Kh.^4))));
jpm=Vpm.*(c.^2/(c.^2+Kpm.^2));
eqn=(((alpha1.*Kce.^4)./(jpm-alpha0))-Kce.^4).^(1/4)-((Vs.*c.^2)./(Kf.*Po.*(c.^2+Ks.^2)))-c==0;
S = solve(eqn,c,'Real',true)

 Risposta accettata

V_plc=0.19;
Kf=0.18;
Kc=0.1;
Kp=0.15;
Kb=0.4;
Kh=0.05;
tau=0.18;
Ktau=0.045;
Vs=0.002;
Kbar=1.5e-5;
Ks=0.1;
Vpm=1.59e-4;
Kpm=0.15;
alpha0=6.81e-6;
alpha1=2.27e-5;
Kce=7;
delta=0.1;
gamma=5.5;
Kplc=0.055;
k_i=2;
ct=0.07;
syms c
p=(V_plc.*c.^2/(c.^2+Kplc.^2))./k_i;
h=Kh.^4./(Kh.^4+c.^4);
Po=((p.^2)*(c.^4).*h)./((p.^2).*(c.^4).*h.*(1+Kb)+Kb.*Kp.^2*(Kc.^4+c.^4-((c.^4*Kh.^4)./(c.^4+Kh.^4))));
jpm=Vpm.*(c.^2/(c.^2+Kpm.^2));
% eqn=(((alpha1.*Kce.^4)./(jpm-alpha0))-Kce.^4).^(1/4)-((Vs.*c.^2)./(Kf.*Po.*(c.^2+Ks.^2)))-c==0;
% S = solve(eqn,c,'Real',true)
% The function you specified is a complex function that has no solution.
% Check out abs(f) which never reaches to 0.
f1= (((alpha1.*Kce.^4)./(jpm-alpha0))-Kce.^4).^(1/4)-((Vs.*c.^2)./(Kf.*Po.*(c.^2+Ks.^2)))-c;
fplot(real(f1), [0 1]); hold on
fplot(imag(f1), [0 1])
fplot(abs(f1), [0 1])
ylim([-1 1]*5)
xlim([0 0.4])

2 Commenti

But it is proved that your problem has no real solution.
Yeah that's true...

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Robust Control Toolbox in Centro assistenza e File Exchange

Richiesto:

M
M
il 28 Ago 2022

Commentato:

M
M
il 29 Ago 2022

Community Treasure Hunt

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

Start Hunting!

Translated by