How to find the points where two lines cross?

조회 수: 5 (최근 30일)
Will Jeter
Will Jeter 2020년 11월 11일
편집: Matt J 2020년 11월 11일
I need help finding the intersection of the two functions from this graph. I would like to have markers and have the command window tell me what the tmeprature value is at each point
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);
G = x*-dHrxn;
figure
hold all
plot(T,R)
plot(T,G)
legend('R(T)','G(T)')
xlabel('Temperature (K)')
ylabel('G(T) and R(T) (cal/mol)')
title('G(T) and R(T) vs. T')

채택된 답변

Matt J
Matt J 2020년 11월 11일
편집: Matt J 2020년 11월 11일
T1=fzero(@GRdiff,[350,400])
T1 = 377.5263
T2=fzero(@GRdiff,[400,450])
T2 = 418.3883
function out=GRdiff(T)
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);
G = x*-dHrxn;
out=R-G;
end

추가 답변 (0개)

카테고리

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