<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Solving system of differential equations with bound on solutions</title>
    <link>http://www.mapleprimes.com/questions/143496-Solving-System-Of-Differential-Equations</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 09 Jun 2026 09:29:01 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 09:29:01 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Solving system of differential equations with bound on solutions</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Solving system of differential equations with bound on solutions</title>
      <link>http://www.mapleprimes.com/questions/143496-Solving-System-Of-Differential-Equations</link>
    </image>
    <item>
      <title>Events</title>
      <link>http://www.mapleprimes.com/questions/143496-Solving-System-Of-Differential-Equations?ref=Feed:MaplePrimes:Solving system of differential equations with bound on solutions:Comments#answer143499</link>
      <itunes:summary>&lt;p&gt;You may want to take a look at the events option:&lt;br&gt;&lt;br&gt;?dsolve,events&lt;/p&gt;
&lt;p&gt;restart;&lt;br&gt;sys:=diff(x(t),t)= x(t)+y(t) , diff(y(t),t)= x(t)-y(t); &amp;nbsp;&lt;br&gt;res:=dsolve({sys,x(0)=1/2,y(0)=0},numeric,events=[[x(t)-1,halt],[y(t)-2,halt]]);&lt;br&gt;plots:-odeplot(res,[x(t),y(t)],0..5);&lt;br&gt;plots:-odeplot(res,[t,x(t)],0..5);&lt;br&gt;&lt;br&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;You may want to take a look at the events option:&lt;br&gt;&lt;br&gt;?dsolve,events&lt;/p&gt;
&lt;p&gt;restart;&lt;br&gt;sys:=diff(x(t),t)= x(t)+y(t) , diff(y(t),t)= x(t)-y(t); &amp;nbsp;&lt;br&gt;res:=dsolve({sys,x(0)=1/2,y(0)=0},numeric,events=[[x(t)-1,halt],[y(t)-2,halt]]);&lt;br&gt;plots:-odeplot(res,[x(t),y(t)],0..5);&lt;br&gt;plots:-odeplot(res,[t,x(t)],0..5);&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description>
      <guid>143499</guid>
      <pubDate>Fri, 15 Feb 2013 02:55:02 Z</pubDate>
      <itunes:author>Preben Alsholm</itunes:author>
      <author>Preben Alsholm</author>
    </item>
    <item>
      <title>How to correctly write the event trigger</title>
      <link>http://www.mapleprimes.com/questions/143496-Solving-System-Of-Differential-Equations?ref=Feed:MaplePrimes:Solving system of differential equations with bound on solutions:Comments#comment143504</link>
      <itunes:summary>&lt;p&gt;Thank you for the suggestion and I think it's very helpful. I read about events and couldn't figure out how to correctly write the event trigger. Naively I think it should be like&amp;nbsp;&lt;/p&gt;
&lt;p&gt;events=[[x(t)&amp;gt;0, do_something],[y(t)&amp;gt;0, do_something]]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;but the program returns an error message: event1 trigger is of incorrect form: x(t)&amp;gt;0&lt;/p&gt;
&lt;p&gt;Also I couldn't understand the way you wrote it either, you wrote&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;events=[[x(t)-1,halt],[y(t)-2,halt]]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;what does x(t)-1 mean for the event trigger?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thank you for the suggestion and I think it's very helpful. I read about events and couldn't figure out how to correctly write the event trigger. Naively I think it should be like&amp;nbsp;&lt;/p&gt;
&lt;p&gt;events=[[x(t)&amp;gt;0, do_something],[y(t)&amp;gt;0, do_something]]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;but the program returns an error message: event1 trigger is of incorrect form: x(t)&amp;gt;0&lt;/p&gt;
&lt;p&gt;Also I couldn't understand the way you wrote it either, you wrote&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;events=[[x(t)-1,halt],[y(t)-2,halt]]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;what does x(t)-1 mean for the event trigger?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>143504</guid>
      <pubDate>Fri, 15 Feb 2013 07:16:13 Z</pubDate>
      <itunes:author>mapleq2013</itunes:author>
      <author>mapleq2013</author>
    </item>
    <item>
      <title>Rootfinding trigger</title>
      <link>http://www.mapleprimes.com/questions/143496-Solving-System-Of-Differential-Equations?ref=Feed:MaplePrimes:Solving system of differential equations with bound on solutions:Comments#comment143505</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/143496-Solving-System-Of-Differential-Equations#comment143504"&gt;@mapleq2013&lt;/a&gt; x(t)-1 is a rootfinding trigger, meaning that when during integration x(t) - 1 hits zero the action (in this case 'halt') is activated.&lt;br&gt;So in the example there are two events both of the type simple rootfinding and both having action 'halt'.&lt;/p&gt;
&lt;p&gt;Here is a simple example of a conditional trigger:&lt;/p&gt;
&lt;p&gt;sys2:=diff(x(t),t)= y(t) , diff(y(t),t)= -x(t); &amp;nbsp;&lt;br&gt;res2:=dsolve({sys2,x(0)=1/2,y(0)=0},numeric,events=[[[x(t),y(t)&amp;gt;0],halt]]);&lt;br&gt;plots:-odeplot(res2,[t,x(t)],0..5);&lt;/p&gt;
&lt;p&gt;In this one integration stops when x(t) = 0 provided that also y(t) &amp;gt; 0.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/143496-Solving-System-Of-Differential-Equations#comment143504"&gt;@mapleq2013&lt;/a&gt; x(t)-1 is a rootfinding trigger, meaning that when during integration x(t) - 1 hits zero the action (in this case 'halt') is activated.&lt;br&gt;So in the example there are two events both of the type simple rootfinding and both having action 'halt'.&lt;/p&gt;
&lt;p&gt;Here is a simple example of a conditional trigger:&lt;/p&gt;
&lt;p&gt;sys2:=diff(x(t),t)= y(t) , diff(y(t),t)= -x(t); &amp;nbsp;&lt;br&gt;res2:=dsolve({sys2,x(0)=1/2,y(0)=0},numeric,events=[[[x(t),y(t)&amp;gt;0],halt]]);&lt;br&gt;plots:-odeplot(res2,[t,x(t)],0..5);&lt;/p&gt;
&lt;p&gt;In this one integration stops when x(t) = 0 provided that also y(t) &amp;gt; 0.&lt;/p&gt;</description>
      <guid>143505</guid>
      <pubDate>Fri, 15 Feb 2013 07:24:01 Z</pubDate>
      <itunes:author>Preben Alsholm</itunes:author>
      <author>Preben Alsholm</author>
    </item>
    <item>
      <title>May need "if" statement</title>
      <link>http://www.mapleprimes.com/questions/143496-Solving-System-Of-Differential-Equations?ref=Feed:MaplePrimes:Solving system of differential equations with bound on solutions:Comments#comment143533</link>
      <itunes:summary>&lt;p&gt;I got how to write events now, thank you! My original problem which was not well formulated couldn't be solved with this though, but this is very still enlightening. The thing is I may need a better conditional like "if" to regulate how the problem behaves. I have re-formulated in the following: &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Main Goal: to solve a system of ODE that involves two unknowns dx(t)/dt=f(x,y)+sin(t) and dy(t)/dt=g(x,y) with the condition that x(t)&amp;gt;=0 and y(t)&amp;gt;=0 (initially x(t)=y(t)=0)&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Sub-objectives:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a. solve for x(t) and y(t) normally until one or both x(t) and y(t) are &amp;lt;0&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b. when x(t) goes below zero solve a new system x(t)=0 and dy(t)/dt=g(x,y), while keeping track of f(x,y)+sin(t), f(x,y)+sin(t)&amp;nbsp;will eventually go positive then we go back solving the original system&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c. when y(t) goes below zero solve a new system dx(t)/dt=f(x,y)+sin(t)&amp;nbsp;and y(t)=0, while keeping track of g(x,y), g(x,y) will eventually go positive then we go back solving the original system&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d. if both x(t) and y(t) goes below zero we keep track of both f(x,y)+sin(t) and g(x,y), they will eventually go positive, then we go back solving the original system&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I got how to write events now, thank you! My original problem which was not well formulated couldn't be solved with this though, but this is very still enlightening. The thing is I may need a better conditional like "if" to regulate how the problem behaves. I have re-formulated in the following: &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Main Goal: to solve a system of ODE that involves two unknowns dx(t)/dt=f(x,y)+sin(t) and dy(t)/dt=g(x,y) with the condition that x(t)&amp;gt;=0 and y(t)&amp;gt;=0 (initially x(t)=y(t)=0)&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Sub-objectives:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a. solve for x(t) and y(t) normally until one or both x(t) and y(t) are &amp;lt;0&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b. when x(t) goes below zero solve a new system x(t)=0 and dy(t)/dt=g(x,y), while keeping track of f(x,y)+sin(t), f(x,y)+sin(t)&amp;nbsp;will eventually go positive then we go back solving the original system&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c. when y(t) goes below zero solve a new system dx(t)/dt=f(x,y)+sin(t)&amp;nbsp;and y(t)=0, while keeping track of g(x,y), g(x,y) will eventually go positive then we go back solving the original system&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d. if both x(t) and y(t) goes below zero we keep track of both f(x,y)+sin(t) and g(x,y), they will eventually go positive, then we go back solving the original system&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>143533</guid>
      <pubDate>Fri, 15 Feb 2013 22:54:59 Z</pubDate>
      <itunes:author>mapleq2013</itunes:author>
      <author>mapleq2013</author>
    </item>
  </channel>
</rss>