필터 지우기
필터 지우기

Real solution for a variable in an equation

조회 수: 5 (최근 30일)
M
M 2022년 8월 28일
댓글: M 2022년 8월 29일
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)

채택된 답변

Chunru
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
Chunru
Chunru 2022년 8월 29일
But it is proved that your problem has no real solution.
M
M 2022년 8월 29일
Yeah that's true...

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Special Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by