axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [ExampleSolution1] Thanks for fixing the display probl


From: wyscc
Subject: [Axiom-developer] [ExampleSolution1] Thanks for fixing the display problem
Date: Thu, 17 Mar 2005 11:36:06 -0600

Changes http://page.axiom-developer.org/zope/mathaction/ExampleSolution1/diff
--

??changed:
-<pre>From wyscc, March 16, 2005 05:06:00</pre>
-
-
-
-The above does not really solve the problem on differentiation of a piecewise 
function, which, in my opinion, is an unreasonable expectation in general 
because of the multitude of ways to define the conditions; it may help if one 
uses the Heaviside function. The numerical definition of <code>N0(t)</code> is 
actually totally ignored in the definition of <code>N(t,i,p)</code> and thus 
also in the differentiation process, by the use of 
<code>operator('No)(t)</code>. Indeed, in the expression for <code>N</code> or 
its derivative with respect to <code>t</code>, the  "function" <code>N0</code> 
is still an <code>operator</code>, and as such, <code>N0(2)</code> is 
undefined! In other words, there is a distinction between the numerically 
defined function <code>N0</code> and the operator <code>N0</code>. This is 
illustrated below.
-
<pre>From wyscc, March 16, 2005 05:06:00, modified March 17 12:30:00</pre>

The above does not really solve the problem on differentiation of a piecewise 
function, which, in my opinion, is an unreasonable expectation in general 
because of the multitude of ways to define the conditions; it may help if one 
uses the Heaviside function, but in general, one probably needs techniques from 
automatic differentiation. The numerical definition of <code>N0(t)</code> is 
actually totally ignored in the definition of <code>N(t,i,p)</code> and thus 
also in the differentiation process, because of the use of 
<code>operator('No)(t)</code>. Indeed, in the expression for <code>N</code> or 
its derivative with respect to <code>t</code>, the  "function" <code>N0</code> 
is still an <code>operator</code>, and as such, <code>N0(2)</code> is 
undefined! In other words, there is a distinction between the numerically 
defined function <code>N0</code> and the operator <code>N0</code>. This is 
illustrated below.

\begin{axiom}
N(2,0,3)
\end{axiom}

Notice that the evaluation for <code>N0(2)</code> is not really done.

A common error when mixing numeric and symbolic
computation is to first define the derivative as a function of <code>t</code>
and then evaluate the derivative at some value of <code>t</code>, as in

\begin{verbatim}
dNdt(t)==D(N(t,0,3),t)
dNdt(2)
\end{verbatim}

This does not work because when <code>dNdt(2)</code> is called the system
(Axiom, or other systems) will substitute the value of <code>t=2</code> in
<code>N(t,0,3)</code> and <code>t</code> of <code>D(N(t,0,3),t)</code>
before differentiating, causing a run-time error. One way to avoid this error 
is to use substitution instead of a
function call, as done in the second line below. 

--removed:
--- dNdt(2)

--removed:
-N(2,0,3)
-\end{axiom}
-
-Notice that the evaluation for <code>N0(2)</code> is not really done.
-One way to avoid this error is to use substitution instead of a
-function call, as done in the second line above. The function call
-<code>dNdt(2)</code> is not done directly.
-
-To illustrate a common error when mixing numeric and symbolic
-computation: first define the derivative as a function of <code>t</code>
-and then evaluate the derivative at some value of <code>t</code>.
-This does not work because when the derivative is called the system
-(Axiom, or other systems) will substitute the value of <code>t</code>
-before differentiating. 
-\begin{axiom}

--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]