Jump to content



Photo
- - - - -

Numerical Methods Programs

numerical methods table list

  • Please log in to reply
1 reply to this topic

#1 DHeart

DHeart

    Newbie

  • Members
  • Pip
  • 2 posts
  • Gender:Male

  • Calculators:
    FX-CP400 (Classpad 2)
    Classpad 300

Posted 17 September 2015 - 08:06 PM

Hi!

I'm trying to write some programs for my Numerical Methods class, so I'm starting with the Bissection Method, in Root Aproximation.

 

Code:

ClrText
Input a,"enter initial estimate"
Input b,"enter final estimate"
Input n,"enter number of iterations"
InputFunc f(x),"enter the function"
1 -> i
While i <= n
Print a
Print b
(a+b)/2 -> x
Print x
If f(a)*f(x) <= 0
Then
Print abs(x-b)
x -> b
ElseIf f(a)*f(x) >= 0
Then
Print abs(x-a)
x -> a
IfEnd
i+1 -> i
WhileEnd    

What I would like to do, is to display it on a table or list.

If the number of iterations are greater than 5, I only see the last 6 on the display window.

Can anyone help me?

Thanks in advance!

 

 

 

 

 

 

 

 



#2 slugrustle

slugrustle

    Newbie

  • Members
  • Pip
  • 8 posts
  • Gender:Not Telling

  • Calculators:
    fx-5800P
    fx-9860GII SD

Posted 24 November 2018 - 07:02 PM

I think the easiest thing would be to pause at the end of each iteration so you can see what happened.

 

To answer the question you actually asked, on fx-5800P (I don't have a classpad), I can save data to the statistics list from a program. In your case, place each line below at the right spot inside your While loop. 4×(i−1)+1➔j should go right after the While i≤n statement, and each store to the statistics list replaces one of your print statements.

4×(i−1)+1➔j
a➔List X[j]
b➔List X[j+1]
x➔List X[j+2]
abs(x-b)➔List X[j+3]
abs(x-a)➔List X[j+3]

abs(x-b) and abs(x-a) both store to the j+3 index of List X because only one of these is stored each iteration.

 

Finally, it would be functionally equivalent to replace

ElseIf f(a)*f(x) ≥ 0
Then

with

Else

in your program.

 

It is nice to see people interested in numerical methods.


Edited by slugrustle, 24 November 2018 - 07:03 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users