<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, looping problem</title>
    <link>http://www.mapleprimes.com/questions/35787-Looping-Problem</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 13:23:38 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 13:23:38 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, looping problem</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, looping problem</title>
      <link>http://www.mapleprimes.com/questions/35787-Looping-Problem</link>
    </image>
    <item>
      <title>explain</title>
      <link>http://www.mapleprimes.com/questions/35787-Looping-Problem?ref=Feed:MaplePrimes:looping problem:Comments#answer45127</link>
      <itunes:summary>&lt;p&gt;I don't understand the difficulty.&amp;nbsp; You can put as many commands as you want in the loop.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I don't understand the difficulty.&amp;nbsp; You can put as many commands as you want in the loop.&lt;/p&gt;</description>
      <guid>45127</guid>
      <pubDate>Sun, 07 Feb 2010 00:47:05 Z</pubDate>
      <itunes:author>Joe
 Riel
</itunes:author>
      <author>Joe
 Riel
</author>
    </item>
    <item>
      <title>clarification</title>
      <link>http://www.mapleprimes.com/questions/35787-Looping-Problem?ref=Feed:MaplePrimes:looping problem:Comments#answer45128</link>
      <itunes:summary>&lt;p&gt;ok so I have the 75 or so commands on a maple worksheet.&lt;/p&gt;
&lt;p&gt;To create the loop, i have to add the 'for' statements at the top and the 'end do' s at the bottom but once im done with the 'for' statements and go to the bottom, maple tells me the 'for' statements are wrong(because they should finish with 'end do'). &lt;/p&gt;
&lt;p&gt;Even after I add the 'end do's at the bottom, maple does not see the link between the 'for's at the top and the 'end do's at the bottom. It treats them separately and therefore reports all of them as wrong statements. this is basically my problem.&lt;/p&gt;
&lt;p&gt;also, i find it extremely hard to add statements between others.. say i click the space between statement 1 and 2, its only if im really lucky that it places the cursor there for me to write something. If I go on statement 1 and press enter, the cursor goes to the value calculated by statement 1, and when i press enter again, the cursor goes to statement 2... does not allow me to add anything in between. Is there something i should be doing here?&lt;/p&gt;
&lt;p&gt;cheers&lt;/p&gt;
&lt;p&gt;Nash&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;ok so I have the 75 or so commands on a maple worksheet.&lt;/p&gt;
&lt;p&gt;To create the loop, i have to add the 'for' statements at the top and the 'end do' s at the bottom but once im done with the 'for' statements and go to the bottom, maple tells me the 'for' statements are wrong(because they should finish with 'end do'). &lt;/p&gt;
&lt;p&gt;Even after I add the 'end do's at the bottom, maple does not see the link between the 'for's at the top and the 'end do's at the bottom. It treats them separately and therefore reports all of them as wrong statements. this is basically my problem.&lt;/p&gt;
&lt;p&gt;also, i find it extremely hard to add statements between others.. say i click the space between statement 1 and 2, its only if im really lucky that it places the cursor there for me to write something. If I go on statement 1 and press enter, the cursor goes to the value calculated by statement 1, and when i press enter again, the cursor goes to statement 2... does not allow me to add anything in between. Is there something i should be doing here?&lt;/p&gt;
&lt;p&gt;cheers&lt;/p&gt;
&lt;p&gt;Nash&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;</description>
      <guid>45128</guid>
      <pubDate>Sun, 07 Feb 2010 06:59:23 Z</pubDate>
      <itunes:author>lovinash</itunes:author>
      <author>lovinash</author>
    </item>
    <item>
      <title>please upload your worksheet / document</title>
      <link>http://www.mapleprimes.com/questions/35787-Looping-Problem?ref=Feed:MaplePrimes:looping problem:Comments#answer45129</link>
      <itunes:summary>&lt;p&gt;It sounds as though you need to join execution groups or document blocks. The best way for us to help you at this point is for you to upload a worksheet / document and let us see exactly what you are doing.&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;
&lt;pre&gt;
---------------------------------------------------------------------
Douglas B. Meade  &amp;lt;&amp;gt;&amp;lt;
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;It sounds as though you need to join execution groups or document blocks. The best way for us to help you at this point is for you to upload a worksheet / document and let us see exactly what you are doing.&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;
&lt;pre&gt;
---------------------------------------------------------------------
Douglas B. Meade  &amp;lt;&amp;gt;&amp;lt;
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
&lt;/pre&gt;</description>
      <guid>45129</guid>
      <pubDate>Sun, 07 Feb 2010 07:31:34 Z</pubDate>
      <itunes:author>Doug Meade</itunes:author>
      <author>Doug Meade</author>
    </item>
    <item>
      <title>file uploaded</title>
      <link>http://www.mapleprimes.com/questions/35787-Looping-Problem?ref=Feed:MaplePrimes:looping problem:Comments#answer45130</link>
      <itunes:summary>&lt;p&gt;&lt;span&gt;&lt;a href="http://www.mapleprimes.com:8080/maplenet/primes/worksheet/16354_take6.mw"&gt;View 16354_take6.mw on MapleNet&lt;/a&gt; or &lt;a href="http://www.mapleprimes.com/files/16354_take6.mw"&gt;Download 16354_take6.mw&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.mapleprimes.com/viewfile/4103"&gt;View file details&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;here is the file. it would be good if 'for k...' to 'end do' could be made to behave as one block.&amp;nbsp; the purpose of the algorithm is to variate h,k and r and to calculate 'fos' for each set.&amp;nbsp; the value of the mimimun fos and its corresponding h,k and r need to be output. &amp;nbsp;&amp;nbsp; thanks for helping&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;span&gt;&lt;a href="http://www.mapleprimes.com:8080/maplenet/primes/worksheet/16354_take6.mw"&gt;View 16354_take6.mw on MapleNet&lt;/a&gt; or &lt;a href="http://www.mapleprimes.com/files/16354_take6.mw"&gt;Download 16354_take6.mw&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.mapleprimes.com/viewfile/4103"&gt;View file details&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;here is the file. it would be good if 'for k...' to 'end do' could be made to behave as one block.&amp;nbsp; the purpose of the algorithm is to variate h,k and r and to calculate 'fos' for each set.&amp;nbsp; the value of the mimimun fos and its corresponding h,k and r need to be output. &amp;nbsp;&amp;nbsp; thanks for helping&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>45130</guid>
      <pubDate>Sun, 07 Feb 2010 09:41:58 Z</pubDate>
      <itunes:author>lovinash</itunes:author>
      <author>lovinash</author>
    </item>
    <item>
      <title>long loop hints</title>
      <link>http://www.mapleprimes.com/questions/35787-Looping-Problem?ref=Feed:MaplePrimes:looping problem:Comments#answer45131</link>
      <itunes:summary>&lt;p&gt;Your problem is as I guessed. You have the do's in one document block, the body of the loop in several document blocks, and the end do's in more document blocks. You need to get everything in a single document block to have Maple understand everything as a complete loop.&lt;/p&gt;
&lt;p&gt;One way to put more commands in the same document block is to use CTRL-ENTER to move to another line within the same document block.&lt;/p&gt;
&lt;p&gt;Personally, I find the &amp;quot;document&amp;quot; mode difficult to use for this type of work. I prefer to use Maple's &amp;quot;worksheet&amp;quot; mode, with the red input prompts. The version of your code that I have uploaded is a &amp;quot;worksheet&amp;quot;. You should not have any trouble opening it. It won't execute correctly; but neither did the code you uploaded. I have included a few comments to help you focus your attention.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="http://www.mapleprimes.com:8080/maplenet/primes/worksheet/178_take7.mw"&gt;View 178_take7.mw on MapleNet&lt;/a&gt; or &lt;a href="http://www.mapleprimes.com/files/178_take7.mw"&gt;Download 178_take7.mw&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.mapleprimes.com/viewfile/4104"&gt;View file details&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Note that in several places I replaced a set of 4 or 5 similar statements with a single seq or map command. I hope these are fairly obvious; if not ask - or consul the online help for ?seq and ?map .&lt;/p&gt;
&lt;p&gt;After you've had a chance to look at this, please feel free to ask any questions that you have. I think we will be able to help you get to something workable.&lt;/p&gt;
&lt;p&gt;One general suggestion. If any steps of the process can be carried out in general, do so - outside of the loop. Also, why do you ask for numeric integration in every integral? It appears to me that your integrals should be simple enough for Maple to be able to provide an exact answer.&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;
&lt;pre&gt;
---------------------------------------------------------------------
Douglas B. Meade  &amp;lt;&amp;gt;&amp;lt;
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;Your problem is as I guessed. You have the do's in one document block, the body of the loop in several document blocks, and the end do's in more document blocks. You need to get everything in a single document block to have Maple understand everything as a complete loop.&lt;/p&gt;
&lt;p&gt;One way to put more commands in the same document block is to use CTRL-ENTER to move to another line within the same document block.&lt;/p&gt;
&lt;p&gt;Personally, I find the &amp;quot;document&amp;quot; mode difficult to use for this type of work. I prefer to use Maple's &amp;quot;worksheet&amp;quot; mode, with the red input prompts. The version of your code that I have uploaded is a &amp;quot;worksheet&amp;quot;. You should not have any trouble opening it. It won't execute correctly; but neither did the code you uploaded. I have included a few comments to help you focus your attention.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="http://www.mapleprimes.com:8080/maplenet/primes/worksheet/178_take7.mw"&gt;View 178_take7.mw on MapleNet&lt;/a&gt; or &lt;a href="http://www.mapleprimes.com/files/178_take7.mw"&gt;Download 178_take7.mw&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.mapleprimes.com/viewfile/4104"&gt;View file details&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Note that in several places I replaced a set of 4 or 5 similar statements with a single seq or map command. I hope these are fairly obvious; if not ask - or consul the online help for ?seq and ?map .&lt;/p&gt;
&lt;p&gt;After you've had a chance to look at this, please feel free to ask any questions that you have. I think we will be able to help you get to something workable.&lt;/p&gt;
&lt;p&gt;One general suggestion. If any steps of the process can be carried out in general, do so - outside of the loop. Also, why do you ask for numeric integration in every integral? It appears to me that your integrals should be simple enough for Maple to be able to provide an exact answer.&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;
&lt;pre&gt;
---------------------------------------------------------------------
Douglas B. Meade  &amp;lt;&amp;gt;&amp;lt;
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
&lt;/pre&gt;</description>
      <guid>45131</guid>
      <pubDate>Sun, 07 Feb 2010 11:28:42 Z</pubDate>
      <itunes:author>Doug Meade</itunes:author>
      <author>Doug Meade</author>
    </item>
    <item>
      <title>complex roots</title>
      <link>http://www.mapleprimes.com/questions/35787-Looping-Problem?ref=Feed:MaplePrimes:looping problem:Comments#answer45132</link>
      <itunes:summary>&lt;p&gt;is there any way i could solve the 'complex roots' problem? can maple approximate them?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;by the way, the algorithm is to be used for slope stability calcs. eq1, eq2 and eq3 represent the land profile. the circle represents a circular slip plane. cdash and uniweight are soil parameters.&amp;nbsp; The algorithm is meant to analyse the stability for diffent slip plane(this is why i am varying h,k and r) and calculate the factor of safety (fos) then print out the value of the lowest factor of safety along with h,k and r... which represent the least safe slip plane.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;is there any way i could solve the 'complex roots' problem? can maple approximate them?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;by the way, the algorithm is to be used for slope stability calcs. eq1, eq2 and eq3 represent the land profile. the circle represents a circular slip plane. cdash and uniweight are soil parameters.&amp;nbsp; The algorithm is meant to analyse the stability for diffent slip plane(this is why i am varying h,k and r) and calculate the factor of safety (fos) then print out the value of the lowest factor of safety along with h,k and r... which represent the least safe slip plane.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>45132</guid>
      <pubDate>Mon, 08 Feb 2010 23:27:00 Z</pubDate>
      <itunes:author>lovinash</itunes:author>
      <author>lovinash</author>
    </item>
  </channel>
</rss>