Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: ode solvers and outputing dependent variables
Date: Fri, 13 Mar 2009 13:18:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <gpdmea$4sf$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1236950282 5007 172.30.248.35 (13 Mar 2009 13:18:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 13 Mar 2009 13:18:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1753483
Xref: news.mathworks.com comp.soft-sys.matlab:524585

Hello

Is there any way to output dependent variables that are calculated within the 'ode function' or the 'event' function? For example:

function dxdt = odefun(t,x)
y = ugly function of t and x
z = ugly function of t and x
dxdt = [y*z; z];

since i'm calculating the values in 'odefun', i want to get y and z out so i dont have to calculate the values again after the ode solver (ie ode23s) is done. ideally, i'd be able to get the values of y and z for every time step.

right now the only options i see are to forgo using the matlab ode solver and write my own solver (i dont trust my ability to do this well) or to have the values written to a file each time step (doesnt seem very efficient).

Thanks