[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DAE solver with additional parameters

From: Yu Liu
Subject: Re: DAE solver with additional parameters
Date: Wed, 2 Jul 2014 08:41:16 -0700

I am not sure if this help, but how about using ode package that is similar to Matlab's solver.

You can pass additional parameters directly in the ode45 function call. Additionally, differential algebraic equations could be solved by the same function by using 'Mass' option, if your problem can be written in a compatible format.

On Tue, Jul 1, 2014 at 10:00 PM, lordgogi <address@hidden> wrote:


I use Octave to simulate thermodynamic system. I have a set of DAE and solve
them with
dassl function. However I would like to pass additional parameters. Can
anyone help me with that? I also tried to use global variables but it does
not work either.

Thank you


x =
xdot =
t = linspace(0,time_stop);
[x, xdot] = dassl("f", x, xdot, t);

/function res = f (x, xdot, t)
res (1) = xdot(9)+xdot(11)+xdot(7)-xdot(1);
res (2) = xdot(8)+xdot(10)-xdot(2);
res (3) = x(3)+x(4)+x(5)-x(2);
res (4) =
res (5) = x(3)*XSteam('vL_p',x(6))+x(4)*XSteam('vV_p',x(6))-3;
res (6) = x(5)*XSteam('v_pT',x(6),450)-3;
res (7) = 8600-xdot(7);
res (8) =
res (9) = xdot(8)*XSteam('h_pT',x(6),450)-xdot(9);
res (10) =x(13)-xdot(10);
res (11) = xdot(10)*XSteam('hL_p',x(6))-xdot(11);
res (12) = 0.00015*(x(6)-33)-xdot(12);
res (13) = 0.0005*(1596.7-x(3))-xdot(13);

View this message in context:
Sent from the Octave - General mailing list archive at

Help-octave mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]