Runge Kutta



load(dynamics);
k(x):= if oddp(floor(x/3)) then 1 else 0;
eq(t):=[2.3-k(t), -x +k(t)];
sol:rk(eq(t), [x,y],[3,5],[t, 0, 10, 0.3]);
sol[2];
This is the case for piecewise parameter. You may want to try
eq(t):=[x1(t), -x +k(t)]
where
x1(t):=if 2.3-k(t)>1 then 0 else 2.3-k(t);

On Tue, Mar 17, 2009 at 5:32 PM, Wilhelm Haager <wilhelm.haager at htlstp.ac.at
> wrote:

> Hello!
>
> I want to make a simulation using the function rk (Runke Kutta method)
> from the package "dynamics" in the following form:
>
>  rk([x2,1-x1-0.2*x2],[x1,x2],[0,0],[t,0,50,0.1])$
>
> I need to pass state events to rk, for example
> limitations like "if x>5 then 5 else x"
>
> Is that possible? If yes, how can that be done?
>
> Thanks
> Wilhelm Haager
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>



-- 
Tel: 023-66936158