You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2 variable index-1 DAE problem proposed by Ascher et al. (#5)
* 2 variable index-1 DAE problem proposed by Ascher et al.
* Code cleanup based on PR #5 and add more mass matrix properties to Rhs
* Add beta parameter to preset
* Update mass matrix properties for Rhs
Co-authored-by: Arash Sarshar <arash@Arashs-MacBook-Pro.local>
Co-authored-by: Steven Roberts <sroberts994@gmail.com>
Copy file name to clipboardExpand all lines: src/+otp/Problem.m
+2-20Lines changed: 2 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -257,7 +257,7 @@ function validateNewState(obj, newTimeSpan, newY0, newParameters)
257
257
p.addParameter('Method', @ode45);
258
258
p.parse(varargin{:});
259
259
260
-
options =otp.Problem.odeset(obj, p.Unmatched);
260
+
options =obj.Rhs.odeset(p.Unmatched);
261
261
262
262
sol =p.Results.Method(obj.Rhs.F, obj.TimeSpan, obj.Y0, options);
263
263
@@ -273,7 +273,7 @@ function validateNewState(obj, newTimeSpan, newY0, newParameters)
273
273
return;
274
274
end
275
275
276
-
options =otp.Problem.odeset(problem, options);
276
+
options =problem.Rhs.odeset(options);
277
277
sol = odextend(sol, problem.Rhs.F, problem.TimeSpan(end), problem.Y0, options);
278
278
end
279
279
end
@@ -310,24 +310,6 @@ function validateNewState(obj, newTimeSpan, newY0, newParameters)
310
310
end
311
311
end
312
312
313
-
methods (Static, Access=private)
314
-
functionnewOptions= odeset(problem, options)
315
-
newOptions = odeset(options);
316
-
317
-
if isprop(problem.Rhs, 'Jacobian')
318
-
newOptions.Jacobian =problem.Rhs.Jacobian;
319
-
end
320
-
321
-
if isprop(problem.Rhs, 'MassMatrix')
322
-
newOptions.Mass =problem.Rhs.MassMatrix;
323
-
end
324
-
325
-
if isprop(problem.Rhs, 'Events')
326
-
newOptions.Events =problem.Rhs.Events;
327
-
end
328
-
end
329
-
end
330
-
331
313
methods (Abstract, Access=protected)
332
314
% This method is called when either TimeSpan, Y0, or parameters are changed. It should update F and other properties such as a Jacobian to reflect the changes.
0 commit comments