<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Finding all roots for an ODE in a given interval</title>
    <link>http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Wed, 10 Jun 2026 20:38:07 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 20:38:07 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Finding all roots for an ODE in a given interval</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Finding all roots for an ODE in a given interval</title>
      <link>http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval</link>
    </image>
    <item>
      <title>Try avoid (one way)</title>
      <link>http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval?ref=Feed:MaplePrimes:Finding all roots for an ODE in a given interval:Comments#answer123971</link>
      <itunes:summary>&lt;p&gt;&lt;span class="mainBody document"&gt; fsolve((rhs(ODE_4))(t)=0,t, avoid={t10},&lt;span class="mainBody document"&gt;10..20&lt;/span&gt;);&amp;nbsp; # t10 is the solution that you find at the first &lt;br&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="mainBody document"&gt;Try also to serch complex solution with adding option complex&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="mainBody document"&gt;See &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="mainBody document"&gt;?fsolve/details&lt;br&gt;&lt;/span&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;span class="mainBody document"&gt; fsolve((rhs(ODE_4))(t)=0,t, avoid={t10},&lt;span class="mainBody document"&gt;10..20&lt;/span&gt;);&amp;nbsp; # t10 is the solution that you find at the first &lt;br&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="mainBody document"&gt;Try also to serch complex solution with adding option complex&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="mainBody document"&gt;See &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="mainBody document"&gt;?fsolve/details&lt;br&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <guid>123971</guid>
      <pubDate>Tue, 19 Jul 2011 22:26:30 Z</pubDate>
      <itunes:author>Kamel Boughrara</itunes:author>
      <author>Kamel Boughrara</author>
    </item>
    <item>
      <title>Use it as a component</title>
      <link>http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval?ref=Feed:MaplePrimes:Finding all roots for an ODE in a given interval:Comments#answer123978</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval#comment123973"&gt;@vicaut&lt;/a&gt; : You can use Kamel's idea as a component to building a solution that includes all the roots. In fact, I would suggest using the &lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=RootFinding/NextZero"&gt;?RootFinding/NextZero&lt;/a&gt; command; it has somewhat better numerical behaviour and its behaviour is a bit better specified than fsolve for this type of question (where you want to "avoid" many roots). Define the following (Maple 15) procedure:&lt;/p&gt;
&lt;pre&gt;allRoots := proc(f :: procedure, rng :: range, $)&lt;br&gt;local result, root;&lt;br&gt;&amp;nbsp; result := Vector(0, 'datatype = float');&lt;br&gt;&amp;nbsp; root := RootFinding:-NextZero(f, lhs(rng), 'maxdistance' = rhs(rng) - lhs(rng));&lt;br&gt;&amp;nbsp; while root &amp;lt;&amp;gt; FAIL and root &amp;lt;= rhs(rng) do&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result(numelems(result) + 1) := root;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; root := RootFinding:-NextZero(f, root, 'maxdistance' = rhs(rng) - root);&lt;br&gt;&amp;nbsp; end do;&lt;br&gt;&amp;nbsp; return result;&lt;br&gt;end proc;&lt;/pre&gt;
&lt;p&gt;Now allRoots(rhs(ODE_4), 10 .. 20) should give you a Vector with all the (100 or so) roots that you were talking about.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Erik Postma&lt;br&gt;Maplesoft.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval#comment123973"&gt;@vicaut&lt;/a&gt; : You can use Kamel's idea as a component to building a solution that includes all the roots. In fact, I would suggest using the &lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=RootFinding/NextZero"&gt;?RootFinding/NextZero&lt;/a&gt; command; it has somewhat better numerical behaviour and its behaviour is a bit better specified than fsolve for this type of question (where you want to "avoid" many roots). Define the following (Maple 15) procedure:&lt;/p&gt;
&lt;pre&gt;allRoots := proc(f :: procedure, rng :: range, $)&lt;br&gt;local result, root;&lt;br&gt;&amp;nbsp; result := Vector(0, 'datatype = float');&lt;br&gt;&amp;nbsp; root := RootFinding:-NextZero(f, lhs(rng), 'maxdistance' = rhs(rng) - lhs(rng));&lt;br&gt;&amp;nbsp; while root &amp;lt;&amp;gt; FAIL and root &amp;lt;= rhs(rng) do&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result(numelems(result) + 1) := root;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; root := RootFinding:-NextZero(f, root, 'maxdistance' = rhs(rng) - root);&lt;br&gt;&amp;nbsp; end do;&lt;br&gt;&amp;nbsp; return result;&lt;br&gt;end proc;&lt;/pre&gt;
&lt;p&gt;Now allRoots(rhs(ODE_4), 10 .. 20) should give you a Vector with all the (100 or so) roots that you were talking about.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Erik Postma&lt;br&gt;Maplesoft.&lt;/p&gt;</description>
      <guid>123978</guid>
      <pubDate>Tue, 19 Jul 2011 23:19:00 Z</pubDate>
      <itunes:author>epostma</itunes:author>
      <author>epostma</author>
    </item>
    <item>
      <title>There was a very interesting discussion on</title>
      <link>http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval?ref=Feed:MaplePrimes:Finding all roots for an ODE in a given interval:Comments#answer123982</link>
      <itunes:summary>&lt;p&gt;There was a very interesting discussion on this topic, which included the method shown by&amp;nbsp;&lt;a href="http://www.mapleprimes.com/users/epostma"&gt;epostma&lt;/a&gt;&amp;nbsp;above, &amp;nbsp;recently here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/123476-Seeking-A-Good-Praxis-In-Solving-Equations"&gt;http://www.mapleprimes.com/questions/123476-Seeking-A-Good-Praxis-In-Solving-Equations&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;There was a very interesting discussion on this topic, which included the method shown by&amp;nbsp;&lt;a href="http://www.mapleprimes.com/users/epostma"&gt;epostma&lt;/a&gt;&amp;nbsp;above, &amp;nbsp;recently here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/123476-Seeking-A-Good-Praxis-In-Solving-Equations"&gt;http://www.mapleprimes.com/questions/123476-Seeking-A-Good-Praxis-In-Solving-Equations&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>123982</guid>
      <pubDate>Tue, 19 Jul 2011 23:31:22 Z</pubDate>
      <itunes:author>longrob</itunes:author>
      <author>longrob</author>
    </item>
    <item>
      <title>Thats not what i mean. I'm not interested</title>
      <link>http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval?ref=Feed:MaplePrimes:Finding all roots for an ODE in a given interval:Comments#comment123973</link>
      <itunes:summary>&lt;p&gt;Thats not what i mean. I'm not interested in the complex roots, but i need some kind of procedure that lists all the roots in the interval AT ONCE. I can't repeat the input with avoid, i have about 100 or more roots in this interval!&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thats not what i mean. I'm not interested in the complex roots, but i need some kind of procedure that lists all the roots in the interval AT ONCE. I can't repeat the input with avoid, i have about 100 or more roots in this interval!&lt;/p&gt;</description>
      <guid>123973</guid>
      <pubDate>Tue, 19 Jul 2011 22:38:55 Z</pubDate>
      <itunes:author>vicaut</itunes:author>
      <author>vicaut</author>
    </item>
    <item>
      <title>Worked quite well in Maple 15.00 but not in 15.01.</title>
      <link>http://www.mapleprimes.com/questions/123970-Finding-All-Roots-For-An-ODE-In-A-Given-Interval?ref=Feed:MaplePrimes:Finding all roots for an ODE in a given interval:Comments#comment124206</link>
      <itunes:summary>&lt;p&gt;After updatig, this procedure is awfully slow. "allRoots(rhs(ODE_4),50..50.1)" needs more than a minute to get the one and only root in this interval! And i need 500 computations with different numbers for a parameter in my ODE and a range from 100 to 150 or even higher to get a plot with all the roots dependant on the parameter. This computation would last days or weeks. Are there options to make this faster? I think there is a much faster option: I consider to find the roots with the "events=[y(t),...]" and maybe the eventfired option within my definition of my ODE, but i don't know how to get/save all the triggered events (= roots) to a vector, like in your procedure. Maple help for /dsolve/numeric/Events is not very helpful for me, because there aren't many examples/descriptions how to do this. Do you have any suggestions?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;After updatig, this procedure is awfully slow. "allRoots(rhs(ODE_4),50..50.1)" needs more than a minute to get the one and only root in this interval! And i need 500 computations with different numbers for a parameter in my ODE and a range from 100 to 150 or even higher to get a plot with all the roots dependant on the parameter. This computation would last days or weeks. Are there options to make this faster? I think there is a much faster option: I consider to find the roots with the "events=[y(t),...]" and maybe the eventfired option within my definition of my ODE, but i don't know how to get/save all the triggered events (= roots) to a vector, like in your procedure. Maple help for /dsolve/numeric/Events is not very helpful for me, because there aren't many examples/descriptions how to do this. Do you have any suggestions?&lt;/p&gt;</description>
      <guid>124206</guid>
      <pubDate>Thu, 28 Jul 2011 00:55:34 Z</pubDate>
      <itunes:author>vicaut</itunes:author>
      <author>vicaut</author>
    </item>
  </channel>
</rss>