help-octave
[Top][All Lists]
Advanced

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

Sample program for DASSL


From: John W. Eaton
Subject: Sample program for DASSL
Date: Thu, 22 Feb 1996 05:13:56 -0600

address@hidden <address@hidden> wrote:

: Can someone e-mail to me a sample program that uses DASSL (the
: differential-algebraic solver?

Here is a very simple one:

  # initial conditions

  x = [0; 0];

  xdot = [1.0; -1.0];

  # residual function

  function res = f (x, xdot, t)
    res (2) = x(1) + x(2);
    res (1) = xdot(1) - 1.0 + x(1);
  endfunction

  # vector of output times

  t = [0, logspace (-2, 0.7, 100)]';

  # solve it

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

  # plot it

  plot (t, x);


jwe


reply via email to

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