I have a first order ODE with temperature as the dependent variable. In the equation I have two material properties that change as the temperature changes. I have them stored as arrays. How do I implement these arrays into ODE45?

1 次查看(过去 30 天)
this is my attempt... it did not work at all:
function [comp] = f(t,T)
load('cB_dmag_data.mat','c','d')
dB = 0.1;
cB = c((T-270),(dB/0.1)); dmag = d((T-270),(dB/0.1));
comp = -(1/cB)*dmag*dB*T;
%'c' and 'd' are both arrays that give the value of specific heat and dM/dT at different temperatures and magnetic fields
Any help would be greatly appreciated.
Cheers

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by