how can i find the intersection point between the two curves and the minimum point to the other curve?

조회 수: 1 (최근 30일)
k1=10^-4;k2=2*10^5
k2 = 200000
d=0.08;
a=50*10^-6:1*10^-6:100*10^-6;
cr =k1./a;
cf =k2*d.*a;
ctot =cr+cf;
plot(a,cr,a,cf,a,ctot)
title('optimal')
xlabel('cross section area')
ylabel('costs')
legend('cr','ctot','cf')
0001 Screenshot.png

채택된 답변

Image Analyst
Image Analyst 2019년 10월 26일
Do you want the (harder) analytical answer (like from the formula) or the (easier) digital answer from the digitized vectors, like
distances = abs(cf-cr)
[minDistance, indexAtMin] = min(distances);
y1AtMin = cf(indexAtMin)
y2AtMin = cr(indexAtMin)
aAtMin = a(indexAtMin)
hold on;
line([aAtMin, aAtMin], ylim);
  댓글 수: 4
Image Analyst
Image Analyst 2019년 10월 26일
MATLAB is NOT needed for an analytical solution. Haven't you taken a calculus course yet?

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

추가 답변 (1개)

mohamed asran
mohamed asran 2020년 11월 9일
clc
clear all
r=0.05;
l=0.01;
st=0.0001;
v=220;
Kf=18;
j=3;
Tl=60;
i=0;
w=0;
I=[];
W=[];
t=[];
for dt=0:0.0001:1
I=[I i];
t=[t dt];
W=[W w];
i=i+(((v-r*i)-(Kf*w)/l)*st);
w=w+((((Kf*i)-Tl)/j)*st);
end
plot(t,W,'linewidth',4)
xlabel('time (sec)','fontsize','18','fontweight','b');
ylabel('SPEED (rpm)','fontsize','22','fontweight','b');
title('Dynamic model of separately excited dc motor under constant excitation');
axis([0 0.1 0.5])
gri;d
plot(t,I,'linewidth',4)
xlabel('time (sec)','fontsize','18','fontweight','b');
ylabel('current (A)','fontsize','22','fontweight','b');
title('current response of rl circuit');
axis([0 0.1 0.5])

카테고리

Help CenterFile Exchange에서 Curve Fitting Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by