Reputation: 179
I am using ode15s
to solve a DAE problem. I give through odeset
the Mass Matrix and some more info:
opts=odeset('Mass',M,'MassSingular','yes','MStateDependence','none');
I calculate also Jpattern
from a previous run. To feed it to the function, I could write once again
opts=odeset('Mass',M,'MassSingular','yes','MStateDependence','none', 'JPattern',JPat);
Is there a way to modify that single parameter and keep the rest of the structure?
I tried
opts.JPattern = JPat;
But it is not working.
Upvotes: 0
Views: 114
Reputation: 13876
You can probably do something like:
opts = odeset('Mass',M,'MassSingular','yes','MStateDependence','none');
opts = odeset(opts,'JPattern',JPat);
This is using the syntax (see the documentation):
options = odeset(oldopts,'name1',value1,...)
alters an existing options structureoldopts
. This sets options equal to the existing structureoldopts
, overwrites any values inoldopts
that are respecified using name/value pairs, and adds any new pairs to the structure. The modified structure is returned as an output argument.
Upvotes: 2