Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // jacobi
- start
- Arrange given system of linear equations in diagonally dominant form
- Read toerable error (e)
- Convert the first equations in terms of first variable,second equation in terms of second variable and so second
- Set initial guesses for x0,y0,z0 and so on
- Substitue value of x0,y0,zo... from step 5 in equation obtainded in step 4 to calculate new values x1,y1,z1 and so on
- if |x0 - x1 | > e an |y0 -y1 |>e and |z0 - z1| > e and so on then goto step 9
- print the value of x1,y1,z1 and so on
- stop
- // Gauss Seidall
- start
- Arrange given system of linear equations in diagonally dominant form
- Read toerable error (e)
- Convert the first equations in terms of first variable,second equation in terms of second variable and so second
- Set initial guesses for x0,y0,z0 and so on
- Substitute value of y0,z0 .. from step in first equation obtained from step 4 to calculate new value of x1. Use x1,z0,.. in second equation obtained from step 4 to calculate new value of y1. Similarly . use x1,y1.. to find new z1 and so on
- if |x0 - x1 | > e an |y0 -y1 |>e and |z0 - z1| > e and so on then goto step 9
- print the value of x1,y1,z1 and so on
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement