<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Plotting the Parameters that cause a D.E. Event to Execute</title>
    <link>http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sat, 13 Jun 2026 21:00:51 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 21:00:51 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Plotting the Parameters that cause a D.E. Event to Execute</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Plotting the Parameters that cause a D.E. Event to Execute</title>
      <link>http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A</link>
    </image>
    <item>
      <title>events</title>
      <link>http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A?ref=Feed:MaplePrimes:Plotting the Parameters that cause a D.E. Event to Execute:Comments#answer138131</link>
      <itunes:summary>&lt;p&gt;I'm not sure that I understand why fsolve has to be used. Can't the specified events alone reveal success versus failure?&lt;/p&gt;
&lt;p&gt;If I understand you then success only occurs when y(t)=3.05 (the height of the basket) and D(y)(t)&amp;lt;0 (meaning the ball is moving downward). If the ball reaches its maximal height before y(t) ever equals 3.05 then that is an easy case of failure.&lt;/p&gt;
&lt;p&gt;You can access the values of y(t), x(t), and D(y)(t) following an event trigger by using the special keyword 'last'.&lt;/p&gt;
&lt;p&gt;Strict equality testing might not work best, if dsolve is allowing itself any numeric error. And I suppose that you would ideally want to restrict success according to whether the ball (of nonzero width) is going to physically clear the hoop? That math (events) for that could get tricky. In other words, now it gets fun(?!). For example, D(y)(t) would have to be qute a bit less than zero, for the ball to score.&lt;/p&gt;
&lt;p&gt;Is this below close to what you want? (About 17 sec to get the plot, on am Intel i5.) If I got it all wrong then hopefully you can adjust and correct.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138131/444095/event0.mw"&gt;event0.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138131/444095/event0.gif"&gt;&lt;img src="/view.aspx?sf=138131/444095/event0.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I'm not sure that I understand why fsolve has to be used. Can't the specified events alone reveal success versus failure?&lt;/p&gt;
&lt;p&gt;If I understand you then success only occurs when y(t)=3.05 (the height of the basket) and D(y)(t)&amp;lt;0 (meaning the ball is moving downward). If the ball reaches its maximal height before y(t) ever equals 3.05 then that is an easy case of failure.&lt;/p&gt;
&lt;p&gt;You can access the values of y(t), x(t), and D(y)(t) following an event trigger by using the special keyword 'last'.&lt;/p&gt;
&lt;p&gt;Strict equality testing might not work best, if dsolve is allowing itself any numeric error. And I suppose that you would ideally want to restrict success according to whether the ball (of nonzero width) is going to physically clear the hoop? That math (events) for that could get tricky. In other words, now it gets fun(?!). For example, D(y)(t) would have to be qute a bit less than zero, for the ball to score.&lt;/p&gt;
&lt;p&gt;Is this below close to what you want? (About 17 sec to get the plot, on am Intel i5.) If I got it all wrong then hopefully you can adjust and correct.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138131/444095/event0.mw"&gt;event0.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138131/444095/event0.gif"&gt;&lt;img src="/view.aspx?sf=138131/444095/event0.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>138131</guid>
      <pubDate>Tue, 09 Oct 2012 21:35:16 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>exact dsolve</title>
      <link>http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A?ref=Feed:MaplePrimes:Plotting the Parameters that cause a D.E. Event to Execute:Comments#comment138137</link>
      <itunes:summary>&lt;p&gt;The numeric results computed above seem to agree with the following results from symbolic dsolve.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138137/444114/exact0.mw"&gt;exact0.mw&lt;/a&gt;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138137/444114/exact0.gif"&gt;&lt;img src="/view.aspx?sf=138137/444114/exact0.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;The numeric results computed above seem to agree with the following results from symbolic dsolve.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138137/444114/exact0.mw"&gt;exact0.mw&lt;/a&gt;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138137/444114/exact0.gif"&gt;&lt;img src="/view.aspx?sf=138137/444114/exact0.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>138137</guid>
      <pubDate>Wed, 10 Oct 2012 00:53:03 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>Application Center</title>
      <link>http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A?ref=Feed:MaplePrimes:Plotting the Parameters that cause a D.E. Event to Execute:Comments#comment138150</link>
      <itunes:summary>&lt;p&gt;In case this topic is of general interest: &lt;a href="http://www.maplesoft.com/applications/Author.aspx?mid=1629"&gt;Dr. Robert Lopez&lt;/a&gt; has written&amp;nbsp;&lt;a href="http://www.maplesoft.com/applications/view.aspx?SID=104666"&gt;Classroom Tips and Techniques: "Events" and the Numeric Solution of ODEs&lt;/a&gt;,&amp;nbsp;which is on the &lt;a href="http://www.maplesoft.com/applications/"&gt;Application Center&lt;/a&gt;.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;In case this topic is of general interest: &lt;a href="http://www.maplesoft.com/applications/Author.aspx?mid=1629"&gt;Dr. Robert Lopez&lt;/a&gt; has written&amp;nbsp;&lt;a href="http://www.maplesoft.com/applications/view.aspx?SID=104666"&gt;Classroom Tips and Techniques: "Events" and the Numeric Solution of ODEs&lt;/a&gt;,&amp;nbsp;which is on the &lt;a href="http://www.maplesoft.com/applications/"&gt;Application Center&lt;/a&gt;.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>138150</guid>
      <pubDate>Wed, 10 Oct 2012 07:51:16 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>compile=true</title>
      <link>http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A?ref=Feed:MaplePrimes:Plotting the Parameters that cause a D.E. Event to Execute:Comments#comment138186</link>
      <itunes:summary>&lt;p&gt;If the &lt;strong&gt;compile=true&lt;/strong&gt; optional argument is supplied in the dsolve,numeric call then the total time to produce the associated implicitplot is reduced by about 20% on my Maple 16 system.&lt;/p&gt;
&lt;p&gt;I confess that is news to me. I knew that dsolve,numeric has had (at least one form or another of) compilation functionality, for some time now. But I had thought that it was, for some releases now, automatically invoked by Maple.&lt;/p&gt;
&lt;p&gt;I suspect that for many systems of simply expressed DEs (no special functions) the performance benefit to using this option can be considerable, especially for parametrized ODEs where the computation may be done for many sets of parameter values.&lt;/p&gt;
&lt;p&gt;The machinery of `implicitplot` may incur a significant portion of overhead in this example, but a few other simple tests suggest to me that some other examples (eg. dsolve,numeric,parameters hooked up to GUI Slider Components, or invoked to produce traditional animations) may benefit a great deal more. Maybe up to 50% or so!?... I'll have to revisit some old posts.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;If the &lt;strong&gt;compile=true&lt;/strong&gt; optional argument is supplied in the dsolve,numeric call then the total time to produce the associated implicitplot is reduced by about 20% on my Maple 16 system.&lt;/p&gt;
&lt;p&gt;I confess that is news to me. I knew that dsolve,numeric has had (at least one form or another of) compilation functionality, for some time now. But I had thought that it was, for some releases now, automatically invoked by Maple.&lt;/p&gt;
&lt;p&gt;I suspect that for many systems of simply expressed DEs (no special functions) the performance benefit to using this option can be considerable, especially for parametrized ODEs where the computation may be done for many sets of parameter values.&lt;/p&gt;
&lt;p&gt;The machinery of `implicitplot` may incur a significant portion of overhead in this example, but a few other simple tests suggest to me that some other examples (eg. dsolve,numeric,parameters hooked up to GUI Slider Components, or invoked to produce traditional animations) may benefit a great deal more. Maybe up to 50% or so!?... I'll have to revisit some old posts.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>138186</guid>
      <pubDate>Thu, 11 Oct 2012 08:23:02 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>Thanks</title>
      <link>http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A?ref=Feed:MaplePrimes:Plotting the Parameters that cause a D.E. Event to Execute:Comments#comment138202</link>
      <itunes:summary>&lt;p&gt;Cool! Thank you very much! Graphing is taking me from ~33-50 seconds on a laptop with an AMD Phenom Quad-core processor. Might I ask if your using a desktop ? Otherwise I'm switching to Intel!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;I can't find any information about the &lt;strong&gt;compile=true&lt;/strong&gt;&amp;nbsp;option in dsolve, &amp;nbsp;but I can 'compile the procedure', but it doesn't make much difference.&lt;/p&gt;
&lt;p&gt;Also whats the purpose of your&lt;strong&gt;&amp;nbsp;try X(200); catch "cannot evaluate": end try; &lt;/strong&gt;statment?&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Cool! Thank you very much! Graphing is taking me from ~33-50 seconds on a laptop with an AMD Phenom Quad-core processor. Might I ask if your using a desktop ? Otherwise I'm switching to Intel!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;I can't find any information about the &lt;strong&gt;compile=true&lt;/strong&gt;&amp;nbsp;option in dsolve, &amp;nbsp;but I can 'compile the procedure', but it doesn't make much difference.&lt;/p&gt;
&lt;p&gt;Also whats the purpose of your&lt;strong&gt;&amp;nbsp;try X(200); catch "cannot evaluate": end try; &lt;/strong&gt;statment?&amp;nbsp;&lt;/p&gt;</description>
      <guid>138202</guid>
      <pubDate>Thu, 11 Oct 2012 17:13:58 Z</pubDate>
      <itunes:author>jschulzb</itunes:author>
      <author>jschulzb</author>
    </item>
    <item>
      <title>compile=true</title>
      <link>http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A?ref=Feed:MaplePrimes:Plotting the Parameters that cause a D.E. Event to Execute:Comments#comment138208</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A#comment138202"&gt;@jschulzb&lt;/a&gt; With the compile=true option in the (single) call to dsolve it takes approximately 13 sec on an Intel i5 on 64bit Linux in Maple 15 with gcc as the compiler, 15 sec on that i5 in Maple 16, and about 17 sec on an i7 in 64bit Maple 16 on Windows 7 with the free MSVC++ compiler.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138208/444239/event0compiled.mw"&gt;event0compiled.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Those timings seem to be about 15-20% faster than without the compile=true option. For the compile=true option to work I suspect that one needs &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Compiler/Compile"&gt;Compiler:-Compile&lt;/a&gt; to also function OK. Hmm, I'm not sure where dsolve,numeric's compile=true option might be documented. (!)&lt;/p&gt;
&lt;p&gt;That try..catch might not be necessary. I guess I was concerned that if the solver halted with an error that the subsequent bits to extract and test the "last" computed point might get skipped.&lt;/p&gt;
&lt;p&gt;There is overhead in implicitplot, which might be overshadowing the performance benefit of using compile=true here. In some other examples where I only did multiple calls to the emitted procs, or multiple calls to `odeplot`, I saw even more timing gains. I suspect that this would also be very useful when doing parameter optimization (as in Optimal Control).&lt;/p&gt;
&lt;p&gt;If I may be allowed a general remark: for simple models an exact symbolic result might be obtained, as is the case here. But of course for more involved systems computing an exact result in full might not be possible or practical. Hence numerical solving gets its day in the spotlight. For simple systems and problems it might even be that using a rootfinder like fsolve to find a special value's occurrence is practical. And it's easier to implement an fsolve search using dsolve's output procs than it is to set up even the simplest of events. But in general as parametrized ode systems and the events get more complicated, or for parametrized systems which must be run many times to search the parameter space, using dsolve's event handling mechanisms should be the clear performance winner. The combination of dsolve's events and dsolve's parameters can be very powerful. Combine that with top-notch DAE solvers and it's possible to build a modelling environment as powerful as... MapleSim.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/138088-Plotting-The-Parameters-That-Cause-A#comment138202"&gt;@jschulzb&lt;/a&gt; With the compile=true option in the (single) call to dsolve it takes approximately 13 sec on an Intel i5 on 64bit Linux in Maple 15 with gcc as the compiler, 15 sec on that i5 in Maple 16, and about 17 sec on an i7 in 64bit Maple 16 on Windows 7 with the free MSVC++ compiler.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138208/444239/event0compiled.mw"&gt;event0compiled.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Those timings seem to be about 15-20% faster than without the compile=true option. For the compile=true option to work I suspect that one needs &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Compiler/Compile"&gt;Compiler:-Compile&lt;/a&gt; to also function OK. Hmm, I'm not sure where dsolve,numeric's compile=true option might be documented. (!)&lt;/p&gt;
&lt;p&gt;That try..catch might not be necessary. I guess I was concerned that if the solver halted with an error that the subsequent bits to extract and test the "last" computed point might get skipped.&lt;/p&gt;
&lt;p&gt;There is overhead in implicitplot, which might be overshadowing the performance benefit of using compile=true here. In some other examples where I only did multiple calls to the emitted procs, or multiple calls to `odeplot`, I saw even more timing gains. I suspect that this would also be very useful when doing parameter optimization (as in Optimal Control).&lt;/p&gt;
&lt;p&gt;If I may be allowed a general remark: for simple models an exact symbolic result might be obtained, as is the case here. But of course for more involved systems computing an exact result in full might not be possible or practical. Hence numerical solving gets its day in the spotlight. For simple systems and problems it might even be that using a rootfinder like fsolve to find a special value's occurrence is practical. And it's easier to implement an fsolve search using dsolve's output procs than it is to set up even the simplest of events. But in general as parametrized ode systems and the events get more complicated, or for parametrized systems which must be run many times to search the parameter space, using dsolve's event handling mechanisms should be the clear performance winner. The combination of dsolve's events and dsolve's parameters can be very powerful. Combine that with top-notch DAE solvers and it's possible to build a modelling environment as powerful as... MapleSim.&lt;/p&gt;</description>
      <guid>138208</guid>
      <pubDate>Thu, 11 Oct 2012 18:29:19 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
  </channel>
</rss>