help-octave
[Top][All Lists]
Advanced

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

Re: function writing in differential equations


From: Carlo de Falco
Subject: Re: function writing in differential equations
Date: Tue, 14 Oct 2008 15:36:17 +0100


On 14/ott/08, at 09:11, Olaf Till wrote:

On Mon, Oct 13, 2008 at 04:06:26PM -0700, genehacker wrote:

Hi,

I am using dassl to solve algebraic differential equations and want to write a variable as a function of time according to the dassl condition 0 =
f(x,xdot,t)

If I tried writing x(1) as a function only on time exponentially, like this, x(1) = exp(-10*t), it gives an error. I would like to know the correct way of writing a variable dependent only on time, if the function that solves
the ADE is function res = f(x,xdot,t);
Please help.

A variable which only depends on time does not belong into the vector
'x'. Cancel the equation for 'x(1)' from your function 'f'. If some
other equation in 'f' needed 'x(1)', substitute 'exp(-10*t)'
instead. If some other equation in 'f' needed 'xdot(1)', substitute
the derivative of 'x(1)' (-10*exp(-10*t)) instead.

Any variable which does not depend only on time, but its derivative
plays no role and the variable is not needed by another equation in
'f', should be calculated from the values of 'x', 'xdot', and 't'
after the integration is ready.

You should consider this and check if you really need a DAE solver,
not an ODE solver (which a former posting of yours suggested).

HTH, Olaf

genehacker,

If one component of the vector x is a known function of time there is no need to include it among the unknowns as Olaf noted. I think there is rather a problem with mathematical notation than with Octave syntax here. Could you write in mathematical terms the problem you need to solve?

c.



reply via email to

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