Skip to content

Commit

Permalink
main switching cases with init
Browse files Browse the repository at this point in the history
  • Loading branch information
apozharski committed Aug 31, 2023
1 parent 6099042 commit 9f71b61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/different_switching_cases/main_switching_cases.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
% 2) sliding mode
% 3) sliding on a surfce of disconinuity where a spontaneous switch can happen (nonuqnie solutions)
% 4) unique leaving of a sliding mode
switching_case = 'crossing';
switching_case = 'spontaneous_switch';
% Options: 'crossing' 'sliding_mode', 'spontaneous_switch' , 'leave_sliding_mode',
%% NOSNOC settings
problem_options = NosnocProblemOptions();
Expand Down Expand Up @@ -82,7 +82,7 @@
model.F = [f_1 f_2];
% implicit methods more accurate, explicit Euler enables "random"
% leaving
problem_options.irk_scheme = 'EXPLICIT_RK';
problem_options.irk_scheme = IRKSchemes.RADAU_IIA;
problem_options.n_s = 1;
problem_options.N_finite_elements = 3; % set 4, 5 for different outcomes
case 'leave_sliding_mode'
Expand All @@ -104,6 +104,8 @@
solver_options.store_integrator_step_results = 1;

integrator = NosnocIntegrator(model, problem_options, solver_options, [], []);
integrator.solver.set('theta', [0;1;0;1;0;1]);
%integrator.solver.set('lam', [0;1;0;1;0;1;0;1;0;1;0;1]);
[results,stats] = integrator.solve();

figure
Expand Down

0 comments on commit 9f71b61

Please sign in to comment.