Hello all 33s enthusiasts and NOTenthusiasts:
I have tested the 33s Solver, and found some significant differences in behavior as compared to the 32sii.
As you will recall, the 32sii allows you to use the solver in five (5) different ways:
1. Equation List
2. Manually define a Program (Fn=) and Solve it
3. Write a program which sets Fn= and then solves for the
unkown variable in the subroutine called by Fn=.
4. Write a program using an Equation, and do as with (2) above (set Fn= from the keyboard and solve for the variable.
5. Do what (3) does, except that the subroutine has an equation.
In any case, if you use any of these five approaches, you will get exactly the same results (as documented):
Z register = last value of the function
y register = penultimate iteration for vairable to be solved
x register = ultimate iteration for solved variable,and of course the variable itself will have the new value.
(Undocumented):
t register = penultimate value of the function (??)
With the 33s, depending on which approach you take (equation list, RPN program, ALG program, Solve manually or with automatic subroutine, equation in program et) there are differences in the results or presentation of the reuslts.
Further, because of the ALG aspect, you now have ten (10) fundamentally different ways:
1. equation list, run with RPN interface
2. equation list, run with ALG interface
3. RPN program
4. ALG program
5. Automatic with RPN program
6. Automatic with ALG program
7. Program with an equation, Run with RPN interface
8. Program with an equation, run with ALG interface
9. Automatic Program with equation subroutine, RPN interface
10. Automatic Program with equation subroutine, ALG interface.Note that a Automatic control program for solving is inherently RPN/ALG "gender" neutral:
LBL J
Fn=F
Solve X
RTN
And a subroutine using an equation (expression) is also inherently gender neutral:
LBL F
SF 11
(eqn) x / (sq(x)-6)-1
RTN
Perhaps you might also add "using the RPN interface to run an ALG program" and "using the ALG interface to run an RPN program' which would add another four (4) flavours to versions 3 through 6 above---but let's ignore that for now!!!!
I tested the behavior by doing a "matrix" of programs for the "pole" example in the manual (repeated above in LBL J) and also using a simple polynomial with a real root: y^3-y^2+6
To sum up the results:
If you solve with an equation list, you will fill the stack
and the ALGstack with the best estimates for the solution,
and the final value of the function--regardless of whether
"no root found" or a root is found.If you use a program (with and equation in it or not) and you fail to find a root, then the stack and the ALG stack
will not be filled with estimates.Where solutions/estimates are written to the stack, the
ALGstack will also be written to--and note that the ALGstack
will be available, undisturbed, until the next SOLVE
invocation---therefore--you have four extra registers to
use in the 33s! This can be very handy!
So, here are some results:
If you solve the "pole" example as I mentioned above, here is what happens:
1. (equation list) RPN input.
2.3 STO x
2.7
{go to EQUATION in the Equation List}
Solve XT --- x1
z 81,649,658,092 x2
y 2.44948974278 x3
x 2.44948974279 x4"No Root Found"
hit backarrow to clear message and you see the stack as
noted above.PLEASE NOTE that the ALG "stack" is also filled as noted above.
The only difference, if you run it in ALG, is that there is
no RPN stack--you see only the final result after
back-arrowing, and there is the x1 x2 x3 x4 ALGstack too.Of course, the variable X also contains the "answer".
If you chhose th use a program, it is very different!
LBL E
RPN
RCL X
ENTER
ENTER
X62
6
-
/
1
-
RTN.Manually select this function, and tehn solve X, all in
RPN, and you get this:
2.3 STO x ;put in your estimates
2.7 ;put in your estimates
FN = E ;define function
Solve x ;call solve
"no root found"
backarorrow to see stack:t 2.3
z 2.3 And no results at all to ALGstack!
y 2.3
x 2.7The "correct iterative answer" is stored in X: 2.44948974279
Similar results are obtained running in ALG--except you don't see the stack.
Exactly teh same also if you have an ALG program and do above:
LBL A
ALG
RCL x
/
(
RCL X
x^2
-
6
)
-
1
ENTER
RTNNow, try using an automation step with the RPN version:
LBL D
Fn=E
Solve X
RTN
LBL E
RPN
RCL X
ENTER
ENTER
X62
6
-
/
1
-
RTN.In RPN:
2.3 STO x
2.7
XEQ DT 2.44948974279 ;{last iteration}
Z 2.44948974279 ;{last iteration}
Y 2.44948974279 ;{last iteration}
X 81649658092 ;{function value at last iteration}Note that the "Do if True" rule caused the "no root found"
event to roll directly into evaluating the routine at the
last estimated x-value. Of course, you could code it
to say "no root found" and stop, or try again etc.Now, finally, try this automated business with a program
sequence which uses an "Equation"
(use LBL J and LBL F above, with F immediately following J)2.3 STO x
2.7
XEQ J"X?
2.44948974279"
press R/ST 2.7
Z 2.7 No values to the ALG stack
Y 2.44948974279
X 81,649,658,092Note that flag 11 makes the equation prompt for the variable--when we skip the RTN and go onto evaluating the
subroutine.
On another day, I will post the reesults of running a matrix on a "solvable" polynomial---essentally the same as 32sii--except that the T register carries your last input estimate---rahter than as with the 32sii--which carries the penultimate function value in the T register).
Have fun.
Best regards,
Bill
Edited: 27 July 2004, 10:03 a.m. after one or more responses were posted