 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Plotting error: non-numeric vertex
| [MUG] Plotting error: non-numeric vertex |
|
Author: Tim Howard
Posted: 29/02/2000 22:26:27 GMT
|
>> From: "Tim Howard" "thoward"
I'm puzzled by an error message several of my students encountered while
working on a recent assignment. The sample code below works fine on my
office computer (Windows 95, Maple V version 5.00), but produces the
indicated plotting error when students run it in the computer lab (also
using Windows 95, version 5.00).
Any insight will be most appreciated.
Thanks,
Tim
>########################################################
> restart;
> dose1 := t -> sum((Heaviside(t-n*6)-Heaviside(t-(n*6+1/2)))*2,n=0..4);
dose1 := t ->
4
-----
\
) (2 Heaviside(t - 6 n) - 2 Heaviside(t - 6 n - 1/2))
/
-----
n = 0
> plot( dose1(t), t=0..32, numpoints=100, title= `Graph of Drug Dosage`);
Plotting error, non-numeric vertex definition
==========================================================================
Tim Howard
"thoward"
Associate Professor
Mathematics Department http://math.colstate.edu/thoward/
Columbus State University phone: 706-568-2172
4225 University Avenue fax: 706-569-3125
Columbus, GA 31907
==========================================================================
|
| [MUG] Re; Plotting error: non-numeric vertex |
|
Author: Maple Group
Posted: 03/03/2000 20:27:12 GMT
|
>> From: Maple Group "maple_gr"
| From: "Tim Howard" "thoward"
| I'm puzzled by an error message several of my students encountered while
| working on a recent assignment. The sample code below works fine on my
| office computer (Windows 95, Maple V version 5.00), but produces the
| indicated plotting error when students run it in the computer lab (also
| using Windows 95, version 5.00).
|
| > dose1 := t -> sum((Heaviside(t-n*6)-Heaviside(t-(n*6+1/2)))*2,n=0..4);
| > plot( dose1(t), t=0..32, numpoints=100, title= `Graph of Drug Dosage`);
| Plotting error, non-numeric vertex definition
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: "Rouben Rostamian" "rostamian"
Date: Wed, 1 Mar 2000 16:55:00 -0500
To: "maple-list"
Subject: Plotting error: non-numeric vertex
The Heaviside function is undefined at zero. When a plotting point
falls exactly at a jump, it results in a non-numeric vertex definition.
Looks like your office machine and the lab machines evaluate the function
at different sets of points.
To fix the problem, use the signum function instead of Heaviside.
Specifically, set
step := x -> (1+signum(x))/2;
then let
dose1 := t -> sum((step(t-n*6)-step(t-(n*6+1/2)))*2,n=0..4);
--
Rouben Rostamian "rostamian"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Wed, 1 Mar 2000 22:18:47 -0500 (EST)
From: Carl DeVore "devore"
To: "maple-list"
Subject: Plotting error: non-numeric vertex
That seems very similar to a problem that wracked my brain for a few hours
last semester. I was plotting sin(x)^x on 0..Pi. I or my students use
all the following versions of Maple:
release 5 and 5.1 for Unix, Windows 95, and Windows 98
student release 4 and 5 for Windows 95 & 98
MacIntosh versions that I don't know numbers for (never touch the stuff
myself).
I found so many differences in the behavior of this plot over different
versions that I can't keep track of them. I can tell you this for sure:
The command
> plot(sin(x)^x, x= 0..Pi);
gives the non-numeric vertex error on release 5 for Unix but does not give
the error on either release 4 or release 5.1 for Unix. The best overall
solution that I found was to include the "discont= true" option to the
plot command.
There are some additional suggestions in section 1.2 of _Calculus the
Maple Way_ by Robert B Israel.
That brings up a question I have for the list: If I define the continuous
extension of sin(x)/x like this:
> f:= x -> piecewise(x<>0, sin(x)/x, x=0, 1);
then "D" correctly computes the derivative at 0. But the function as
written cannot be evaluated at 0 -- f(0) gives a division-by-zero error.
On the other hand, if I define f this way:
> f:= x -> sin(x)/x; f(0):= 1;
then f can be evaluated at 0 but its derivative cannot be. Also, the
infnorm command will give incorrect results for the 4th derivative of this
f.
The only way I can find to get everything to work is to use both the
piecewise and define f separately at 0:
> f:= x -> piecewise(x<>0, sin(x)/x, x=0, 1); f(0):= 1;
But this feels unsatisfactory to me, and is difficult to explain to the
students. The piecewise alone should work.
Carl Devore
University of Delaware
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 02 Mar 2000 10:06:45 +0100
To: "maple-list"
From: Wilhelm Werner "werner"
Subject: Plotting error: non-numeric vertex
Hallo.
I encountered that error often with rel. 4 of Maple but no longer in rel. 5.1.
It was due to "undefined" cases in Heaviside; look:
> convert(Heaviside(t-4),piecewise);
{ 0 t < 4
{
{ undefined t = 4
{
{ 1 4 < t
For plotting of those Heaviside terms I therefore converted the functions
to a piecewise form and removed the undefined points from the piecewise list.
Regards
W.Werner
----------------------------------------------------------------------
Wilhelm Werner Phone: +49-(0)7940-1306-96
FH Heilbronn/Standort Kuenzelsau Fax : +49-(0)7940-1306-20
Daimlerstr. 35
D-74653 Kuenzelsau
e-mail: "werner"
----------------------------------------------------------------------
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 02 Mar 2000 08:09:49 -0600
From: Jan Zijlstra "zijlstra"
To: "maple-list"
Subject: Plotting error: non-numeric vertex
Dear Dr Howard,
The problem may be a leftover from a syntax change in the sum command:
try putting the index variable in back-quotes:
dose1 := t ->sum((Heaviside(t-n*6)-Heaviside(t-(n*6+1/2)))*2,`n`=0..4);
Maybe some machines in the lab have not been upgraded from vs 4?
Hope this helps,
Respectfully,
Jan Zijlstra
--
+-------------------------------------------------------------+
| Jan Zijlstra, Ph.D. |
| Department of Mathematical Sciences |
| Middle Tennessee State University |
| P.O. Box 34 |
| Murfreesboro TN 37132 |
| USA |
+---------------------------+---------------------------------+
| Tel: (615)898-2691 | WWW: http://mtsu.edu/~zijlstra |
| Fax: (615)898-5422 | e-mail: "zijlstra" |
+-------------------------------------------------------------+
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 02 Mar 2000 08:22:54 -0600
From: Herman Jaramillo "herman.jaramillo"
To: "maple-list"
Subject: Plotting error: non-numeric vertex
Dear Tim.
I have some tips and questions with them, since I am not expert on Maple.
If you do not use the parenthesis around your function in the plot definition,
this instruction will give you a plot.
plot(dose1, t=0..32, numpoints=100, title="Graph of Drug Dosage");
however you can check that the plot is identically zero (it shouldn't,
right?)
--actually the numbers are very small, like .2441260182907164 10^(-230)---
I do not understand why, but I am sure a Maple guru can help us here.
I made it work the following way.
> dose2 := sum((Heaviside(t-n*6)-Heaviside(t-(n*6+1/2)))*2,n=0..4);
> plot(dose2(t), t=0..32, style=point, numpoints=100, title="Graph of Drug
Dosage");
The question is when to use the argument (t), and when no. While the
differences
between function definition and unapply and all that have been explained I
still have a
hard time with the sintax. I guess I have not got the concept yet and all I
can do
now is trial an error.
--
Herman Jaramillo phone: 713-689-6503
Research Geophysicist fax : 713-689-6100
Baker Hughes (Western Geophysical) email: "herman.jaramillo"
3600 Briarpark Drive (77042-5275)
P.O. Box 2469
Houston, Texas 77252-2469
|
Previous by date: [MUG] Re: Parameter in initial condition?, Douglas B Meade
Next by date: [MUG] dsolve[numeric] output order, Andris Lasis/Sim S S Service Centre
Previous thread: [MUG] How protect a MapleWorkSheet, Juan Manuel De Olazabal
Next thread: [MUG] dsolve[numeric] output order, Andris Lasis/Sim S S Service Centre
|
|
|