Advertisement
Guest User

Newton

a guest
Dec 18th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. :ClrHome // this clears the screen of anything that you may have typed in before executing (PRGM, RIGHT, 8)
  2. :Input "Y1 = ",Str1 // We display "Y1 = " on to the screen. Whatever the user enters is stored into Str1
  3. :Str1→Y1 // Store Str1 to Y1. ENSURE YOU USE Y-VARS FROM THE VARIABLES SCREEN
  4. :Input "Guess = ",X
  5. :Input "Iters = ",B // Iters means iterations, or how many times to find another approximate
  6. :DelVar L1 // PRESS (2ND 1) TO GET THE L1 VARIABLE! This just deletes L1.
  7. :B→dim(L1) // This creates a new L1 with size B. It can hold B amount of items. B is set to whatever the user inputted in line 5.
  8. :X→L1(1) // We store the guess X into the first place of the list.
  9. :For(A,1,B-1) // For loops run a section of code n times. The A is our counter. 1 means we start at the number one. B-1 ("b minus one") means we stop once we get to the number of iterations, minus 1 (the first one is done, it's the guess)
  10. :L1(A)-(Y1(L1(A))/nDeriv(Y1,X,L1(A+1))→L1(A+1) // This is tricky. Here we take the Ath place at L1 and subtract Y1 at the Ath place of L1 divided by the derivative of Y1 with variable X at X = L1 at the A+1st place.
  11. :Disp L1(A+1) // Display the A+1st place of the list L1.
  12. :End // End the for loop
  13. :Pause // Wait for the user to press ENTER before exiting.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement