To guarantee that your user doesn't encounter such an error, create a routine that uses Newton's method to perform the same function as the "solve(" command, except with safeguards for bad guesses.
Here's a routine that, given an equation (in terms of X) stored to Y1, and a guess stored to "G", will solve for "X" when the equation in Y1 = 0. Essentially, it does the same thing as "solve(Y1,X,G"
:DelVar R
:G
:Repeat Ans=X and R
:Ans→X
:R+1→R
:nDeriv(Y1,X,X
:If Ans
:X-Y1/Ans
:If R>50
:X
:End
:Ans→X
:If not(Y1
:X
No comments:
Post a Comment