Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event with ode45 #264

Open
csb2024 opened this issue Jun 29, 2024 · 0 comments
Open

event with ode45 #264

csb2024 opened this issue Jun 29, 2024 · 0 comments

Comments

@csb2024
Copy link

csb2024 commented Jun 29, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant