Exiting an ode45 but based on a variable calculated inside the function and not based on output variable y
Show older comments
Hi!
I'm calculating a variable b inside myodefunc, which is further used to solve a quadprog problem.
The output of this quadrpog is what ode45 uses to integrate y.
function [u,b] = myodefunc(t,y)
Q = [1 0; 0 1];
g = zeros(2,0);
A = f1(t,y)
b = f2(t,y); % function of states and time
u = quadprog(Q,g,A,b);
end
I need to exit the ode when variable
, where k is a positive constant.
Any help or suggestions would be greatly appreciated.
Thanks
1 Comment
Akash Singh
on 29 Jun 2020
Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!