[comp.sys.handhelds] A little problem for a HP48sx

ECO8941@ECOSTAT.AAU.DK ("Povl H. Pedersen") (09/27/90)

As I do not have a HP48sx currently, I will be glad if there is
somebody who would try to let the HP48sx find the symbolic solution
to the following function.

Integral of e^((y^2)/2) solved with respect to y,
and I would also like the numerical solution, which is finite
and surely exists.

Povl H. Pedersen
eco8941@ecostat.aau.dk

ram@tellabs.com (Bob Martin) (10/05/90)

In article <2A7CD53A451F00CC7F@vms2.uni-c.dk> ECO8941@ECOSTAT.AAU.DK ("Povl H. Pedersen") writes:
>As I do not have a HP48sx currently, I will be glad if there is
>somebody who would try to let the HP48sx find the symbolic solution
>to the following function.
>Integral of e^((y^2)/2) solved with respect to y,
>and I would also like the numerical solution, which is finite
>and surely exists.
>Povl H. Pedersen

According to the HP manual, pg. 429-430, the 48SX can symbollically integrate:
1)  All built in functions whose anti-derivatives are other built in functions

2)  Sums, differences, and negations of #1 above

3)  The derivatives of built in functions (i.e.  INV(1+X^2) => ARCTAN )

4)  Polynomials whose base term is linear (X^2+3X+1 but not (X^2-6)^3+(X^2-6)^2)

5)  Selected patterns composed of functions whose antiderivatives are
	expressible in terms of other built in functions, for example
	1/(COS(X)*SIN(X)) => LN(TAN(X)).   In other words, certain special
	cases they decided to support.

Now page 431 explains how otherwise non-itegrable functions can be approximated
using Taylor's polynomials, and their example is e^(x^2), which is very similar
to your problem (e^(.5x^2)).  They specifically state that this expression
"is not integrable by any of the methods thus far described in this chapter".
So, to answer the first part of your question, the HP48SX cannot SYMBOLICALLY
integrate your expression.

Now, to answer the second part of your question, you say the numerical solution
is finite and surely exists.  What I do not know are your limits of integration.
If I use the limits 0 and oo (infinity), the answer is infinite, so I assume
you mean some specific limits.  Below are some sample results obtained using
the 48SX.

Taylor's Polynomial:  4th order  -  1 + .5*y^2 + .125*y^4
		      6th order  -  1 + .5*y^2 + .125*y^4 + .0208*y^6


Numerical integration, degree of accuracy = .01%
				Numerical	4th order	6th order
	limits:	(0,2)	result:	4.7289			5		6.3312
		(0,5)	    56148.4372		       91.625	      416.625
		(0,10)		5.2382E20	     1301.000	    22101.000

Some notes of interest:  The numerical solution took about 20 seconds for any
	given value of y, and of course the result had an accuracy of .01%.
	The 4th order Taylor took a little less than 1 minute to calculate,
	and the 6th order took about 3.5 minutes.  I tried getting the 8th order
	Taylor but decided to give up after about 6 minutes.  However, the
	4th and 6th order Taylor's are way off, so I doubt the patience required
	to obtain the 8th order would have been worth it.

*** Moderate flame on ***
While computing the 8th order Taylor described above, I decided to give up
and terminate execution.  Remembering that I read in the manual the ON key
terminates program execution, I hit the ON key.  Several times.  I held it down
for 10 seconds.  Nothing.  The Taylor computation just kept chugging.
Apparently hitting on only terminates a user program.  I hate to think that
I might accidentally execute some command that I have no way to terminate,
which ties up my calculator for days.  Fortunately, my calculator is new, so
I didn't have any valuable information in it, so I tried ON-C and that did the
trick.

Hope this helps
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Bob Martin		|  ram@tellabs.com	...!uunet!tellab5!ram
Tellabs, Inc.		|   "Listen to me now, and believe me later"
Lisle, IL.  60532	|		-  Hans und Franz

hp48sx@wuarchive.wustl.edu (HP48SX Archive Maintainer) (10/05/90)

RFirst of all, There was a typing mistake in the problem, all I
wanted was the integral of exp(-.5*y^2), which is just the UTNP
upper tail normal distribution. 

You also wrote that you could not stop a running program, and that you
expected  ON+C would be the only way, and that it would clear the
memory. This is not hte case. All programs and variables will stay in
the machine, but I think that only the stack will be cleared. (and maybe
some of the undo stack/arg... too).


-- 
*******************************************************
Povl H. Pedersen             hp48sx@wuarchive.wustl.edu
HP48sx archive maintainer

TDSTRONG@MTUS5.BITNET (10/09/90)

Don't worry about internal programs not being terminated by ON.
The ON-C sequence executes a system halt but saves memory and flags.
Only the stack is cleared.

s37775d@taltta.hut.fi (Pandy (A. Holmberg)) (10/22/90)

From: Pandy Holmberg (pandy@otax.hut.fi)

Here is a handy program that makes it very easy to turn the sound on and off
on your hp28. It is called Beep? so you can store it under that name.
If you run it when the beeper is turned off, it turns the beeper on and
displays a message 'Beeper ON'. If you run it when the beeper is turned on
it turns it off and displays a similar message.
 
<<  RCLF
	# 1125899906842624d
	XOR STOF 51 FS? 1 ==
	R #### Beeper OFF ####S
	R  #### Beeper ON ####S
	IFTE 4 DISP 1 WAIT
	CLMF >>