<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Integrating with a numeric solution to a PDE</title>
    <link>http://www.mapleprimes.com/questions/35540-Integrating-With-A-Numeric-Solution-To-A-PDE</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 18:03:09 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 18:03:09 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Integrating with a numeric solution to a PDE</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Integrating with a numeric solution to a PDE</title>
      <link>http://www.mapleprimes.com/questions/35540-Integrating-With-A-Numeric-Solution-To-A-PDE</link>
    </image>
    <item>
      <title>Integral of pde solution</title>
      <link>http://www.mapleprimes.com/questions/35540-Integrating-With-A-Numeric-Solution-To-A-PDE?ref=Feed:MaplePrimes:Integrating with a numeric solution to a PDE:Comments#answer44223</link>
      <itunes:summary>&lt;p&gt;You can try something like this:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; Sol := pdsolve(pde, ibc, numeric);
  usol:=  subs(Sol:-value(output=listprocedure),u(x,t));
&lt;/pre&gt;
&lt;p&gt;usol is then a function of two variables x and t, which for numerical values of x and t gives the solution at that point.&amp;nbsp; And you should be able to use this in numerical integration, e.g.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; evalf(Int(x * usol(x, 0.2), x = 0 .. 1));

&lt;/pre&gt;
&lt;p&gt;or even&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plot(Int(x * usol(x,t), x = 0 .. 1)/Int(usol(x,t), x = 0 .. 1),
    t = 0 .. 2);

&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;You can try something like this:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; Sol := pdsolve(pde, ibc, numeric);
  usol:=  subs(Sol:-value(output=listprocedure),u(x,t));
&lt;/pre&gt;
&lt;p&gt;usol is then a function of two variables x and t, which for numerical values of x and t gives the solution at that point.&amp;nbsp; And you should be able to use this in numerical integration, e.g.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; evalf(Int(x * usol(x, 0.2), x = 0 .. 1));

&lt;/pre&gt;
&lt;p&gt;or even&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plot(Int(x * usol(x,t), x = 0 .. 1)/Int(usol(x,t), x = 0 .. 1),
    t = 0 .. 2);

&lt;/pre&gt;</description>
      <guid>44223</guid>
      <pubDate>Thu, 11 Mar 2010 01:14:43 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>hmm</title>
      <link>http://www.mapleprimes.com/questions/35540-Integrating-With-A-Numeric-Solution-To-A-PDE?ref=Feed:MaplePrimes:Integrating with a numeric solution to a PDE:Comments#answer44224</link>
      <itunes:summary>this looks like a good plan, however when i try the bivariate value(output=listprocedure) its saying "length of output exceeds limit of 1000000". Is this some limitation on my laptop or something thats easily fixed?

Ryan</itunes:summary>
      <description>this looks like a good plan, however when i try the bivariate value(output=listprocedure) its saying "length of output exceeds limit of 1000000". Is this some limitation on my laptop or something thats easily fixed?

Ryan</description>
      <guid>44224</guid>
      <pubDate>Thu, 11 Mar 2010 04:00:48 Z</pubDate>
      <itunes:author>raggapuffin</itunes:author>
      <author>raggapuffin</author>
    </item>
    <item>
      <title>Sure</title>
      <link>http://www.mapleprimes.com/questions/35540-Integrating-With-A-Numeric-Solution-To-A-PDE?ref=Feed:MaplePrimes:Integrating with a numeric solution to a PDE:Comments#answer44226</link>
      <itunes:summary>PDE := diff(u(x, t), t) = g*(diff(u(x, t), x))+diff(u(x, t), x, x)

where g := piecewise(t &lt;= 1/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 1/80 &lt; t and t &lt;= 2*(1/80), 0, 2*(1/80) &lt; t and t &lt; 3/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 3/80 &lt; t and t &lt; 4*(1/80), 0, 4*(1/80) &lt; t and t &lt; 5*(1/80), piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 5*(1/80) &lt; t and t &lt; 6*(1/80), 0, 6*(1/80) &lt; t and t &lt; 7/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 7/80 &lt; t and t &lt; 8*(1/80), 0, 8*(1/80) &lt; t and t &lt; 9/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 9/80 &lt; t and t &lt; 10*(1/80), 0, 10*(1/80) &lt; t and t &lt; 11/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 11/80 &lt; t and t &lt; 12*(1/80), 0)

(6 cycles of a sawtooth potential turning on and off)

IBC := {u(0, t) = 0, u(1, t) = 0, u(x, 0) = exp(-(x-2/3)^2/(2*a^2))/((2*Pi)^(1/2)*a)}

where a:=1/100

pds := pdsolve(PDE, IBC, numeric, time = t, range = 0 .. 1, timestep = 1/10000, spacestep = 1/10000, optimize = true)

R := pds:-value(output = listprocedure)

</itunes:summary>
      <description>PDE := diff(u(x, t), t) = g*(diff(u(x, t), x))+diff(u(x, t), x, x)

where g := piecewise(t &lt;= 1/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 1/80 &lt; t and t &lt;= 2*(1/80), 0, 2*(1/80) &lt; t and t &lt; 3/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 3/80 &lt; t and t &lt; 4*(1/80), 0, 4*(1/80) &lt; t and t &lt; 5*(1/80), piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 5*(1/80) &lt; t and t &lt; 6*(1/80), 0, 6*(1/80) &lt; t and t &lt; 7/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 7/80 &lt; t and t &lt; 8*(1/80), 0, 8*(1/80) &lt; t and t &lt; 9/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 9/80 &lt; t and t &lt; 10*(1/80), 0, 10*(1/80) &lt; t and t &lt; 11/80, piecewise(x &lt;= 2/3, k[1], 2/3 &lt; x, k[2]), 11/80 &lt; t and t &lt; 12*(1/80), 0)

(6 cycles of a sawtooth potential turning on and off)

IBC := {u(0, t) = 0, u(1, t) = 0, u(x, 0) = exp(-(x-2/3)^2/(2*a^2))/((2*Pi)^(1/2)*a)}

where a:=1/100

pds := pdsolve(PDE, IBC, numeric, time = t, range = 0 .. 1, timestep = 1/10000, spacestep = 1/10000, optimize = true)

R := pds:-value(output = listprocedure)

</description>
      <guid>44226</guid>
      <pubDate>Thu, 11 Mar 2010 05:36:59 Z</pubDate>
      <itunes:author>raggapuffin</itunes:author>
      <author>raggapuffin</author>
    </item>
    <item>
      <title>YESSS!</title>
      <link>http://www.mapleprimes.com/questions/35540-Integrating-With-A-Numeric-Solution-To-A-PDE?ref=Feed:MaplePrimes:Integrating with a numeric solution to a PDE:Comments#answer44228</link>
      <itunes:summary>Thank you so much, that works great.

p.s. I think you must have a much better PC!</itunes:summary>
      <description>Thank you so much, that works great.

p.s. I think you must have a much better PC!</description>
      <guid>44228</guid>
      <pubDate>Thu, 11 Mar 2010 19:01:53 Z</pubDate>
      <itunes:author>raggapuffin</itunes:author>
      <author>raggapuffin</author>
    </item>
    <item>
      <title>length of output</title>
      <link>http://www.mapleprimes.com/questions/35540-Integrating-With-A-Numeric-Solution-To-A-PDE?ref=Feed:MaplePrimes:Integrating with a numeric solution to a PDE:Comments#comment44225</link>
      <itunes:summary>&lt;p&gt;I don't know.&amp;nbsp; Maybe if you post your actual code, somebody could figure out what's causing that.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I don't know.&amp;nbsp; Maybe if you post your actual code, somebody could figure out what's causing that.&lt;/p&gt;</description>
      <guid>44225</guid>
      <pubDate>Thu, 11 Mar 2010 05:06:02 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>timestep and spacestep</title>
      <link>http://www.mapleprimes.com/questions/35540-Integrating-With-A-Numeric-Solution-To-A-PDE?ref=Feed:MaplePrimes:Integrating with a numeric solution to a PDE:Comments#comment44227</link>
      <itunes:summary>&lt;p&gt;If you are using spacestep = 1/10000 with a range of 0 .. 1, that means you are calculating that for each time step you have at least 10000 values of u(x,t).&amp;nbsp; With timestep = 1/10000, calculating a value at, say, t = 1 would involve 10^8 values of&lt;br /&gt;
u(x,t).&amp;nbsp; This is likely to be rather time-consuming, and if those values are all saved it will consume a huge chunk of memory as well.&amp;nbsp; But this worked for me in Maple 13:&lt;/p&gt;
&lt;pre&gt;

&amp;gt; g := piecewise(t &amp;lt;= 1/80, piecewise(x &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x, k[2]),
 1/80 &amp;lt; t and t &amp;lt;= 2*(1/80), 0, 2*(1/80) &amp;lt; t and t &amp;lt; 3/80, 
 piecewise(x &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x, k[2]), 3/80 &amp;lt; t and t &amp;lt; 4*(1/80),
 0, 4*(1/80) &amp;lt; t and t &amp;lt; 5*(1/80), piecewise(x &amp;lt;= 2/3, k[1], 
 2/3 &amp;lt; x, k[2]), 5*(1/80) &amp;lt; t and t &amp;lt; 6*(1/80), 0, 6*(1/80) &amp;lt; t 
 and t &amp;lt; 7/80, piecewise(x &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x, k[2]), 7/80 &amp;lt; t 
 and t &amp;lt; 8*(1/80), 0, 8*(1/80) &amp;lt; t and t &amp;lt; 9/80, piecewise(x 
 &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x, k[2]), 9/80 &amp;lt; t and t &amp;lt; 10*(1/80), 0, 
 10*(1/80) &amp;lt; t and t &amp;lt; 11/80, piecewise(x &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x,
 k[2]), 11/80 &amp;lt; t and t &amp;lt; 12*(1/80), 0);
 k[1]:= 1; k[2]:= 2; a:= 1/100;
 PDE := diff(u(x, t), t) = g*(diff(u(x, t), x))+diff(u(x, t), x, x);
 IBC := {u(0, t) = 0, u(1, t) = 0, u(x, 0) = exp(-(x-2/3)^2/(2*a^2))/
  ((2*Pi)^(1/2)*a)};
 pds := pdsolve(PDE, IBC, numeric, time = t, range = 0 .. 1, 
   timestep = 1/10000, spacestep = 1/10000, optimize = true);
 R := pds:-value(output = listprocedure);
 uu:= subs(R,u(x,t));
 evalf(Int(uu(x,0.2),x=0..1,method=_Dexp));

&lt;/pre&gt;
&lt;p&gt;0.1435771715&lt;/p&gt;
&lt;p&gt;It took about 190 seconds of CPU time on my computer.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;If you are using spacestep = 1/10000 with a range of 0 .. 1, that means you are calculating that for each time step you have at least 10000 values of u(x,t).&amp;nbsp; With timestep = 1/10000, calculating a value at, say, t = 1 would involve 10^8 values of&lt;br /&gt;
u(x,t).&amp;nbsp; This is likely to be rather time-consuming, and if those values are all saved it will consume a huge chunk of memory as well.&amp;nbsp; But this worked for me in Maple 13:&lt;/p&gt;
&lt;pre&gt;

&amp;gt; g := piecewise(t &amp;lt;= 1/80, piecewise(x &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x, k[2]),
 1/80 &amp;lt; t and t &amp;lt;= 2*(1/80), 0, 2*(1/80) &amp;lt; t and t &amp;lt; 3/80, 
 piecewise(x &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x, k[2]), 3/80 &amp;lt; t and t &amp;lt; 4*(1/80),
 0, 4*(1/80) &amp;lt; t and t &amp;lt; 5*(1/80), piecewise(x &amp;lt;= 2/3, k[1], 
 2/3 &amp;lt; x, k[2]), 5*(1/80) &amp;lt; t and t &amp;lt; 6*(1/80), 0, 6*(1/80) &amp;lt; t 
 and t &amp;lt; 7/80, piecewise(x &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x, k[2]), 7/80 &amp;lt; t 
 and t &amp;lt; 8*(1/80), 0, 8*(1/80) &amp;lt; t and t &amp;lt; 9/80, piecewise(x 
 &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x, k[2]), 9/80 &amp;lt; t and t &amp;lt; 10*(1/80), 0, 
 10*(1/80) &amp;lt; t and t &amp;lt; 11/80, piecewise(x &amp;lt;= 2/3, k[1], 2/3 &amp;lt; x,
 k[2]), 11/80 &amp;lt; t and t &amp;lt; 12*(1/80), 0);
 k[1]:= 1; k[2]:= 2; a:= 1/100;
 PDE := diff(u(x, t), t) = g*(diff(u(x, t), x))+diff(u(x, t), x, x);
 IBC := {u(0, t) = 0, u(1, t) = 0, u(x, 0) = exp(-(x-2/3)^2/(2*a^2))/
  ((2*Pi)^(1/2)*a)};
 pds := pdsolve(PDE, IBC, numeric, time = t, range = 0 .. 1, 
   timestep = 1/10000, spacestep = 1/10000, optimize = true);
 R := pds:-value(output = listprocedure);
 uu:= subs(R,u(x,t));
 evalf(Int(uu(x,0.2),x=0..1,method=_Dexp));

&lt;/pre&gt;
&lt;p&gt;0.1435771715&lt;/p&gt;
&lt;p&gt;It took about 190 seconds of CPU time on my computer.&lt;/p&gt;</description>
      <guid>44227</guid>
      <pubDate>Thu, 11 Mar 2010 07:50:00 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
  </channel>
</rss>