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

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

[Octave-bug-tracker] [bug #63493] ode15s unexpected error on stiff Van d


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #63493] ode15s unexpected error on stiff Van der Pol equation
Date: Thu, 8 Dec 2022 22:30:56 -0500 (EST)

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

                 Summary: ode15s unexpected error on stiff  Van der Pol
equation
                 Project: GNU Octave
               Submitter: nrjank
               Submitted: Thu 08 Dec 2022 10:30:54 PM EST
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: Nicholas Jankowski
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 08 Dec 2022 10:30:54 PM EST By: Nicholas Jankowski <nrjank>
both ode45 and ode15s are fine solving the example Van der Pol equation in
ode45:


fvdp = @(T,Y) [Y(2); (1 - Y(1)^2) * Y(2) - Y(1)];
[T,Y] = ode45 (fvdp, [0, 20], [2, 0]);


attempting to solve a stiff version of the equation takes longer, but both
solve.


fvdp = @(T,Y) [Y(2); 1000*(1 - Y(1)^2) * Y(2) - Y(1)];
>> tic;[T45,Y45] = ode45 (fvdp, [0, 20], [2, 0]);toc
Elapsed time is 22.3432 seconds.
>> tic;[T15s,Y15s] = ode15s (fvdp, [0, 20], [2, 0]);toc
Elapsed time is 0.0413609 seconds.


stretching out the solver time is impractical for ode45 due to solver time,
but should be no issue for ode15s.  However:


>> tic;[T15s,Y15s] = ode15s (fvdp, [0, 100], [2,0]);toc
Elapsed time is 0.0444329 seconds.
>> tic;[T15s,Y15s] = ode15s (fvdp, [0, 200], [2,0]);toc
Elapsed time is 0.0443571 seconds.
>> tic;[T15s,Y15s] = ode15s (fvdp, [0, 500], [2,0]);toc

[IDA ERROR]  IDASolve
  At t = 0 and h = 1.90735e-06, the error test failed repeatedly or with |h|
= hmin.

error: IDASolve failed
error: called from
    ode15s at line 324 column 22


something hits an error in the underlying solver.

Testing in Matlab 2022b:


>> fvdp = @(T,Y) [Y(2); 1000*(1 - Y(1)^2) * Y(2) - Y(1)];
>> tic;[T45,Y45] = ode45 (fvdp, [0,20], [2,0]);toc
Elapsed time is 0.156613 seconds.
>> tic;[T15s,Y15s] = ode15s (fvdp, [0,20], [2,0]);toc
Elapsed time is 0.067253 seconds.
>> tic;[T45,Y45] = ode45 (fvdp, [0,100], [2,0]);toc
Elapsed time is 0.695754 seconds.
>> tic;[T15s,Y15s] = ode15s (fvdp, [0,100], [2,0]);toc
Elapsed time is 0.014186 seconds.
>> tic;[T45,Y45] = ode45 (fvdp, [0,200], [2,0]);toc
Elapsed time is 1.376093 seconds.
>> tic;[T15s,Y15s] = ode15s (fvdp, [0,200], [2,0]);toc
Elapsed time is 0.001903 seconds.
>> tic;[T45,Y45] = ode45 (fvdp, [0,500], [2,0]);toc
Elapsed time is 2.800817 seconds.
>> tic;[T15s,Y15s] = ode15s (fvdp, [0,500], [2,0]);toc
Elapsed time is 0.003733 seconds.


i assume matlab was caching something for the ode15s t>200 runs. in any case,
it obviously didn't hit any internal errors. 

(confirmed the IDASolve error on both Windows with v8.01 and Ubuntu with
v9.01)







    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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