How to find the max value of a curve on a graph

조회 수: 8 (최근 30일)
Will Jeter
Will Jeter 2020년 11월 12일
답변: KSSV 2020년 11월 12일
I'm trying to find the max value of my G(T) curve(the parabolic one). Not sure how to het the value and make it show up as a marker on the graph
T = [310:1:450];
v = 1;
V = 10;
dHrxn = -80000;
UA = 3600;
kf0 = 1;
kc0 = 100;
T0 = 400;
ER = 20000;
CpA = 40;
kf = exp(-20000*(1./T-1/400));
kc = 100*exp((80000/1.987)*(1./T-1/400));
x = 1./(v./(V.*kf)+1+(1./kc));
R = 400*(T-310);
R1 = 400*(T-256);
R2 = 400*(T-233.5);
R3 = 400*(T-218.2);
R4 = 400*(T-391);
R5 = 400*(T-328);
R6 = 400*(T-346);
R7 = 400*(T-353.2);
G = x*-dHrxn;
figure
hold all
plot(T,R,T,G,T,R1,T,R2,T,R3,T,R4,T,R5,T,R6,T,R7)
legend('R(T)','G(T)','Ta=250K','Ta=225K','Ta=208K','Ta=400K','Ta=330K','Ta=350K','Ta=358K','Location','NorthWest')
axis([310 450 0 10*10^4])
xlabel('Temperature (K)')
ylabel('G(T) and R(T) (cal/mol)')
title('G(T) and R(T) vs. T')

답변 (1개)

KSSV
KSSV 2020년 11월 12일
If (x,y) are the data points.
[val,idx] = max(y) ;
plot(x,y)
hold on
plot(x(idx),y(idx),'*r')

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by