how to solve one variable in non linear equation?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
M.Rameswari Sudha
le 12 Jan 2023
Commenté : M.Rameswari Sudha
le 12 Jan 2023
In my coding I couldn't get the value for t1. I get the answer in cubic equation of another variable z. But I didn't use z anywhere in my codind. Anyone help and tell how to get the answer for t1.
clc
clear all
T=12; u1=4;u2=8;a=30;b=5;a2=100;A=500;c2=10;c3=12;c4=8;D0=115; b2=0.2;
a=0.01;d=0.2;m=0.5;k1=0.5;k0=1;k2=2;
syms t1
c1=5;
h=(1./T).*(c1.*((b-a)-b.*t1-(a+b.*(1+m)./(1+m-t1)))+c2.*(b.*t1-(a+b.*(1+m)).*(t1./(1+m-t1)))+c3.*((a./k1)-((b./k1.^2).*(1-k1.*T)).*(((-u1.*k1)./(1+k1.*(t1-T))+1)-((1-k1.*T)./(1+k1.*(t1-T)))+(b.*k0.*(t1-u1)./k1)-(a-(b.*k0.*(1-k1.*T)./k1)).*((u2-u1)./(1+k1.*(t1-T)))+(k0.*D0./k1).*((k1.*(u1-u2)./(1+k1.*(t1-T)))-(a-(b.*k0./k1).*(1-k1.*T)).*((T-k2)./(1+k1.*(t1-T)))+(b.*k0./k1).*(u2-T)-(1-k1.*T).*((T+u2)./(1+k1.*(t1-T)))+c4.*(-a2+b2.*t1+k0.*(a-(b./k1).*(1-k1.*T).*(1./(1+k1.*(t1-T))+(b./k1))))))));
t1=solve(h)
disp(t1)
0 commentaires
Réponse acceptée
Torsten
le 12 Jan 2023
T=12; u1=400;u2=8;a=30;b=5;a2=100;A=500;c2=10;c3=12;c4=8;D0=115; b2=0.2;
a=-1.1;d=11.2;m=-0.5;k1=1.5;k0=1.1;k2=2;
syms t1
c1=5;
h= (1./T).*(c1.*((b-a)-b.*t1-(a+b.*(1+m)./(1+m-t1)))+c2.*(b.*t1-(a+b.*(1+m)).*(t1./(1+m-t1)))+c3.*((a./k1)-((b./k1.^2).*(1-k1.*T)).*(((-u1.*k1)./(1+k1.*(t1-T))+1)-((1-k1.*T)./(1+k1.*(t1-T)))+(b.*k0.*(t1-u1)./k1)-(a-(b.*k0.*(1-k1.*T)./k1)).*((u2-u1)./(1+k1.*(t1-T)))+(k0.*D0./k1).*((k1.*(u1-u2)./(1+k1.*(t1-T)))-(a-(b.*k0./k1).*(1-k1.*T)).*((T-k2)./(1+k1.*(t1-T)))+(b.*k0./k1).*(u2-T)-(1-k1.*T).*((T+u2)./(1+k1.*(t1-T)))+c4.*(-a2+b2.*t1+k0.*(a-(b./k1).*(1-k1.*T).*(1./(1+k1.*(t1-T))+(b./k1))))))));
t1=vpasolve(h,t1,[0 1])
double(subs(h,t1))
Plus de réponses (1)
VBBV
le 12 Jan 2023
clc
clear all
T=12; u1=400;u2=8;a=30;b=5;a2=100;A=500;c2=10;c3=12;c4=8;D0=115; b2=0.2;
a=-1.1;d=11.2;m=-0.5;k1=1.5;k0=1.1;k2=2;
syms t1
c1=5;
h=@(t1) (1./T).*(c1.*((b-a)-b.*t1-(a+b.*(1+m)./(1+m-t1)))+c2.*(b.*t1-(a+b.*(1+m)).*(t1./(1+m-t1)))+c3.*((a./k1)-((b./k1.^2).*(1-k1.*T)).*(((-u1.*k1)./(1+k1.*(t1-T))+1)-((1-k1.*T)./(1+k1.*(t1-T)))+(b.*k0.*(t1-u1)./k1)-(a-(b.*k0.*(1-k1.*T)./k1)).*((u2-u1)./(1+k1.*(t1-T)))+(k0.*D0./k1).*((k1.*(u1-u2)./(1+k1.*(t1-T)))-(a-(b.*k0./k1).*(1-k1.*T)).*((T-k2)./(1+k1.*(t1-T)))+(b.*k0./k1).*(u2-T)-(1-k1.*T).*((T+u2)./(1+k1.*(t1-T)))+c4.*(-a2+b2.*t1+k0.*(a-(b./k1).*(1-k1.*T).*(1./(1+k1.*(t1-T))+(b./k1))))))));
t1=fsolve(h,[0 1])
disp(t1)
4 commentaires
VBBV
le 12 Jan 2023
Read about fsolve for more info. Try with different initial values. I have shown an e.g.
Voir également
Catégories
En savoir plus sur Numbers and Precision dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!