ode solver store solution

조회 수: 12 (최근 30일)
Ma
Ma 2012년 2월 24일
Hello im using this code calling it from main:
function Heat
[t,T]=ode15s(@dT_dt,[0,timespan],InitialTemp,options);
options = odeset('Jacobian',A);
return
function DT = dT_dt(t,T)
DT = A*T +b ;
return
i cant figure out how to store (t,T) in an array for using it somewhere else. Regards

답변 (1개)

Jan
Jan 2012년 2월 24일
You can export t and T as output:
function [t, T] = Heat
...
Then your function is called as:
[t, T] = Heat;
But I think there are bugs in your program: The variable A is neither defined inside the function Heat not inside DT. Do you have a function called "A"? Are you sure that you want to call odeset after the integration and not before?
  댓글 수: 1
Ma
Ma 2012년 2월 24일
Thank you so much for this Jan!
-A is defined inside "Heat"
- adding output argument to "Heat just work (Great!!)
- im pretty new to Mlab and the flow of data between functions and Handling get me a bit confused. Like this "pingpong " routine between DT and ode, should i put "heat after Dt ?
once more, thank you
p.s This is an exercise from some Electures

댓글을 달려면 로그인하십시오.

카테고리

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