필터 지우기
필터 지우기

I want to find unknown value for nonlinear equation.

조회 수: 2 (최근 30일)
M.Rameswari Sudha
M.Rameswari Sudha 2022년 3월 14일
댓글: M.Rameswari Sudha 2022년 3월 16일
I want to find t1 value by search method with mesh grid plot between t1 and TC. Anyone help me to do this problem.
function tcfun()
clc
close all
t1=0:0.5:3;
TC=f(t1);
r0=[0.20;10];
alfa=0.2;
while abs (f(r0(1))) > 1e-2
r0 = r0 - alfa.*(f(r0(1)))./fprime(r0(1));
end
hold on
r0=[0.1]
alfa=0.2;
for index = 1:100
r0 = r0 - alfa.*inv(fdb1prime(r0(1)).*fprime(r0(1)));
end
r0
f(r0(1))
plot(r0(1),f(r0(1)),'rs','Markersize',20)
function TC = f(t1)
A0 =500;
D0=100;
c1=5;
c2=10;
c3=10;
c4=8;
a=30;
a2=40;
m=0.5;
b=5;
b2=7;
mu1=4;
mu2=8;
T=12;
k1=0.01;
k0=0.03;
TC=(1./T).*(A0+c1.*((b-a).*t1-(b.*t1^2./2)+(a+b.*(1+m)).*log((1+m-t1)./(1+m)))+c2.*((b.*t1^2./2)+(a+b.*(1+m)).*(t1+(1+m).*log(1+m-t1)))+c3.*((a./k1)-(b.*(1-k1.*T)./k1^2).*(mu1.*(log((1+k1.*(mu1-T))./(1+k1.*(t1-T)))-1)+t1)+((1-k1.*T)./k1).*(log((1+k1.*(mu1-T))./(1+k1.*(t1-T))))+(b.*k0./2.*k1).*(mu1-t1).^2+((a./k1)-(b.*k0.*(1-k1.*T)./k1^2).*(log((1+k1.*(mu1-T))./(1+k1.*(t1-T)))).*(mu2-mu1)+(k0.*D0./k1).*(mu2.*(log((1+k1.*(mu2-T))./(1+k1.*(t1-T)))-1)-mu1.*(log((1+k1.*(mu1-T))./(1+k1.*(t1-T)))-1)+((1-k1.*T)./k1).*(log((1+k1.*(mu2-T))./(1+k1.*(mu1-T))))+((a./k1)-(b.*k0.*(1-k1.*T)./k1^2).*(log((1+k1.*(mu1-T))./(1+k1.*(t1-T)))).*(T-mu2)+(b.*k0./k1).*(mu1-t1).*(T-mu2)+(k0.*D0./k1).*(log((1+k1.*(mu2-T))./(1+k1.*(mu1-T)))).*(T-mu2)-(k0.*b2./2.*k1).*(mu2-T).^2+((1./k1)-T)+(T-(1./k1)).*(T.*(log(1+k1(t1-T))-1)-mu2.*(log((1+k1.*(mu2-T))./(1+k1.*(t1-T)))-1))+(T-(1./k1)).*log(1+k1.*(mu2-T))))+c4.*(a.*(mu1-t1)+(b2./2).*(mu1.^2-t1.^2)-k0.*(a./k1)-(b.*(1-k1.*T)./k1^2).*(log((1+k1.*(mu1-T))./(1+k1.*(t1-T))))+(b./k1).*(mu1-t1))+D0.*(mu2-mu1)-(D0.*k0./k1).*(log((1+k1.*(mu2-T))./(1+k1.*(mu1-T))))+(1./2.*b2).*((a2-b2.*mu2).^2-(a2-b2.*T).^2)+k0.*a2.*log(1+k1.*(mu2-T))-(b2./k1).*(T-mu2)+(b2./k1).*(T-(1./k1)).*log(1+k1.*(mu2-T)))));
function TCprime = fprime(t1)
dfdt1=(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.*(1-k1.*T)./k1^2).*(((-mu1.*k1)./(1+k1.*(t1-T)))+1)-((1-k1.*T)./(1+k1.*(t1-T)))+((b.*k0.*(t1-mu1))./k1)-((a-b.*k0.*(1-k1.*T))./k1).*((mu2-mu1)./(1+k1.*(t1-T)))+(k0.*D0./k1).*((k1.*(mu1-mu2)./(1+k1.*(t1-T)))-(a-((b.*k0.*(1-k1.*T))./k1)).*((T-k2)./(1+k1.*(t1-T)))+(b.*k0.*(mu2-T)./k1)-(1-k1.*T).*((T+mu2)./(1+k1.*(t1-T)))))+c4.*(-a2+b2.*t1+k0.*((a-b.*(1-k1.*T))./k1).*(1./(1+k1.*(t1-T)))+(b./k1)));
end
end
end
mesh(t1,TC)
  댓글 수: 7
Torsten
Torsten 2022년 3월 15일
I got the answer. But I need feasible solution. so , I want to apply optimization by using any one of search method.
But how can you be sure your method gives a feasible solution ?
As shown by the symbolic computation, there are three solutions for t1. Your Newton method will converge to any of them depending on the starting guess you choose for t1.
M.Rameswari Sudha
M.Rameswari Sudha 2022년 3월 16일
Yes, You are correct. I misunderstood the method of finding the solution. Thank you for providing the right suggestion. Thank you.

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

답변 (0개)

카테고리

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

제품


릴리스

R2009b

Community Treasure Hunt

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

Start Hunting!

Translated by