Real solution for a variable in an equation
4 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
采纳的回答
Chunru
2022-8-29
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!