bugGNU Octave - Bugs: bug #49871, ode15s, MStateDependence option...

 
 

bug #49871: ode15s, MStateDependence option incorrect

Submitter:  Bill Greene <billgreene>
Submitted:  Sat 17 Dec 2016 06:58:17 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 05 Feb 2020 12:22:32 AM UTC, comment #3: 

From http://www.ece.northwestern.edu/local-apps/matlabhelp/techdoc/ref/ode45.html


The solvers of the ODE suite can solve problems of the form , with time- and state-dependent mass matrix . (The ode23s solver can solve only equations with constant mass matrices.) If a problem has a mass matrix, create a function M = MASS(t,y) that returns the value of the mass matrix, and use odeset to set the Mass property to @MASS. If the mass matrix is constant, the matrix should be used as the value of the Mass property. Problems with state-dependent mass matrices are more difficult:

    If the mass matrix does not depend on the state variable and the function MASS is to be called with one input argument, t, set the MStateDependence property to 'none'.
    If the mass matrix depends weakly on , set MStateDependence to 'weak' (the default) and otherwise, to 'strong'. In either case, the function MASS is called with the two arguments (t,y).


From http://www.ece.northwestern.edu/local-apps/matlabhelp/techdoc/math_anal/diffeq7.html#688417


MStateDependence
        none | {weak} | strong
        Dependence of the mass matrix on . Set this property to none for problems . Both weak and strong indicate , but weak results in implicit solvers using approximations when solving algebraic equations.


Maybe this helps someone who understands the code better.

It doesn't appear that this option should affect the Jacobian option which is separate.

Rik <rik5>
Group administrator
Sat 17 Dec 2016 07:52:16 PM UTC, comment #2: 

I don't know of any way that Sundials/IDA could use the
information from the MStateDependence option. It definitely
shouldn't affect the Jacobian (dF/dy) calculation. My inclination
would be to simply ignore that option.

Bill Greene <billgreene>
Sat 17 Dec 2016 07:15:03 PM UTC, comment #1: 

Bill,

You seem to be experienced with sundials,
do you know the ida option to which MStateDependence
should be mapped?


Carlo de Falco <cdf>
Group Member
Sat 17 Dec 2016 06:58:17 PM UTC, original submission:  

I have just started doing some testing of the new ode15s function.

I have discovered incorrect behavior when the Jacobian option is
specified. I get the following warning message:

warning: with MStateDependence != 'none' an internal approximation of Jacobian Matrix will be used. Set MStateDependence equal to 'none' if you want  to provide a constant or time-dependent Jacobian
warning: called from
    ode15s at line 258 column 7
    test_ode15s_jac at line 23 column 13

I believe that ode15s.m is, for some reason, using the setting of
MStateDependence  to ignore my Jacobian function. This is the
wrong interpretation of MStateDependence. My understanding is
that MStateDependence in MATLAB just serves as a "hint" to the code that it may be able to adjust the algorithm slightly to improve performance.

I am attaching a small script that reproduces this behavior.


Bill Greene <billgreene>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39260:  test_ode15s_jac.m added by billgreene (1KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by cdf (Posted a comment)
  • -email is unavailable- added by cdf
  • -email is unavailable- added by cdf
  • -email is unavailable- added by billgreene (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 group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-17 cdf Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-
    2016-12-17 billgreene Attached File- Added test_ode15s_jac.m, #39260

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code