The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

49g+ Cube roots
Message #1 Posted by Kellie on 24 Feb 2004, 10:07 p.m.

I just recently purchased a 49g+, and am trying to graph a cube root function. I am only able to generate the portion of the graph with y values greater than 0. Is there a way to get the other half of the graph as well?

      
Re: 49g+ Cube roots
Message #2 Posted by andy on 24 Feb 2004, 10:20 p.m.,
in response to message #1 by Kellie

1. Go to the "plot window" screen (press and hold left-shift and press F2).

2. Check the value for "Indep Low". I think it defaults to zero. If you change it to a number less then zero then the 49g+ will graph from that number to whatever you have the "Indep High" value set to.

      
Re: 49g+ Cube roots
Message #3 Posted by Dave Shaffer on 25 Feb 2004, 12:07 p.m.,
in response to message #1 by Kellie

I suspect you've run into the "what is the cube root of a negative number" problem.

For positive numbers, the cube root (one of them) is a positive number, too. These are the positive (i.e. y>0) values that you can plot now.

For negative numbers, in most cases (except for numbers which are a perfect cube of some other negative number, such as -8 = -2^3) the cube root will be a complex number: cube root of -4 = 0.794 + 1.37i (as my '42S just gave me). I don't know for sure (I don't have one), but I'll bet that the 49g+ doesn't know what to do when it tries to plot that complex number - so it just gives up.

            
Re: 49g+ Cube roots
Message #4 Posted by R Lion on 25 Feb 2004, 12:52 p.m.,
in response to message #3 by Dave Shaffer

Not exactly: Any number has three complex roots (one of them is real) Try how -1,58740105197 is a cubic root of -4...

The next 65 bytes program is xROOTy command for the 42s:

LBL "xROOTy"
EXITALL
ROLLUP
STO "A"
ROLLUP
STO "B"
ROLLDOWN
ROLLDOWN
ENTER
ENTER
2
MOD
X=0?
GTO B
CLx
+
X<>Y
SIGN
LASTx
ABS
RCL ST Z
GTO A
LBL B
CLx
1
STO ST T
ROLLDOWN
LBL A
1/X
Y^X
*
RCL "B"
STO ST Z
CLx
+ RCL "A"
STO ST T
ROLLDOWN
END

Sure it is not a good program from the programmer point of view, but it does the work... Please: post if you don't get the expected results to correct the prg

                  
Re: 49g+ Cube roots
Message #5 Posted by bill platt on 25 Feb 2004, 12:59 p.m.,
in response to message #4 by R Lion

Hi Raul!

I want to try this in a not 42s. Could you tell me what the "MOD" command is so that I might find an equivalent on a 15 or 32 or some other?

Best regards,

Bill Platt

plattdesign dot net

                        
Re: 49g+ Cube roots
Message #6 Posted by Valentin Albillo on 25 Feb 2004, 1:23 p.m.,
in response to message #5 by bill platt

Hi Bill:

Bill posted: "Could you tell me what the "MOD" command is so that I might find an equivalent on a 15 or 32 or some other?"

You can use this expression to evaluate the MOD command, coded in your favorite programming language:

     X MOD Y  =  X - Y*INT(X/Y)

so, for instance:

     8 MOD 3 = 8 - 3*INT(8/3) = 8 - 3*INT(2.666+) = 8-3*2 = 2

Best regards from V.

                              
Thanks V. , R.L. :^) (nt)
Message #7 Posted by bill platt on 26 Feb 2004, 5:01 p.m.,
in response to message #6 by Valentin Albillo

.

                        
Valentín answered ;-) (nt)
Message #8 Posted by R Lion on 25 Feb 2004, 1:30 p.m.,
in response to message #5 by bill platt

                  
Re: 49g+ Cube roots - OOOOOPS
Message #9 Posted by Dave Shaffer on 25 Feb 2004, 1:40 p.m.,
in response to message #4 by R Lion

You are, of course, correct:

"Any number has three complex roots (one of them is real)"

(Although this should actually be "Any number has three complex [CUBE] roots (one of them is real)")

I realized this about an hour after I posted. I fixated on the complex root which the 42S gave me - which I obtained by taking -4 to the 1/3 power. When I use the "x-th root of y" button to take the cube root on my 32SII, it gives me the -1.587 answer.

Thus, Kellie's problem may or may not relate to how she is taking the cube root. Which of these modes does the 49g+ use?

                        
Re: 49g+ Cube roots - OOOOOPS
Message #10 Posted by R Lion on 25 Feb 2004, 1:51 p.m.,
in response to message #9 by Dave Shaffer

Quote:
(Although this should actually be "Any number has three complex [CUBE] roots (one of them is real)")
You are, of course, correct ;-)

About Kellie's problem... in my 48GX I get the correct graphic when I use cubic root, but only what Kellie says if I use x^(1/3)

Raul L

                        
Re: 49g+ Cube roots - OOOOOPS
Message #11 Posted by Andrés C. Rodríguez (Argentina) on 25 Feb 2004, 5:38 p.m.,
in response to message #9 by Dave Shaffer

Recently some of us had a thread on this matter (near the end of January), and we concluded that the 32 SII function "x root of y" answers with the real root (for instance: -2 as the cubic root of -8), while the "x to the 1/3 power" approach (as in the HP42S) answers with the so-called "primary" root, which is the one in the first quadrant of the complex plane.

                        
Re: 49g+ Cube roots - OOOOOPS
Message #12 Posted by Ernie Malaga on 25 Feb 2004, 10:01 p.m.,
in response to message #9 by Dave Shaffer

[quote/ (Although this should actually be "Any number has three complex [CUBE] roots (one of them is real)")[/quote]

Actually, that's not precise either, Dave. Any _real_ number will have one real cube root. But cube roots of complex numbers (a+bi, where a<>0 and b<>0) are unlikely to be real.

Forgive me if you already know this, but there's a picture that helps remember this. Think of the Mercedes Benz symbol -- the points are at 120-degree intervals. Same with all 3 cube roots of a number.

-Ernie

                              
Re: 49g+ Cube roots - OOOOOPS
Message #13 Posted by Dave Shaffer on 26 Feb 2004, 12:40 a.m.,
in response to message #12 by Ernie Malaga

Ernie,

I think you're wrong. There really are three cube roots for all numbers - even real ones.

For sure, for negative, real numbers, (such as -2, -3, -4, etc.), there are the regular cube root (i.e. the same cube root as for the equivalent positive number, but with a minus sign in front) as well as those roots rotated by +/-120 degrees in the complex plane. (The Mercedes symbol has to be rotated by -90 degrees for positive numbers, and +90 degrees for negative numbers, where + implies counterclockwise rotation. The "simple" (non-imaginary) root lies along the +x axis for positive numbers and along the -x axis for negative numbers.)

For example: the cube root of +4 returned by the 42S is 1.5874 (using the y^x button, with y=4 and x=1/3), i.e. along the +x (positive real numbers) axis. However, the complex roots -0.794-1.37i and -0.794+1.37i also give +4 when cubed (neglecting round-off, of course).

Conversely, the cube root of -4 determined by the same set of button pushings gives +0.794+1.37i with the 42S. But, -1.5874^3 = -4, as does (0.794-1.37i)^3 . (Again, to within round-off)

Similar results hold for any positive or negative (real; i.e. non-imaginary) number. Thus, Raul had it right (with my minor correction).

The extension to any power is that there are n values for the n-th root, arranged as a Mercedes star with n points equally spaced in angle in the complex plane, with one point aligned with the +x (real) axis for positive numbers, and one point aligned with the -x (also real) axis for negative numbers.

I leave complex values for our mathematician friends, with the expectation that one of the star points of the root system will be either aligned or anti-aligned with the original complex number.

PS send me an e-mail direct

                                    
Cube roots -- clarification
Message #14 Posted by Ernie Malaga on 26 Feb 2004, 3:05 a.m.,
in response to message #13 by Dave Shaffer

Thanks for your reply, Dave.

Here's the original wording:

Quote:
(Although this should actually be "Any number has three complex [CUBE] roots (one of them is real)")

It has two parts. First "any number has 3 complex cube roots," with which I have no problem at all. The second part is "(one of them is real)" is the one I objected to. It should have been "one of them _may be_ real". Or change the first part to further qualify the second: "Any _real_ number has 3 complex cube roots (one of them is real)."

Sorry I didn't make my meaning clear.

-Ernie

      
Re: 49g+ Cube roots
Message #15 Posted by Eddie Shore on 25 Feb 2004, 4:29 p.m.,
in response to message #1 by Kellie

You might want to turn the Complex mode off in the CAS MODES menu.

            
Re: 49g+ Cube roots
Message #16 Posted by Kellie on 26 Feb 2004, 8:04 p.m.,
in response to message #15 by Eddie Shore

Thanks to everyone that responded to my question, I just recently switched to an HP calculator, and am still getting used to everything, all of the help was greatly appreciated!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall