# bug #63493: ode15s unexpected error on stiff Van der Pol equation

 Submitter: Nicholas Jankowski Submitted: Fri 09 Dec 2022 03:30:54 AM UTC Category: Octave Function Severity: 3 - Normal Priority: 5 - Normal Item Group: Unexpected Error or Warning Status: None Assigned to: None Originator Name: Nicholas Jankowski Open/Closed:  * Open Release:  * dev Operating System:  * Any Fixed Release: None Planned Release: None
* Mandatory Fields

Comment Type & Canned Response:

## Discussion

Fri 09 Dec 2022 03:43:20 AM UTC, comment #1:

regarding the performance, I was running Reference BLAS, and wondered if switching to OpenBLAS would make a difference with ode45. at least on windows, it did not (maybe 10% if we trust some non-statistically sound tic-tocs).

Nicholas Jankowski <nrjank>
Fri 09 Dec 2022 03:30:54 AM UTC, original submission:

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)

Nicholas Jankowski <nrjank>

## Attached Files

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Comment:

No files currently attached

## Dependencies

Depends on the following items: None found

Items that depend on this one: None found

Carbon-Copy List
• -email is unavailable- added by nrjank (Submitted the item)
•

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only project members can vote.

## History

No changes have been made to this item