Post Reply 
(11C) CUBIC EQUATION
06-10-2018, 07:15 AM (This post was last modified: 06-10-2018 09:54 AM by Dieter.)
Post: #10
RE: (11C) CUBIC EQUATION
(06-09-2018 10:34 PM)Valentin Albillo Wrote:  Most probably some sort of discriminant, either of the original cubic, some reduced cubic (if that's how he's computing the root, I didn't read the code) or of the quadratic after deflation. If it is >=0 the remaining two roots are real, else they are complex.

So it can't be the discriminant of the original cubic equation (here D<0 means three real roots). But it looks like it's indeed some discriminant of a reduced quadratic.

(06-10-2018 02:42 AM)Gamo Wrote:  Updated the instruction and usage.

We're not finished yet. ;-)

The instructions say
"[C] ---> Complex Roots // [X<>Y] (u in Y) and (v in X) "

What is u, what is v? I guess these are the real and imaginary parts of the solution. But which is which? Gamo, nobody can know what you mean by "u" or "v". It is not even clear if after the [R/S] the real or imaginary part is displayed !

So it should better read:

[C] ---> Complex Roots
The imaginary part of the two complex conjugate roots is displayed.
Press [X<>Y] to see the real part.

Or vice versa – don't know which is which. ;-)

But now for the most important part: I still think the program is not correct !
After LBL 1 the content of R4 is added in the calculation. But R4 has no defined value at this point. There is nothing that has been stored there before. Gamo, please check the program again. Take a look at the original listing in the 29C Applications Book. The program does not work for me. The results of your examples only appear if I store –7 in R4 (first example) or –8 (second example). There must be some code missing. Maybe you can show the original 29C program?

Try it yourself: clear the program in your 11C and re-enter it using the listing you posted here. Then try the examples.

By the way, you may adjust the program so that it automatically continues with C if the discriminant is < 0. I understand the code correctly it could be done this way:

Code:
...
LBL 3
RCL 5
R/S      <=== this R/S may be removed
x<0?
GTO C
...
LBL C
CHS
SQRT
PSE
X<>Y
RTN

The added modification at LBL C would show the imaginary part (PAUSE) and then the real part of the complex solution.

Now both the three real solutions as well as the real + complex ones are displayed without the user having to press additional keys. So the R/S that follows LBL 1 (which shows the discriminant) can/should be removed. Simply press [B] to get the first root, then once or twice [R/S] for the others. The user directly realizes whether it's two real or one conjugate complex solution because the latter is displayed with a PSE instruction.

Or simply try the direct solution program I suggested. This runs in a few seconds. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) CUBIC EQUATION - Gamo - 06-09-2018, 11:49 AM
RE: (11C) CUBIC EQUATION - Gamo - 06-09-2018, 12:34 PM
RE: (11C) CUBIC EQUATION - Dieter - 06-09-2018, 12:54 PM
RE: (11C) CUBIC EQUATION - rprosperi - 06-09-2018, 01:00 PM
RE: (11C) CUBIC EQUATION - Dieter - 06-09-2018, 06:05 PM
RE: (11C) CUBIC EQUATION - Dieter - 06-09-2018, 07:50 PM
RE: (11C) CUBIC EQUATION - Dieter - 06-10-2018 07:15 AM
RE: (11C) CUBIC EQUATION - Dieter - 06-10-2018, 09:17 PM
RE: (11C) CUBIC EQUATION - Albert Chan - 07-20-2021, 10:12 PM
RE: (11C) CUBIC EQUATION - Gamo - 06-10-2018, 02:42 AM
RE: (11C) CUBIC EQUATION - Gamo - 06-10-2018, 02:36 PM
RE: (11C) CUBIC EQUATION - Dieter - 06-10-2018, 03:34 PM
RE: (11C) CUBIC EQUATION - Dieter - 06-10-2018, 09:35 PM
RE: (11C) CUBIC EQUATION - Gamo - 06-11-2018, 02:16 AM
RE: (11C) CUBIC EQUATION - Dieter - 06-11-2018, 07:04 AM
RE: (11C) CUBIC EQUATION - Gamo - 06-11-2018, 08:19 AM
RE: (11C) CUBIC EQUATION - Dieter - 06-11-2018, 08:19 PM
RE: (11C) CUBIC EQUATION - Gamo - 06-12-2018, 07:02 AM



User(s) browsing this thread: 2 Guest(s)