how to solve the nonlinear equatios?
Show older comments
syms T v
p=30;a=7;d=1;lamda=0.8;c=10;r=35;h=0.05;w=200;k=0.02;b=7;
M=k*a;
%eqn1=(1/T)*(p*d-((lamda*p*d*v)/T)-(d*exp(-(w-k)*v)-(d*v/T))*c-d*((v/T)-1)*r-(d/(w-k))*(1-exp(-(w-k)*v)*h)))==0'
%eqn2=((1/T)*(-(d*c*v*exp(-(w-k)*v)*M/(w-k))+(((d*c*(1-exp(-(w-k)*v))+h*d*v*(1+exp(-(w-k)*v)))*M)/(w-k)^2)+((2*h*d*(exp(-(w-k)*v)-1)*M)/(w-k)^3)-1))== 0
eqns = solve('((1/T)*(p*d-((lamda*p*d*v)/T)-(d*exp(-(w-k)*v)-(d*v/T))*c-d*((v/T)-1)*r-(d/(w-k))*(1-exp(-(w-k)*v)*h)))==0','((1/T)*(-(d*c*v*exp(-(w-k)*v)*M/(w-k))+(((d*c*(1-exp(-(w-k)*v))+h*d*v*(1+exp(-(w-k)*v)))*M)/(w-k)^2)+((2*h*d*(exp(-(w-k)*v)-1)*M)/(w-k)^3)-1))== 0');
solve(eqns,T,v)
4 Comments
KSSV
on 2 Jan 2020
What problem you facing ?
KSSV
on 2 Jan 2020
M. Rameswari Sudha commented:
I didn't get the answer for T and v. I got the answer simply ans = [ empty sym ]. solve and get the answer.
KSSV
on 2 Jan 2020
YOu cannot use solve at the step eqns = . What are the equations exactly? Can you explain the problem.
M.Rameswari Sudha
on 2 Jan 2020
Edited: M.Rameswari Sudha
on 2 Jan 2020
Answers (1)
KSSV
on 2 Jan 2020
Try this.
syms v T
p=30;d=1;lamda=0.8;c=10;r=35;h=0.05;chi=200;k=0.02;b=7;a =0.01;
w = k*(1-exp(-a*chi));
M=k*a;
equation1=(1/T)*[(p*d-((lamda*p*d*v)/T)-(d*exp(-(w-k)*v)-(d*v/T))*c-d*((v/T)-1)*r-(d/(w-k))*(1-exp(-(w-k)*v)*h))]==0 ;
equation2=(1/T)*[-(d*c*v*exp(-(w-k)*v)*M/(w-k))+(((d*c*(1-exp(-(w-k)*v))+h*d*v*(1+exp(-(w-k)*v)))*M)/(w-k)^2)+((2*h*d*(exp(-(w-k)*v)-1)*M)/(w-k)^3)-1]== 0 ;
eqns = [equation1, equation2] ;
S = solve(eqns,[ T v]) ;
2 Comments
M.Rameswari Sudha
on 2 Jan 2020
syms v T
p=30;d=1;lamda=0.8;c=10;r=35;h=0.05;chi=200;k=0.02;b=7;a =0.01;
w = k*(1-exp(-a*chi));
M=k*a;
equation1=(1/T)*[(p*d-((lamda*p*d*v)/T)-(d*exp(-(w-k)*v)-(d*v/T))*c-d*((v/T)-1)*r-(d/(w-k))*(1-exp(-(w-k)*v)*h))]==0 ;
equation2=(1/T)*[-(d*c*v*exp(-(w-k)*v)*M/(w-k))+(((d*c*(1-exp(-(w-k)*v))+h*d*v*(1+exp(-(w-k)*v)))*M)/(w-k)^2)+((2*h*d*(exp(-(w-k)*v)-1)*M)/(w-k)^3)-1]== 0 ;
eqns = [equation1, equation2] ;
S = vpasolve(eqns,[ T v])
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!