






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The fortran code for calculating the exact solution of a given function using an iterative method. The function is defined by the variables a, b, h, alpha, beta, and involves trigonometric functions and arithmetic operations. The code initializes the variables, calculates the constants k11 to k42 and u1, u2, v1, v2 using the given formula, and then iteratively calculates wi for each value of i from 0 to n. The final output displays the values of wi. This code can be useful for students and researchers in the field of numerical analysis, computer science, and engineering, as it demonstrates the implementation of a common numerical method for solving mathematical functions.
Typology: Exercises
1 / 12
This page cannot be seen from the preview
Don't miss anything!







dK11 = H * V WRITE(,) 'dK11 = ', dK dK12 = H((-2.0/X)V2+(2.0/(X * X))V1) WRITE(,) 'dK12 = ', dK dK21 = H * (V2 + (1.0/2.0) * dK12) WRITE(,) 'dK21 = ', dK dK22 = H((-2/(X+(H/2.0)))(V2+(dK12/2)) + ((2/(X+(H/2.0))2) $ (V1+(dK11/2)))) WRITE(,)'dK22 = ',dK dK31 = H * (V2 + (dK22/2.0)) WRITE(,) 'dK31 = ', dK dK32 = H((-2/(X+(H/2.0)))(V2+(dK22/2)) + ((2/(X+(H/2.0))**2)
$ (V1+(dK21/2)))) WRITE(,) 'dK32 = ',dK dK41 = H * (V2 + dK32) WRITE(,) 'dK41 = ',dK WRITE(,)'V1ARR(0) ', V1ARR(1) dK42 = H(((-2/(X+H))(V2+dK32)) + ((2/(X+H)2) $ (V1+dK31))) WRITE(,) 'dK42 = ',dK V1 = V1 + (1/6.0)(dK11 + 2dK21 + 2dK31 + dK41) WRITE(,)'V1 = ', V V2 = V2 + (1/6.0)(dK12 + 2dK22 + 2dK32 + dK42) WRITE(,)'V2 = ', V V1ARR(I) = V ENDDO W10 = ALPHA W20 = (BETA - U1) / V WRITE(,)'W20 ', W DO I=0, N- W1 = U1ARR(I) + W20 * V1ARR(I) WRITE(,)'Wi =', W ENDDO END