ODE solver in GEKKO

46 views
Skip to first unread message

Prakitr Srisuma

unread,
Feb 24, 2024, 4:54:27 PMFeb 24
to apmonitor
Hello,

I am solving a system of ODEs in GEKKO and curious if there is a way to set up an event to terminate the solver. For example, when x1 = 0, stop the solver (before the final time). This is kind of the "Event" function in MATLAB.

Thank you,
Prakitr

John Hedengren

unread,
Feb 24, 2024, 5:07:08 PMFeb 24
to apmo...@googlegroups.com
Prakitr,

One option is to set a loop and check the condition for each time step. Another option is to make final time calculated and fix the final condition. Here is an example:


Please ask any future questions about gekko on stack overflow.


Best regards,

John Hedengren


--
--
APMonitor user's group e-mail list.
- To post a message, send email to apmo...@googlegroups.com
- To unsubscribe, send email to apmonitor+...@googlegroups.com
- Visit this group at http://groups.google.com/group/apmonitor
---
You received this message because you are subscribed to the Google Groups "apmonitor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apmonitor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/apmonitor/fec17248-706a-4d35-852c-ab7c2911d321n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages