# HP Forums

Full Version: hp48, factorization
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hi, I am studying electronic engineering and I would like to know why my hp 48gx cannot factorize this transfer function :

10^4*s^2/(s^4 + 100*sqrt(2)*s^3 + 2.01*10^4*s^2 + 10^8*sqrt(2)*s + 10^12)

I use both alg48 and erable and I don't know why it can't factorize

(sorry for my bad english :()

Thank you :)

According to Wolfram alpha, the denominator's roots are

s ~ -739.788 - 672.84i,
s ~ -739.788 + 672.84i,
s ~ 669.077 - 743.193i,
s ~ 669.077 + 743.193i,

Maxima didn't factor/gfactor the polynomial, too, but its solve function found the roots. Unfortunately the exact result is too long to post here. Not one of the roots would fit inside a hp48 lcd.

Has anyone an hp50g at hands to countercheck this, too?

Edited: 2 Mar 2010, 3:14 p.m.

Hi, when i factorize it with matlab, it returns :

10^4*s^2/((s^2 + 1480*s + 1e006) (s^2 - 1338*s + 1e006))

Thank you :)

Multiplying the factors from your solution shows, that
Matlab did not yield an exact solution, but an approximation:

```(s^2 + 1480*s + 1e006)(s^2 - 1338*s + 1e006) = s^4+142*s^3+19760*s^2+142000000*s+1000000000000 != s^4 + 100*sqrt(2)*s^3 + 2.01*10^4*s^2 + 10^8*sqrt(2)*s + 10^12
```

Hi, than I must conclude that alg48 or erable are not able to factorize because they both only factorize exact solution?

I didn't take the time to ask myself whether the zpk function in matlab gives the exact solution or an approximation O_o.

Thank you, I very appreciate your help :)

No, I don't think so. It should at least have found a numerical solution.

I just dug out my hp50g and I also found batteries for it. So I tried your polynomial. The 50g does factoring much similar to your Matlab solution, it yields a numerical solution.

It finds:

```(s^2 + 1473.5755*s + 1000000) * (s^2 - 1338.1541*s + 1000000)
```

I couldn't get it to perform further factoring, i. e. have it find the complex roots. That seems strange to me.

OK, I'm not an experienced hp50g user, coz I prefer my old 41, and do higher complexity stuff on a pc.

So I suppose it might be a RAM issue, AFAIK the 48gx has 128k, the 50g some more.

Probably Raymond reads this thread, he's a 48g(x) expert and he could know more about CAS and its limitations.

Edited: 2 Mar 2010, 7:53 p.m.

Derive isn't bad at it. For the denominator it returns

(s^2 + s·(10·sqrt(19849) + 50·sqrt(2)) + 1000000)·(s^2 + s·(50·sqrt(2) - 10·sqrt(19849)) + 1000000)

I pasted and entered the complete equation and used the menu to factor it.

Is Derive still maintained or (at least) available? I remember the early 80s, where it was en vogue due to its efficient implementation and low hardware requirements.

For the sake of completeness (and for trying out my brand new guest file account :-)) I'm posting the exact roots calculated by wxMaxima:

I still can't get my hp50g find these as a final result, but it works for 4th order equations with smaller coefficients ?!? What am I doing wrong??

Is Derive able to find these? If so, does it do by factoring commands, or do you have to solve for the zeroes of the original denominator polynomial (as wxMaxima does)?

Edit: %i = sqrt(-1) in Maxima notation

Edited: 3 Mar 2010, 4:19 p.m.

Hit right shift - solve
choose "Solve poly..." enter the coefficients: 1, 141.4214, 2.01*10^4, 1.414214*10^8, 10^12
Then hit "solve"

You'll get an array containing the following:
(-739.7877, -672.8403)
(-739.7877, 672.8403)
(669.0770, 743.1930)
(669.0770, -743.1930)

I got the same results for the denominator as Rainer did on both my 48G and 50G (with the 50G in approx mode). On the 48G I used the polynomial solver app...I did have to do a bit of juggling to get the coefficients into the solver in numerical form as follows: I put each coefficient onto the stack starting with the high order in level 5, and ending with the constant in level 1, making sure not to enter them as algebraic objects ('') so they would evaluate to real (approx) numbers. Then I entered 5 and executed ->ARRY, and ended up with the coefficient array in level 1. Then go to the solve poly app, and with the coefficient field selected, hit NEXT, and the CALC (softkey)...the array is waiting in level 1, so just hit OK to put the coefficients into the solver app. Then solve for the roots as normal. Hit SYMB softkey and return to the stack to see the roots in factor form. Works like a champ. I don't know why the 50G wouldn't factor it symbolically.

If it's any consolation, I tried symbolically factoring this on my Ti89 emulator, and it locked up..;0

Best regards, Hal

That's the denominator (as solved by several people from message 3 onwards), how would you include the numerator?

Also, as per the original request, how does one factorise it?

Edited: 4 Mar 2010, 5:55 a.m.

I think, Derive has been replaced by the Nspire PC software. It can't be ordered directly from TI.

Derive finds 4 solutions for denominator = 0:

I didn't double check my input.

Edited: 4 Mar 2010, 12:04 p.m.

"Also, as per the original request, how does one factorise it?"

On an out-of-the-box 48, you don't factorise it in one step. You'd have to write or find a program for it.

With a 50g the FACTOR function would give 10000*s*s/(s^2-1338.15*s+1000000)*(s^2+1479.58*s+1000000). Rainer and Sok-khieng Chum Hun found the same denominator; the numerator doesn't factor further.

In order to factor the denominator all the way to the complex roots you need to use the Poynomial solve the same as on the 48.

Once you have the complex roots on the 48, you can get the quadratic forms by subtracting each pair of roots from s, multiplying them, and executing EXPAND and COLLECT.

Edited: 4 Mar 2010, 8:20 p.m.

So now I learned: in order to get the complex roots I must use the "solve poly" function. Factorization seems to be restricted to real results.

Meanwhile I tried Steve's and your procedures on both my hp50g and on m48, an hp48 emulator on iphone, and bingo - I got the expected results.

Like you Hal, I don't know, why the 50g is not able to factorize symbolically. At least this thread has worked up my appetite for taking a closer look at the hp50g. If only the keyboard wouldn't be that (over)crowded, that's why I preferred using a pc for symbolic math and a hp41 as a calculator up to now. IMHO hp should have considered a double keyboard design for the hp50g as implemented in the hp28C/S. I guess that would have improved acceptance of this machine also among old-school calculator users like me.

Quote:
So now I learned: in order to get the complex roots I must use the "solve poly" function. Factorization seems to be restricted to real results.

Actually, I tried this again with my real 50G (I was using my emulator before), and this time when using the factor command, the calculator asked me if I wanted to switch to approx mode, to which I responded yes. The 50G then factored the denominator with the aforementioned approximate results. It also worked using the symbolic solve function as long as the calc was in approx mode.
(In case you may not be aware of it, you can quickly toggle between exact and approx modes by holding down right shift, and pressing ENTER)
Best regards, Hal