<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Couldn't exclude few results in fsolve</title>
    <link>http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve</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 18:48:31 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 18:48:31 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Couldn't exclude few results in fsolve</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Couldn't exclude few results in fsolve</title>
      <link>http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve</link>
    </image>
    <item>
      <title>Wrong if condition</title>
      <link>http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve?ref=Feed:MaplePrimes:Couldn't exclude few results in fsolve:Comments#answer138018</link>
      <itunes:summary>&lt;p&gt;Let's put n1:=0 and find&lt;/p&gt;
&lt;p&gt;sol := fsolve({eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9}, &lt;br&gt;{a = 0 .. 20, b = 0 .. 20, c2 = 0 .. 2, k2 = 0 .. 3, n2 = -10 .. 10, &lt;br&gt;Zeta2 = 0 .. 1, beta = -4 .. 4, gamma2 = 0 .. 1, theta = -4 .. 4});&lt;br&gt;{a = 11.16168586, b = 15.50104712, c2 = 1.231006487, k2 = 2.742157283,&lt;br&gt;&amp;nbsp;n2 = -1.234768436, Zeta2 = .3779464454, beta = .8900669363, gamma2 = .8751232144,&lt;br&gt;&amp;nbsp;theta = 1.202468462}&lt;br&gt;Now we check&lt;/p&gt;
&lt;p&gt;&amp;gt; sol[7];&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; beta = -2.91975577102258122203935861344&lt;br&gt;&amp;gt; whattype(sol[7]);&lt;br&gt;&lt;br&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;&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;br&gt;&amp;gt; is(type(sol[7], numeric));&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; false&lt;br&gt;We draw the conclusion that the&amp;nbsp; &lt;strong&gt;if (not type(sol[7], numeric)&lt;/strong&gt;&amp;nbsp; condition produces&lt;br&gt;`false` for each n1, not only if there is no solution.&lt;br&gt;In view of &lt;br&gt;&amp;gt; nops(sol);&lt;br&gt;&lt;br&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;&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; 9&lt;br&gt;the correction is the following: one should replace&amp;nbsp;&lt;strong&gt; if (not type(sol[7], numeric)&lt;/strong&gt; by&lt;br&gt;&lt;strong&gt;if nops(sol) &amp;lt;&amp;gt; 9&lt;/strong&gt; . See the output in &lt;a href="/view.aspx?sf=138018/443895/corrected_deflection.mw"&gt;corrected_deflection.mw&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Let's put n1:=0 and find&lt;/p&gt;
&lt;p&gt;sol := fsolve({eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9}, &lt;br&gt;{a = 0 .. 20, b = 0 .. 20, c2 = 0 .. 2, k2 = 0 .. 3, n2 = -10 .. 10, &lt;br&gt;Zeta2 = 0 .. 1, beta = -4 .. 4, gamma2 = 0 .. 1, theta = -4 .. 4});&lt;br&gt;{a = 11.16168586, b = 15.50104712, c2 = 1.231006487, k2 = 2.742157283,&lt;br&gt;&amp;nbsp;n2 = -1.234768436, Zeta2 = .3779464454, beta = .8900669363, gamma2 = .8751232144,&lt;br&gt;&amp;nbsp;theta = 1.202468462}&lt;br&gt;Now we check&lt;/p&gt;
&lt;p&gt;&amp;gt; sol[7];&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; beta = -2.91975577102258122203935861344&lt;br&gt;&amp;gt; whattype(sol[7]);&lt;br&gt;&lt;br&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;&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;br&gt;&amp;gt; is(type(sol[7], numeric));&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; false&lt;br&gt;We draw the conclusion that the&amp;nbsp; &lt;strong&gt;if (not type(sol[7], numeric)&lt;/strong&gt;&amp;nbsp; condition produces&lt;br&gt;`false` for each n1, not only if there is no solution.&lt;br&gt;In view of &lt;br&gt;&amp;gt; nops(sol);&lt;br&gt;&lt;br&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;&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; 9&lt;br&gt;the correction is the following: one should replace&amp;nbsp;&lt;strong&gt; if (not type(sol[7], numeric)&lt;/strong&gt; by&lt;br&gt;&lt;strong&gt;if nops(sol) &amp;lt;&amp;gt; 9&lt;/strong&gt; . See the output in &lt;a href="/view.aspx?sf=138018/443895/corrected_deflection.mw"&gt;corrected_deflection.mw&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description>
      <guid>138018</guid>
      <pubDate>Sat, 06 Oct 2012 22:43:49 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
    <item>
      <title>3d pointplot</title>
      <link>http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve?ref=Feed:MaplePrimes:Couldn't exclude few results in fsolve:Comments#answer138100</link>
      <itunes:summary>&lt;p&gt;Here is a modification of your worksheet, that gets a 3D pointplot.&lt;/p&gt;
&lt;p&gt;I made a few modifications to the ranges of the variables, as passed to fsolve. Judging from the piecewise functions it seemed to make sense to bound n1 by -4 from below, so as to not waste time in fsolve's search. It wasn't clear to me whether you wanted to get the points that lay along some single spacecurve (as n1 changed), but since there might be other solutions I restricted beta by -2 from below. And I extended the lower bound of `a` to -20, as it seems to extend the curve nicely.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138100/444040/deflection_domain_tr.mw"&gt;deflection_domain_tr.mw&lt;/a&gt;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138100/444040/deflection_domai.gif"&gt;&lt;img src="/view.aspx?sf=138100/444040/deflection_domai.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By the way, since your computational code that invokes fsolve and checks the result is not inside a procedure then I tested it utilizing eval(sol,1) so that the type-check did not cause a wasted efforst in repeating the fsolve computation in the case that it had failed and returned unevaluated. (See &lt;a href="http://www.mapleprimes.com/posts/119590-Procedures-Are-Good-For-You"&gt;here&lt;/a&gt; for explanation.)&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Here is a modification of your worksheet, that gets a 3D pointplot.&lt;/p&gt;
&lt;p&gt;I made a few modifications to the ranges of the variables, as passed to fsolve. Judging from the piecewise functions it seemed to make sense to bound n1 by -4 from below, so as to not waste time in fsolve's search. It wasn't clear to me whether you wanted to get the points that lay along some single spacecurve (as n1 changed), but since there might be other solutions I restricted beta by -2 from below. And I extended the lower bound of `a` to -20, as it seems to extend the curve nicely.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138100/444040/deflection_domain_tr.mw"&gt;deflection_domain_tr.mw&lt;/a&gt;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=138100/444040/deflection_domai.gif"&gt;&lt;img src="/view.aspx?sf=138100/444040/deflection_domai.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By the way, since your computational code that invokes fsolve and checks the result is not inside a procedure then I tested it utilizing eval(sol,1) so that the type-check did not cause a wasted efforst in repeating the fsolve computation in the case that it had failed and returned unevaluated. (See &lt;a href="http://www.mapleprimes.com/posts/119590-Procedures-Are-Good-For-You"&gt;here&lt;/a&gt; for explanation.)&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>138100</guid>
      <pubDate>Tue, 09 Oct 2012 06:46:48 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>how to store these results ?</title>
      <link>http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve?ref=Feed:MaplePrimes:Couldn't exclude few results in fsolve:Comments#comment138022</link>
      <itunes:summary>&lt;p&gt;Thanks a ton.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How to store the values of all solved cases(excluding the no solution cases) so that I can plot them in graph. &lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks a ton.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How to store the values of all solved cases(excluding the no solution cases) so that I can plot them in graph. &lt;/p&gt;</description>
      <guid>138022</guid>
      <pubDate>Sat, 06 Oct 2012 23:26:54 Z</pubDate>
      <itunes:author>vivek</itunes:author>
      <author>vivek</author>
    </item>
    <item>
      <title>Today is Saturday</title>
      <link>http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve?ref=Feed:MaplePrimes:Couldn't exclude few results in fsolve:Comments#comment138024</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve#comment138022"&gt;@vivek&lt;/a&gt; I shall think about it. &lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve#comment138022"&gt;@vivek&lt;/a&gt; I shall think about it. &lt;/p&gt;</description>
      <guid>138024</guid>
      <pubDate>Sat, 06 Oct 2012 23:44:18 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
    <item>
      <title>I still think</title>
      <link>http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve?ref=Feed:MaplePrimes:Couldn't exclude few results in fsolve:Comments#comment138086</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve#comment138022"&gt;@vivek&lt;/a&gt; What have you done on your own?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve#comment138022"&gt;@vivek&lt;/a&gt; What have you done on your own?&lt;/p&gt;</description>
      <guid>138086</guid>
      <pubDate>Mon, 08 Oct 2012 19:22:28 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
    <item>
      <title>speed</title>
      <link>http://www.mapleprimes.com/questions/138016-Couldnt-Exclude-Few-Results-In-Fsolve?ref=Feed:MaplePrimes:Couldn't exclude few results in fsolve:Comments#comment138112</link>
      <itunes:summary>&lt;p&gt;Apart from reducing Digits (ie. keeping it at the default, 10) there may be another easy way to speed up some of this kind of calculation.&lt;/p&gt;
&lt;p&gt;The idea is simple, if the parameter(s) hasn't changed very much -- from the previous iteration to the current one -- then the numerical solver might sometimes be able to converge to a new root quite quickly using the previous iteration's root as the new starting guess.&lt;/p&gt;
&lt;p&gt;Usually, fsolve will try and pepper the multivariable solution space with random starting points, and we hope that one will converge. (This is also why it takes long to fail completely, by the way.)&lt;/p&gt;
&lt;p&gt;So an ajustment to the methodology could be like this: first try the previous iteration's root as the new starting point. If that fails to converge then call fsolve without specifying a starting point, and let it proceed as usual.&lt;/p&gt;
&lt;p&gt;At Digits=10 the old methodology takes 40 seconds to get all those 45 discovered roots for `n1` between -3.99 and 7.01.&amp;nbsp;&lt;a href="/view.aspx?sf=138112/444062/domain_try1.mw"&gt;domain_try1.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using the above methodology it takes about 3 seconds. &amp;nbsp;&lt;a href="/view.aspx?sf=138112/444062/domain_try2.mw"&gt;domain_try2.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Computations run in 64bit Maple 16.01 on Windows 7.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Apart from reducing Digits (ie. keeping it at the default, 10) there may be another easy way to speed up some of this kind of calculation.&lt;/p&gt;
&lt;p&gt;The idea is simple, if the parameter(s) hasn't changed very much -- from the previous iteration to the current one -- then the numerical solver might sometimes be able to converge to a new root quite quickly using the previous iteration's root as the new starting guess.&lt;/p&gt;
&lt;p&gt;Usually, fsolve will try and pepper the multivariable solution space with random starting points, and we hope that one will converge. (This is also why it takes long to fail completely, by the way.)&lt;/p&gt;
&lt;p&gt;So an ajustment to the methodology could be like this: first try the previous iteration's root as the new starting point. If that fails to converge then call fsolve without specifying a starting point, and let it proceed as usual.&lt;/p&gt;
&lt;p&gt;At Digits=10 the old methodology takes 40 seconds to get all those 45 discovered roots for `n1` between -3.99 and 7.01.&amp;nbsp;&lt;a href="/view.aspx?sf=138112/444062/domain_try1.mw"&gt;domain_try1.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using the above methodology it takes about 3 seconds. &amp;nbsp;&lt;a href="/view.aspx?sf=138112/444062/domain_try2.mw"&gt;domain_try2.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Computations run in 64bit Maple 16.01 on Windows 7.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>138112</guid>
      <pubDate>Tue, 09 Oct 2012 13:05:51 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
  </channel>
</rss>