home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / sci / math / symbolic / 2375 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.2 KB  |  32 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!hmarvel
  3. From: hmarvel@magnus.acs.ohio-state.edu (Howard P Marvel)
  4. Subject: plots and eval
  5. Message-ID: <1992Sep10.164017.3507@magnus.acs.ohio-state.edu>
  6. Sender: news@magnus.acs.ohio-state.edu
  7. Nntp-Posting-Host: top.magnus.acs.ohio-state.edu
  8. Organization: The Ohio State University
  9. Date: Thu, 10 Sep 1992 16:40:17 GMT
  10. Lines: 20
  11.  
  12. Consider the following series of statements in Maple:
  13.  
  14. c := proc (alpha,beta) if signum(alpha+beta)=1 then alpha+ beta else 0 fi en\
  15. d;
  16. c(a,b);
  17. a:=1;
  18. b:=1;
  19. c(a,b);
  20. plot3d(c(x,y),x=0..1,y=0..1);
  21.  
  22. The first sets up a proc that returns alpha + beta if alpha + beta is
  23. a positive real. However, if alpha and beta are variables, signum
  24. cannot evaluate the expression, and the proc returns 0. The first call
  25. c(a,b) returns 0 and the second returns 2. Now consider the plot
  26. statement. This should yield values from 0 to 2, right? Instead,
  27. signum fails and all plotted values are 0. My question is, is there a
  28. way to force Maple to evaluate c for the values in question and to
  29. plot the values?  
  30.  
  31. Thanks in advance for any suggestions.
  32.