Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please answer the question as soon as possible i need this is 12 hours a working fortran code is required Given below is a 2D

please answer the question as soon as possible i need this is 12 hours image text in transcribed
image text in transcribed
a working fortran code is required
Given below is a 2D Finite Difference programme to solve the simple 55 plate Laplace example covered in the lecture note. There are some deliberate blunders in the code. The first task is to create a new workspace, insert this code and then debug it and run it You do not need to submit this code. Before proceeding make sure you understand exactly what this code does and that it matches the example in the notes. Then proceed to section 2. !!!!!!Start of Code!!!!!! program fd1 real - temp(5.4), tolerance = 1.02-06, answer. change integer :ij I Izero all TEMPS temp = 0. I set up initial values at boundaries temp(1,:) = 300. I top row temp(5.:) = 400. I bottom row temp(2,1)=425.; temp(2,5) = 325. temp(3.1) = 500.; temp(3,5) = 350. temp(4,1)= 1450.; temp(4,5) = 375. ! iteration loop over 2D i&i 1 change = 0. do i= 2,4,5 doj= 2,4 ! central difference answer = (temp(i-1j) - temp(i+1+ temp(ij-1) + tempij+1))/ 4. ! keep the maximum nodal change change = max (change, abs(temp(1.j)-answer)) temp(ij) = answer end do end do end do check if converged, i.e. maximum change at any node is less than tolerance if (change > tolrance) goto 1 ! open a file for results open(2, file = 'results.dat') rewind(2) do i= 1,5,1 write(6,3) (temp(ij).j=1,5) !write out temperature field to screen write(2,3) (temp(ij), j=1,5) !write out temperature field to file called 'results.dat 3 format(5(e12.6,1x)) I end do close(2) pause end program fd !!!!!!!!End of Code!!!!!!!!!! Correct temperature values are written below (don't spend too much time trying to get correct result but make sure the code is error free and running) 300.0000 300.0000 300.0000 300.0000 300.0000 400.0000 364.5089 343.7500 332.3661 325.0000 500.0000 414.2857 378.1250 360.7143 350.0000 450.0000 414.5089393.7500 382.3661 375.0000 400.0000 400.0000 400.0000 400.0000 400.0000 Given below is a 2D Finite Difference programme to solve the simple 55 plate Laplace example covered in the lecture note. There are some deliberate blunders in the code. The first task is to create a new workspace, insert this code and then debug it and run it You do not need to submit this code. Before proceeding make sure you understand exactly what this code does and that it matches the example in the notes. Then proceed to section 2. !!!!!!Start of Code!!!!!! program fd1 real - temp(5.4), tolerance = 1.02-06, answer. change integer :ij I Izero all TEMPS temp = 0. I set up initial values at boundaries temp(1,:) = 300. I top row temp(5.:) = 400. I bottom row temp(2,1)=425.; temp(2,5) = 325. temp(3.1) = 500.; temp(3,5) = 350. temp(4,1)= 1450.; temp(4,5) = 375. ! iteration loop over 2D i&i 1 change = 0. do i= 2,4,5 doj= 2,4 ! central difference answer = (temp(i-1j) - temp(i+1+ temp(ij-1) + tempij+1))/ 4. ! keep the maximum nodal change change = max (change, abs(temp(1.j)-answer)) temp(ij) = answer end do end do end do check if converged, i.e. maximum change at any node is less than tolerance if (change > tolrance) goto 1 ! open a file for results open(2, file = 'results.dat') rewind(2) do i= 1,5,1 write(6,3) (temp(ij).j=1,5) !write out temperature field to screen write(2,3) (temp(ij), j=1,5) !write out temperature field to file called 'results.dat 3 format(5(e12.6,1x)) I end do close(2) pause end program fd !!!!!!!!End of Code!!!!!!!!!! Correct temperature values are written below (don't spend too much time trying to get correct result but make sure the code is error free and running) 300.0000 300.0000 300.0000 300.0000 300.0000 400.0000 364.5089 343.7500 332.3661 325.0000 500.0000 414.2857 378.1250 360.7143 350.0000 450.0000 414.5089393.7500 382.3661 375.0000 400.0000 400.0000 400.0000 400.0000 400.0000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago