How to find the points where two lines cross?

1 visualización (últimos 30 días)
Will Jeter
Will Jeter el 11 de Nov. de 2020
Editada: Matt J el 11 de Nov. de 2020
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')

Respuesta aceptada

Matt J
Matt J el 11 de Nov. de 2020
Editada: Matt J el 11 de Nov. de 2020
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

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by