help-octave
[Top][All Lists]
Advanced

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

Simulation of ZOH in ODE


From: Luigi Palopoli
Subject: Simulation of ZOH in ODE
Date: Thu, 24 Jun 1999 20:15:36 +0200

HI everyone,
Suppose I have a system of differential equations.
xdot = f(x,u,t)
u are command variables. I want to force the system with a discretized
command realizing an hybrid simulation (partly discrete, partly
continous)
To me the most obvious way of doing this is the following. Le f() be 
the function provided to lsode, u(), called by f, the function computing
the command,  old_t and sampled_command two global variables.
The function u(t) would contains like:

if floor(t/Tc) > floor(oldt/Tc)
        <update sampled_command>
%%otherwise leave unchanged

The variable oldt can be updated by the function f() at the end every
call. Now the problem is that t can go back and forth, so it is wise to
update the sampled_command if t goes back changing the above line in:

if (floor(t/Tc) > floor(oldt/Tc))|(t < oldt)
        <update sampled_command>
%%otherwise leave unchanged

This scheme simply doesn't work if u() depend on the sampled value of x.
Anyone able to suggest how to overcome this difficulty?
 
-- 
 ("`-''-/").___..--''"`-._                  Luigi Palopoli
   `6_ 6  )   `-.  (     ).`-.__.`)          Phd Student
   (_Y_.)'  ._   )  `._ `. ``-..-'      Scuola Superiore S. Anna
 _..`--'_..-_/  /--'_.' ,'               Via Carducci 40 - 56100
(il),-''  (li),'  ((!.-'                    Pisa - Italy
                                   Tel. +39-050-883451 Fx +39-050-883452
email: address@hidden
URL: hartik.sssup.it/~luigi



---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------



reply via email to

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