<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Isolate and derive a solution obtained from dsolve</title>
    <link>http://www.mapleprimes.com/questions/35484-Isolate-And-Derive-A-Solution-Obtained</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 13:32:49 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 13:32:49 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Isolate and derive a solution obtained from dsolve</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Isolate and derive a solution obtained from dsolve</title>
      <link>http://www.mapleprimes.com/questions/35484-Isolate-And-Derive-A-Solution-Obtained</link>
    </image>
    <item>
      <title>to make the problem more</title>
      <link>http://www.mapleprimes.com/questions/35484-Isolate-And-Derive-A-Solution-Obtained?ref=Feed:MaplePrimes:Isolate and derive a solution obtained from dsolve:Comments#answer44038</link>
      <itunes:summary>to make the problem more understandable:

Since the ODEsystem does not have an explicit solution, I checked [dsolve,numeric] in the help file.

The example there is

dsys := {x(0) = 1, y(0) = 0, diff(x(t), t) = y(t), diff(y(t), t) = -x(t)}
dsn1:=dsolve(dsys,numeric):
dsn1(1)
     [t = 1., x(t) = 0.540302331775852962, y(t) = -0.841471101157619694]

What I need is a command which returns the x(t) entry in the upper line, as a function in t - so that i can for instance plot its derivate.

As for the parameter, I checked the [dsolve,numeric,interactive (parameters)] help file. 

Say i use
dsolve({parameterized system}, numeric, parameters = [k])

Again, how do I extract the x(t) solution of the system, subject to both t and the parameter k, so that I can plot the function diff(x(t,k),t) against t and k?</itunes:summary>
      <description>to make the problem more understandable:

Since the ODEsystem does not have an explicit solution, I checked [dsolve,numeric] in the help file.

The example there is

dsys := {x(0) = 1, y(0) = 0, diff(x(t), t) = y(t), diff(y(t), t) = -x(t)}
dsn1:=dsolve(dsys,numeric):
dsn1(1)
     [t = 1., x(t) = 0.540302331775852962, y(t) = -0.841471101157619694]

What I need is a command which returns the x(t) entry in the upper line, as a function in t - so that i can for instance plot its derivate.

As for the parameter, I checked the [dsolve,numeric,interactive (parameters)] help file. 

Say i use
dsolve({parameterized system}, numeric, parameters = [k])

Again, how do I extract the x(t) solution of the system, subject to both t and the parameter k, so that I can plot the function diff(x(t,k),t) against t and k?</description>
      <guid>44038</guid>
      <pubDate>Thu, 18 Mar 2010 20:45:42 Z</pubDate>
      <itunes:author>robster</itunes:author>
      <author>robster</author>
    </item>
    <item>
      <title>derivative</title>
      <link>http://www.mapleprimes.com/questions/35484-Isolate-And-Derive-A-Solution-Obtained?ref=Feed:MaplePrimes:Isolate and derive a solution obtained from dsolve:Comments#answer44039</link>
      <itunes:summary>&lt;p&gt;You can &amp;quot;extract&amp;quot; a function from a numeric solution something like this (I'll try a rather less trivial example):&lt;/p&gt;
&lt;pre&gt;
&amp;gt; sys:= {diff(x(t),t) = t*y(t) + x(t)*y(t), diff(y(t),t) = y(t) - x(t), x(0) = 1, y(0) = 0};
  Sol:= dsolve(sys, numeric, output=listprocedure);
  X:= subs(Sol, x(t)); Y:= subs(Sol, y(t));
&lt;/pre&gt;
&lt;p&gt;Then X and Y are procedures that will return numerical values: e.g.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; X(Pi); 
&lt;/pre&gt;
&lt;p&gt;&amp;minus;2.89145099805825588&lt;/p&gt;
&lt;p&gt;You can also plot them.&lt;/p&gt;
&lt;p&gt;However, you can't differentiate them.&amp;nbsp; What you can do, though, is use the system of differential equations to express their derivatives in terms of X and Y.&amp;nbsp; Thus:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; Xp:= subs(x=X,y=Y, subs(sys, diff(x(t),t)));
&lt;/pre&gt;
&lt;p&gt;And then this can be plotted:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plot(Xp, t = 0 .. 5);
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;You can &amp;quot;extract&amp;quot; a function from a numeric solution something like this (I'll try a rather less trivial example):&lt;/p&gt;
&lt;pre&gt;
&amp;gt; sys:= {diff(x(t),t) = t*y(t) + x(t)*y(t), diff(y(t),t) = y(t) - x(t), x(0) = 1, y(0) = 0};
  Sol:= dsolve(sys, numeric, output=listprocedure);
  X:= subs(Sol, x(t)); Y:= subs(Sol, y(t));
&lt;/pre&gt;
&lt;p&gt;Then X and Y are procedures that will return numerical values: e.g.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; X(Pi); 
&lt;/pre&gt;
&lt;p&gt;&amp;minus;2.89145099805825588&lt;/p&gt;
&lt;p&gt;You can also plot them.&lt;/p&gt;
&lt;p&gt;However, you can't differentiate them.&amp;nbsp; What you can do, though, is use the system of differential equations to express their derivatives in terms of X and Y.&amp;nbsp; Thus:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; Xp:= subs(x=X,y=Y, subs(sys, diff(x(t),t)));
&lt;/pre&gt;
&lt;p&gt;And then this can be plotted:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plot(Xp, t = 0 .. 5);
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>44039</guid>
      <pubDate>Thu, 18 Mar 2010 22:03:29 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>thank you very much robert,</title>
      <link>http://www.mapleprimes.com/questions/35484-Isolate-And-Derive-A-Solution-Obtained?ref=Feed:MaplePrimes:Isolate and derive a solution obtained from dsolve:Comments#answer44041</link>
      <itunes:summary>thank you very much robert, this is precisely what i needed.

now the next obstacle is to 3d-plot the solution x=x(t,k) together with another function in t,k (given explicitly)

so, the function i want to plot has basically the following form

f(t,k) + x(t,k) , [e.g. f = t + k ]

i went for

1. plot3d( f(t,k) + X2(t,k) , t=0..1 , k=0..1)

2. using the unapply function on f: R:=unapply( f(t,k), t,k)
and then  plot3d( R + Xq, 0..1, 0..1)

where Xq is the 'non-derived' equivalent to the Xp you defined, that means
Xq:= unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)',x(t)),t,k)

but neither of the two nor similar tries worked out so far...
could you point me in the right direction once more? thank you very much.</itunes:summary>
      <description>thank you very much robert, this is precisely what i needed.

now the next obstacle is to 3d-plot the solution x=x(t,k) together with another function in t,k (given explicitly)

so, the function i want to plot has basically the following form

f(t,k) + x(t,k) , [e.g. f = t + k ]

i went for

1. plot3d( f(t,k) + X2(t,k) , t=0..1 , k=0..1)

2. using the unapply function on f: R:=unapply( f(t,k), t,k)
and then  plot3d( R + Xq, 0..1, 0..1)

where Xq is the 'non-derived' equivalent to the Xp you defined, that means
Xq:= unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)',x(t)),t,k)

but neither of the two nor similar tries worked out so far...
could you point me in the right direction once more? thank you very much.</description>
      <guid>44041</guid>
      <pubDate>Thu, 25 Mar 2010 16:42:25 Z</pubDate>
      <itunes:author>robster</itunes:author>
      <author>robster</author>
    </item>
    <item>
      <title>mh ok, now since both</title>
      <link>http://www.mapleprimes.com/questions/35484-Isolate-And-Derive-A-Solution-Obtained?ref=Feed:MaplePrimes:Isolate and derive a solution obtained from dsolve:Comments#answer44042</link>
      <itunes:summary>mh ok, now since both plot3d(R,t,k) and plot3d(Xq,t,k) return a plot, and plot3d(R+Xq,t,k) does not, the basic question is how to add two functions obtained from the unapply command.

/ok, it's working now. i could have sworn i tried it the way you suggested before and it did not work.. anyway, thanks for the answer :-)</itunes:summary>
      <description>mh ok, now since both plot3d(R,t,k) and plot3d(Xq,t,k) return a plot, and plot3d(R+Xq,t,k) does not, the basic question is how to add two functions obtained from the unapply command.

/ok, it's working now. i could have sworn i tried it the way you suggested before and it did not work.. anyway, thanks for the answer :-)</description>
      <guid>44042</guid>
      <pubDate>Thu, 25 Mar 2010 18:58:16 Z</pubDate>
      <itunes:author>robster</itunes:author>
      <author>robster</author>
    </item>
    <item>
      <title>puh, never ending story</title>
      <link>http://www.mapleprimes.com/questions/35484-Isolate-And-Derive-A-Solution-Obtained?ref=Feed:MaplePrimes:Isolate and derive a solution obtained from dsolve:Comments#answer44044</link>
      <itunes:summary>puh, never ending story ...

f is still e.g. unapply(t+k,t,k)
plot3d(Xp+f,0..1,0..1) is working fine, but plot3d(max(0,Xp)+f,0..1,0..1) is not, neither is the equivalent plot3d((Xp+|Xp|)/2+f,0..1,0..1)

?

/edit:  i guess it is the comparison, 0 to Xp in max, and -Xp to Xp in |.|, that cannot be done.

tried sqrt(Xp^2) now and it's giving me what i want.

still out of curiosity, what has to be done to get abs and max working?


-------------------

next problem ^.^


with axes t and k i'd like to 3d plot the function

integral [from 0 to t] Xp + f d(tau)

and not the slightest idea how (that means all my tries failed and the help file is of no help at all)


/e: most recent development:
i modified the expression you brought up,
  Xp:= unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)',diff(x(t),t)),t,k);

into

Xq:=unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)', int ( diff(x(t),t) + f(t,k), t=0..T )),T,k);

and plot3d(Xq,0..1,0..1) is actually giving me the image i was looking for, but still i am a bit confused that while Xp(2,2) does return a scalar, Xq(2,2) does not. Instead it returns an integral expression (from 0 to 2) including X(t) and Y(t), i don't see why it is not calculated explicitly</itunes:summary>
      <description>puh, never ending story ...

f is still e.g. unapply(t+k,t,k)
plot3d(Xp+f,0..1,0..1) is working fine, but plot3d(max(0,Xp)+f,0..1,0..1) is not, neither is the equivalent plot3d((Xp+|Xp|)/2+f,0..1,0..1)

?

/edit:  i guess it is the comparison, 0 to Xp in max, and -Xp to Xp in |.|, that cannot be done.

tried sqrt(Xp^2) now and it's giving me what i want.

still out of curiosity, what has to be done to get abs and max working?


-------------------

next problem ^.^


with axes t and k i'd like to 3d plot the function

integral [from 0 to t] Xp + f d(tau)

and not the slightest idea how (that means all my tries failed and the help file is of no help at all)


/e: most recent development:
i modified the expression you brought up,
  Xp:= unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)',diff(x(t),t)),t,k);

into

Xq:=unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)', int ( diff(x(t),t) + f(t,k), t=0..T )),T,k);

and plot3d(Xq,0..1,0..1) is actually giving me the image i was looking for, but still i am a bit confused that while Xp(2,2) does return a scalar, Xq(2,2) does not. Instead it returns an integral expression (from 0 to 2) including X(t) and Y(t), i don't see why it is not calculated explicitly</description>
      <guid>44044</guid>
      <pubDate>Fri, 26 Mar 2010 18:03:48 Z</pubDate>
      <itunes:author>robster</itunes:author>
      <author>robster</author>
    </item>
    <item>
      <title>parametric</title>
      <link>http://www.mapleprimes.com/questions/35484-Isolate-And-Derive-A-Solution-Obtained?ref=Feed:MaplePrimes:Isolate and derive a solution obtained from dsolve:Comments#comment44040</link>
      <itunes:summary>&lt;p&gt;Sorry, I didn't notice the part of your question involving parameter k.&amp;nbsp; Suppose the system is &lt;/p&gt;
&lt;pre&gt;
&amp;gt; sys:= {diff(x(t),t) = k*y(t) + x(t)*y(t), diff(y(t),t) = y(t) - x(t), 
      x(0) = 1, y(0) = 0};
  Sol:= dsolve(sys, numeric, output=listprocedure,parameters=[k]);
  X:= subs(Sol, x(t));
  Y:= subs(Sol, y(t)); 
&lt;/pre&gt;
&lt;p&gt;Now you'd like functions of two variables t and k.&amp;nbsp; &lt;/p&gt;
&lt;pre&gt;
&amp;nbsp;&amp;nbsp; X2:= proc(t, k) X(parameters=[k]); X(t); end proc;
&amp;nbsp;&amp;nbsp; Y2:= proc(t, k) Y(parameters=[k]); Y(t); end proc;
   Xp:= unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)',diff(x(t),t)),t,k);
&lt;/pre&gt;
&lt;p&gt;These can't be applied to symbolic t and k, but they're ok with numeric t and k, and you can plot them in 3d, e.g.:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;pre&gt;
&amp;gt; plot3d(Xp, 0 .. 5, 0 .. 3, axes=box, labels = [t, k, diff(x(t),t)]);

&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;Sorry, I didn't notice the part of your question involving parameter k.&amp;nbsp; Suppose the system is &lt;/p&gt;
&lt;pre&gt;
&amp;gt; sys:= {diff(x(t),t) = k*y(t) + x(t)*y(t), diff(y(t),t) = y(t) - x(t), 
      x(0) = 1, y(0) = 0};
  Sol:= dsolve(sys, numeric, output=listprocedure,parameters=[k]);
  X:= subs(Sol, x(t));
  Y:= subs(Sol, y(t)); 
&lt;/pre&gt;
&lt;p&gt;Now you'd like functions of two variables t and k.&amp;nbsp; &lt;/p&gt;
&lt;pre&gt;
&amp;nbsp;&amp;nbsp; X2:= proc(t, k) X(parameters=[k]); X(t); end proc;
&amp;nbsp;&amp;nbsp; Y2:= proc(t, k) Y(parameters=[k]); Y(t); end proc;
   Xp:= unapply(subs(sys,x(t)='X2(t,k)',y(t)='Y2(t,k)',diff(x(t),t)),t,k);
&lt;/pre&gt;
&lt;p&gt;These can't be applied to symbolic t and k, but they're ok with numeric t and k, and you can plot them in 3d, e.g.:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;pre&gt;
&amp;gt; plot3d(Xp, 0 .. 5, 0 .. 3, axes=box, labels = [t, k, diff(x(t),t)]);

&lt;/pre&gt;</description>
      <guid>44040</guid>
      <pubDate>Thu, 18 Mar 2010 22:34:05 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
  </channel>
</rss>