<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Procedure error</title>
    <link>http://www.mapleprimes.com/questions/128629-Procedure-Error</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 08:33:09 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 08:33:09 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Procedure error</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Procedure error</title>
      <link>http://www.mapleprimes.com/questions/128629-Procedure-Error</link>
    </image>
    <item>
      <title>comments</title>
      <link>http://www.mapleprimes.com/questions/128629-Procedure-Error?ref=Feed:MaplePrimes:Procedure error:Comments#answer128632</link>
      <itunes:summary>&lt;p&gt;The error is occurring in TrapRule, which isn't shown here.&lt;/p&gt;
&lt;p&gt;There are various minor issues with the above code. The type-checking conditionals aren't quite correct in that they won't raise an error if m or n is not numeric. Also, ERROR is deprecated in Maple, use &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=error' target='_new'&gt;?error&lt;/a&gt;. The while-statement works, but really should be an if-statement.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;The error is occurring in TrapRule, which isn't shown here.&lt;/p&gt;
&lt;p&gt;There are various minor issues with the above code. The type-checking conditionals aren't quite correct in that they won't raise an error if m or n is not numeric. Also, ERROR is deprecated in Maple, use &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=error' target='_new'&gt;?error&lt;/a&gt;. The while-statement works, but really should be an if-statement.&lt;/p&gt;</description>
      <guid>128632</guid>
      <pubDate>Mon, 12 Dec 2011 00:57:26 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
    <item>
      <title>upper/lower case</title>
      <link>http://www.mapleprimes.com/questions/128629-Procedure-Error?ref=Feed:MaplePrimes:Procedure error:Comments#comment128633</link>
      <itunes:summary>&lt;p&gt;additionally one has to care for upper/lower case for n resp N&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;additionally one has to care for upper/lower case for n resp N&lt;/p&gt;</description>
      <guid>128633</guid>
      <pubDate>Mon, 12 Dec 2011 01:13:55 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
    <item>
      <title>I have corrected the "while" operation and</title>
      <link>http://www.mapleprimes.com/questions/128629-Procedure-Error?ref=Feed:MaplePrimes:Procedure error:Comments#comment128635</link>
      <itunes:summary>&lt;p&gt;I have corrected the "while" operation and changed the "N" to "n", so that its consistent and also made the changed to the error operation. But I don't get what you mean by the traprule. (My procedure for the traprule is working fine)&lt;/p&gt;
&lt;pre&gt;RombInt:=proc(f,a,b,m,n)&lt;br&gt;local j,k,R;&lt;br&gt;if type(m, numeric) then&lt;br&gt;   if not type(m,nonnegint) then error "m must be a non-negative integer"; fi;fi; &lt;br&gt;if type(n, numeric) then&lt;br&gt;   if not type(n,nonnegint) then error "n must be a non-negative integer";fi;fi;&lt;br&gt;if (m &amp;gt; n) then&lt;br&gt;error "parameter m must be less than or equal to n":&lt;br&gt;fi;&lt;br&gt;for k from 0 to m do&lt;br&gt;R[0,k]:=TrapRule(f,2^n,a,b); od;&lt;br&gt;for j from 1 to m do&lt;br&gt;for k from j to m do&lt;br&gt;R[j,k]:=1/(4^j-1)*(4^j*R[j-1,k+1]-R[j-1,k]);&lt;br&gt;od; od;&lt;br&gt;end proc:&lt;/pre&gt;
&lt;pre&gt;&amp;amp; the TrapRule procedure is:&lt;/pre&gt;
&lt;pre&gt;TrapRule:=proc(f,n,a,b)&lt;br&gt;local k,sum1,h,i:&lt;br&gt;h:=(b-a)/n:&lt;br&gt;sum1:=0:&lt;br&gt;for i from 1 by 1 to n-1 do                  &lt;br&gt;sum1:=sum1+f(a+i*h):&lt;br&gt;end do:&lt;br&gt;k:=(h/2)*(f(a)+2*sum1+f(b)):            &lt;br&gt;return (k):&lt;br&gt;end proc:&lt;/pre&gt;
&lt;pre&gt;Does the change from TrapRule(f,n,a,b) to TrapRule(f,2^n,a,b) matter?&lt;/pre&gt;
&lt;p&gt;After doing these little changes and evaluating&amp;nbsp;RombInt(exp,-3,1,0,2);..I get no response and no error, it just goes on the next line?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I have corrected the "while" operation and changed the "N" to "n", so that its consistent and also made the changed to the error operation. But I don't get what you mean by the traprule. (My procedure for the traprule is working fine)&lt;/p&gt;
&lt;pre&gt;RombInt:=proc(f,a,b,m,n)&lt;br&gt;local j,k,R;&lt;br&gt;if type(m, numeric) then&lt;br&gt;   if not type(m,nonnegint) then error "m must be a non-negative integer"; fi;fi; &lt;br&gt;if type(n, numeric) then&lt;br&gt;   if not type(n,nonnegint) then error "n must be a non-negative integer";fi;fi;&lt;br&gt;if (m &amp;gt; n) then&lt;br&gt;error "parameter m must be less than or equal to n":&lt;br&gt;fi;&lt;br&gt;for k from 0 to m do&lt;br&gt;R[0,k]:=TrapRule(f,2^n,a,b); od;&lt;br&gt;for j from 1 to m do&lt;br&gt;for k from j to m do&lt;br&gt;R[j,k]:=1/(4^j-1)*(4^j*R[j-1,k+1]-R[j-1,k]);&lt;br&gt;od; od;&lt;br&gt;end proc:&lt;/pre&gt;
&lt;pre&gt;&amp;amp; the TrapRule procedure is:&lt;/pre&gt;
&lt;pre&gt;TrapRule:=proc(f,n,a,b)&lt;br&gt;local k,sum1,h,i:&lt;br&gt;h:=(b-a)/n:&lt;br&gt;sum1:=0:&lt;br&gt;for i from 1 by 1 to n-1 do                  &lt;br&gt;sum1:=sum1+f(a+i*h):&lt;br&gt;end do:&lt;br&gt;k:=(h/2)*(f(a)+2*sum1+f(b)):            &lt;br&gt;return (k):&lt;br&gt;end proc:&lt;/pre&gt;
&lt;pre&gt;Does the change from TrapRule(f,n,a,b) to TrapRule(f,2^n,a,b) matter?&lt;/pre&gt;
&lt;p&gt;After doing these little changes and evaluating&amp;nbsp;RombInt(exp,-3,1,0,2);..I get no response and no error, it just goes on the next line?&lt;/p&gt;</description>
      <guid>128635</guid>
      <pubDate>Mon, 12 Dec 2011 01:33:11 Z</pubDate>
      <itunes:author>mike1</itunes:author>
      <author>mike1</author>
    </item>
    <item>
      <title>nothing returned</title>
      <link>http://www.mapleprimes.com/questions/128629-Procedure-Error?ref=Feed:MaplePrimes:Procedure error:Comments#comment128641</link>
      <itunes:summary>&lt;p&gt;Maple actually returns NULL because the final do loop isn't executed when m=0.&amp;nbsp; It isn't clear to me what you want to return, maybe&lt;/p&gt;
&lt;p&gt;return eval(R);&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Maple actually returns NULL because the final do loop isn't executed when m=0.&amp;nbsp; It isn't clear to me what you want to return, maybe&lt;/p&gt;
&lt;p&gt;return eval(R);&lt;/p&gt;</description>
      <guid>128641</guid>
      <pubDate>Mon, 12 Dec 2011 02:57:23 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
  </channel>
</rss>