<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Combining functions, </title>
    <link>http://www.mapleprimes.com/questions/35821-Combining-Functions-</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 23:53:54 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 23:53:54 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Combining functions, </description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Combining functions, </title>
      <link>http://www.mapleprimes.com/questions/35821-Combining-Functions-</link>
    </image>
    <item>
      <title>Defining functions</title>
      <link>http://www.mapleprimes.com/questions/35821-Combining-Functions-?ref=Feed:MaplePrimes:Combining functions, :Comments#answer45254</link>
      <itunes:summary>&lt;p&gt;I hope you defined your functions something like this, not as you wrote them:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; N40 := xi -&amp;gt; piecewise(0&amp;lt;xi and xi&amp;lt;=1, a, b);
&amp;nbsp; N50 := xi -&amp;gt; piecewise(1 &amp;lt; xi and xi &amp;lt;= 2, c, d);
&lt;/pre&gt;
&lt;p&gt;Then to combine them:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; N41 := xi -&amp;gt; (xi-1)*N40(xi) + (2-xi)*N50(xi);
&lt;/pre&gt;
&lt;p&gt;Or you could even do this, with the help of an &amp;quot;identity function&amp;quot;:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; id:= x -&amp;gt; x:
&amp;nbsp; N41 := (id - 1)*N40 + (2-id)*N50;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I hope you defined your functions something like this, not as you wrote them:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; N40 := xi -&amp;gt; piecewise(0&amp;lt;xi and xi&amp;lt;=1, a, b);
&amp;nbsp; N50 := xi -&amp;gt; piecewise(1 &amp;lt; xi and xi &amp;lt;= 2, c, d);
&lt;/pre&gt;
&lt;p&gt;Then to combine them:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; N41 := xi -&amp;gt; (xi-1)*N40(xi) + (2-xi)*N50(xi);
&lt;/pre&gt;
&lt;p&gt;Or you could even do this, with the help of an &amp;quot;identity function&amp;quot;:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; id:= x -&amp;gt; x:
&amp;nbsp; N41 := (id - 1)*N40 + (2-id)*N50;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>45254</guid>
      <pubDate>Wed, 03 Feb 2010 20:42:48 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>Thanks that worked,
yea I</title>
      <link>http://www.mapleprimes.com/questions/35821-Combining-Functions-?ref=Feed:MaplePrimes:Combining functions, :Comments#answer45255</link>
      <itunes:summary>&lt;p&gt;Thanks that worked,&lt;/p&gt;
&lt;p&gt;yea I forgot&amp;nbsp;the actual values of the piecwise function in my initial question..&lt;/p&gt;
&lt;p&gt;What is the difference between the notations&lt;/p&gt;
&lt;p&gt;N40(xi):=piecewise(0&amp;lt;xi and xi&amp;lt;=1, a, b);&lt;br /&gt;
N40 :=xi -&amp;gt; piecewise(0&amp;lt;xi and xi&amp;lt;=1, a, b);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;?&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;Thanks that worked,&lt;/p&gt;
&lt;p&gt;yea I forgot&amp;nbsp;the actual values of the piecwise function in my initial question..&lt;/p&gt;
&lt;p&gt;What is the difference between the notations&lt;/p&gt;
&lt;p&gt;N40(xi):=piecewise(0&amp;lt;xi and xi&amp;lt;=1, a, b);&lt;br /&gt;
N40 :=xi -&amp;gt; piecewise(0&amp;lt;xi and xi&amp;lt;=1, a, b);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>45255</guid>
      <pubDate>Wed, 03 Feb 2010 21:03:20 Z</pubDate>
      <itunes:author>Søren Mikkel Andersen</itunes:author>
      <author>Søren Mikkel Andersen</author>
    </item>
    <item>
      <title>Hi, I now have made the</title>
      <link>http://www.mapleprimes.com/questions/35821-Combining-Functions-?ref=Feed:MaplePrimes:Combining functions, :Comments#answer45257</link>
      <itunes:summary>&lt;p&gt;Hi, I now have made the generic functions&lt;/p&gt;
&lt;p&gt;for instance, I have&lt;/p&gt;
&lt;p&gt;&lt;maple&gt;&lt;/maple&gt;&lt;maple&gt;&lt;/maple&gt;&lt;i&gt;i:=3: p := 1:&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;maple&gt;&lt;/maple&gt;&lt;maple&gt;&lt;/maple&gt;&lt;i&gt;N31:=xi-&amp;gt;N40(xi)*((kn[i+p+1]-xi)/(kn[i+p+1]-kn[i]+1])):&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Now&lt;i&gt; N31 &lt;/i&gt;works as intended, but I want to make another generic function&lt;/p&gt;
&lt;p&gt;by&lt;/p&gt;
&lt;p&gt;&lt;maple&gt;&lt;/maple&gt;&lt;maple&gt;&lt;/maple&gt;&lt;i&gt;i:=4: p := 1:&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;N41:=xi-&amp;gt;N50(xi)*((kn[i+p+1]-xi)/(kn[i+p+1]-kn[i]+1])):&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;But then that changes the behaviour of &lt;i&gt;N31&lt;/i&gt;,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;how can I make &lt;i&gt;N31&lt;/i&gt; remain constant with respect to changing my counting variables &lt;i&gt;i&lt;/i&gt; and&lt;i&gt; p&lt;/i&gt; ?&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;Hi, I now have made the generic functions&lt;/p&gt;
&lt;p&gt;for instance, I have&lt;/p&gt;
&lt;p&gt;&lt;maple&gt;&lt;/maple&gt;&lt;maple&gt;&lt;/maple&gt;&lt;i&gt;i:=3: p := 1:&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;maple&gt;&lt;/maple&gt;&lt;maple&gt;&lt;/maple&gt;&lt;i&gt;N31:=xi-&amp;gt;N40(xi)*((kn[i+p+1]-xi)/(kn[i+p+1]-kn[i]+1])):&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Now&lt;i&gt; N31 &lt;/i&gt;works as intended, but I want to make another generic function&lt;/p&gt;
&lt;p&gt;by&lt;/p&gt;
&lt;p&gt;&lt;maple&gt;&lt;/maple&gt;&lt;maple&gt;&lt;/maple&gt;&lt;i&gt;i:=4: p := 1:&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;N41:=xi-&amp;gt;N50(xi)*((kn[i+p+1]-xi)/(kn[i+p+1]-kn[i]+1])):&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;But then that changes the behaviour of &lt;i&gt;N31&lt;/i&gt;,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;how can I make &lt;i&gt;N31&lt;/i&gt; remain constant with respect to changing my counting variables &lt;i&gt;i&lt;/i&gt; and&lt;i&gt; p&lt;/i&gt; ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>45257</guid>
      <pubDate>Thu, 04 Feb 2010 00:37:14 Z</pubDate>
      <itunes:author>Søren Mikkel Andersen</itunes:author>
      <author>Søren Mikkel Andersen</author>
    </item>
    <item>
      <title>instantiation</title>
      <link>http://www.mapleprimes.com/questions/35821-Combining-Functions-?ref=Feed:MaplePrimes:Combining functions, :Comments#answer45258</link>
      <itunes:summary>&lt;pre&gt;
&amp;gt; unassign('i'):unassign('p'):

&amp;gt; N:=xi-&amp;gt;N40(xi)*((kn[i+p+1]-xi)/(kn[i+p+1]-kn[i]+1));
      N40(xi) (kn[i + p + 1] - xi)
xi -&amp;gt; ----------------------------
       kn[i + p + 1] - kn[i] + 1  

&amp;gt; N31:=subs([i=3,p=1],eval(N));
      N40(xi) (kn[5] - xi)
xi -&amp;gt; --------------------
       kn[5] - kn[3] + 1  

&amp;gt; N41:=subs([i=4,p=1],eval(N));
      N40(xi) (kn[6] - xi)
xi -&amp;gt; --------------------
       kn[6] - kn[4] + 1  

&amp;gt; N31(3.2);
                           N40(3.2) (kn[5] - 3.2)
                           ----------------------
                             kn[5] - kn[3] + 1   

&amp;gt; i,p := 177,-20:

&amp;gt; N31(3.2);
                           N40(3.2) (kn[5] - 3.2)
                           ----------------------
                             kn[5] - kn[3] + 1   
&lt;/pre&gt;</itunes:summary>
      <description>&lt;pre&gt;
&amp;gt; unassign('i'):unassign('p'):

&amp;gt; N:=xi-&amp;gt;N40(xi)*((kn[i+p+1]-xi)/(kn[i+p+1]-kn[i]+1));
      N40(xi) (kn[i + p + 1] - xi)
xi -&amp;gt; ----------------------------
       kn[i + p + 1] - kn[i] + 1  

&amp;gt; N31:=subs([i=3,p=1],eval(N));
      N40(xi) (kn[5] - xi)
xi -&amp;gt; --------------------
       kn[5] - kn[3] + 1  

&amp;gt; N41:=subs([i=4,p=1],eval(N));
      N40(xi) (kn[6] - xi)
xi -&amp;gt; --------------------
       kn[6] - kn[4] + 1  

&amp;gt; N31(3.2);
                           N40(3.2) (kn[5] - 3.2)
                           ----------------------
                             kn[5] - kn[3] + 1   

&amp;gt; i,p := 177,-20:

&amp;gt; N31(3.2);
                           N40(3.2) (kn[5] - 3.2)
                           ----------------------
                             kn[5] - kn[3] + 1   
&lt;/pre&gt;</description>
      <guid>45258</guid>
      <pubDate>Thu, 04 Feb 2010 02:50:31 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>Defining functions</title>
      <link>http://www.mapleprimes.com/questions/35821-Combining-Functions-?ref=Feed:MaplePrimes:Combining functions, :Comments#comment45256</link>
      <itunes:summary>&lt;p&gt;The normal way to define a function is using&amp;nbsp; &lt;b&gt;-&amp;gt;&lt;/b&gt;.&amp;nbsp; With &lt;b&gt;N40(xi):= ...&amp;nbsp; &lt;/b&gt;you are literally defining the value of the procedure N40 only on the literal input &lt;b&gt;xi&lt;/b&gt; (technically, you are assigning an entry in the remember table of N40), and this will not affect N40(anything else).&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are using 2D input,  &lt;b&gt;N40(xi):= ... &lt;/b&gt; will cause a popup window asking you to clarify what you mean, a function definition or a remember table assignment.&amp;nbsp; If you choose function definition, the result will be as if you used &lt;b&gt;-&amp;gt;&lt;/b&gt;.&amp;nbsp; But you might as well use -&amp;gt; in the first place.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;The normal way to define a function is using&amp;nbsp; &lt;b&gt;-&amp;gt;&lt;/b&gt;.&amp;nbsp; With &lt;b&gt;N40(xi):= ...&amp;nbsp; &lt;/b&gt;you are literally defining the value of the procedure N40 only on the literal input &lt;b&gt;xi&lt;/b&gt; (technically, you are assigning an entry in the remember table of N40), and this will not affect N40(anything else).&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are using 2D input,  &lt;b&gt;N40(xi):= ... &lt;/b&gt; will cause a popup window asking you to clarify what you mean, a function definition or a remember table assignment.&amp;nbsp; If you choose function definition, the result will be as if you used &lt;b&gt;-&amp;gt;&lt;/b&gt;.&amp;nbsp; But you might as well use -&amp;gt; in the first place.&lt;/p&gt;</description>
      <guid>45256</guid>
      <pubDate>Wed, 03 Feb 2010 22:43:24 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
  </channel>
</rss>