The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Symbolic limit of a function of 2 variables, HP49/50
Message #1 Posted by Gilles Carpentier on 26 Aug 2012, 10:28 a.m.

HI,

Here is a program for HP49/50 whch try to find the lim (X,Y)->(a,b) of a function of two variables. Just put your function on the stack (variables must be X,Y) , and the { a b } limit you search. You will see in return :

lim:number is the limit found by the program
lim: oo (infinite limit)
lim:? no limit found
lim: f(t) no limit, the function returned is the limit in function of t, the  angle of approach.
Must be in RPN and exact mode. Be careful about X Y r t not define as global variables. If you try it, you will see  some limitations but in most cases it works fine.

« {'X' 'Y'} DUP ROT ADD = + « SUBST » STREAM DUP 'X=0' SUBST 'Y=0' SUBST IF EVAL DUP '?' SAME THEN DROP 'X=r*COS(t)' SUBST 'Y=r*SIN(t)' SUBST SIMPLIFY IFERR 'r=0+0' lim THEN DROP2 '?' END ELSE NIP END SIMPLIFY 'Lim' ->TAG » 'LimXY' STO

For example :

'3*X^2*Y/(X^2+Y^2)' { 0 0 } LimXY. Here you get : lim:0

'(X^2-Y^2)/(X^2+Y^2)' {0 0} Lim: '-(2*SIN(t)^2-1) that means no limit (as the limit depands of the angle to approach the point). You can modifiy this if you prefer with '?' and no detail

'X*SIN((X+Y)/4)' { 'PI' 'PI' } Lim:PI

'LOG(X+e^Y)/Sqrt(X^2+Y^2)' { 1 0 } Lim:LOG(2)

'LN(X+Y)/(X^2+2*X*Y+Y^2-1)' { 1 0 } Lim:1/2

'(X^2*Y^5)/(X^4+X^2*Y^2+Y^4)' {0 0} Lim : 0

'8*(X^2*Y^2)/(X^4+Y^4)' {0 0} Lim: '-((8*SIN(t)^4-8*SIN(t)^2)/(2*SIN(t)^4-2*SIN(t)^2+1))' @ Mean the limit does not exist

SIN(X+Y)/(X+Y) { 0 0 } Lim: 1

' (X^2+Y^2-2*X-2*Y)/(X^2+Y^2-2*X+2*Y+2)' { 1 -1 } Lim: oo (infinty)

' (X^3+X*Y^2)/(X^2+Y^2)' { 0 0 } Lim : 0

etc.

Edited: 26 Aug 2012, 10:34 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall