Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Problem initialising with ODE45

1 Ansicht (letzte 30 Tage)
Peter
Peter am 17 Sep. 2012
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hello all,
I've got a problem with ODE45. Essentially when I call my derivative function "TANKONEDIM", ODE45 doesn't seem to initialise the parameter T (which is a 20 element column vector) and so the simulation falls over. I've checked that all the matrices etc are coming out as the correct size...
Any ideas?
Best
Pete
function [t T] = TankSolver(T0,T,TankGeometry,TankVolume,Outflow,Tamb,Qe);
tspan = [0 3600]; [t T] = ode45(@TANKONEDIM,tspan,T0); end
function dTdt = TANKONEDIM(T,T0,NodeCount,TankVolume,TankGeometry)
global Heat_Matrix
global HeatSources
dTdt = Heat_Matrix*T+HeatSources
end
  3 Kommentare
Peter
Peter am 17 Sep. 2012
The NodeCount, TankVolume and TankGeometry arguments are redundant but I was thinking they might be required once I've got the solver working... atm they're just place holders...
Peter
Peter am 17 Sep. 2012
Ah, just realised that I didn't have the time variable in there which prevented it from working!
Apologies
Pete

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by