boostorg / boostorg/boost

ode45 with event

Open
#925 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
8.6k
Forks
1.9k
Avg merge
39m
Merged PRs (30d)
2

Description

odeint2 Is there a way to implement matlab's ode45 event mechanism such as the following code:
tspan=[0 t_max]; %Time span of simulation in sec
Opt = odeset('Events', @myEvent);
[t,x]=ode45(@EoM,tspan,x0,Opt); function [value, isterminal]; %Time span of simulation in sec

function [value, isterminal, direction] = myEvent(t, y)
%value = (y(11) < 0);
value = y(11); isterminal = 1; % myEvent(t, y)
isterminal = 1; % Stop the integration
direction = -1; end
end

Translated with DeepL.com (free version)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.