octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #57508] Add an example for calling lsode


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #57508] Add an example for calling lsode
Date: Mon, 30 Dec 2019 21:59:54 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?57508>

                 Summary: Add an example for calling lsode
                 Project: GNU Octave
            Submitted by: siko1056
            Submitted on: Tue 31 Dec 2019 03:59:53 AM CET
                Category: Documentation
                Severity: 1 - Wish
                Priority: 5 - Normal
              Item Group: Documentation
                  Status: Confirmed
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

>From the mailing-list
https://lists.gnu.org/archive/html/help-octave/2019-12/msg00131.html

An example code using "lsode" for beginners...

"Test.m" calls the function file "ODE.m"

Content of "Test.m"


t = linspace (0, 50, 10);       % Time interval for integration
y0 = [ 4; 1.1; 4 ];             % Initial condition for Y(0)
B=[77.27 8.375e-06 0.161];      % Additional fixed parameters used in ODE
funct=@(y0,t)ODE(y0,t,B);       % create a function to supply to LODE
y = lsode (funct, y0, t)        % Call LODE to solve


Content of "ODE.m"


function y = ODE (x, t, B)

y = zeros (3,1);

y(1) = B(1) * (x(2) - x(1)*x(2) + x(1) - B(2)*x(1)^2);
y(2) = (x(3) - x(1)*x(2) - x(2)) / B(1);
y(3) = B(3)*(x(1) - x(3));

endfunction





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57508>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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