Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a fortran program 5. The digamma function (z), defined for real or complex 2, can be calculated as where is the Euler Mascheroni constant,

Write a fortran program image text in transcribed
5. The digamma function (z), defined for real or complex 2, can be calculated as where is the Euler Mascheroni constant, -0.577215664901533. Write a Fortran function my.psi that accepts a real number as input, and approximates the digamma function o(z) using the sunu nation above. The summation should continue until the difference between two consecutive terms in the series e. the estimates for two successive values of n s less than or equal to 10-. The function my.psi should return the value of n required for this agreement, as well as the approximation (s). Write a Fortran program digamma.f95 that asks the user to input a real number x and a positive integer N. The progran should create an array z, with N elements, containing the values zi-ih, 1.2, . . . N with h 4max/ N. For each i, the program should call my psi to calculate the values (%) and store these in another array p, also with N elements. It should also save the value of n needed in each case, to a third array np, also with N elements. The elements of the arrays z, p and np should be written to the screen as N rows, with the i-th row displaying the i-th elements of the three arrays (and no other text) should be written as a normal decimal with five decimal places, (s) in scientific (exponential) format with ten digits of precision, and n as an integer 10 characters wide. The same output should also be written to a file digamma.tat Submit a listing of digamma f95, including a note of the finale of the output (i.e. the output for 3x-tmax) for the case zmax = 5, N = 10. 5. The digamma function (z), defined for real or complex 2, can be calculated as where is the Euler Mascheroni constant, -0.577215664901533. Write a Fortran function my.psi that accepts a real number as input, and approximates the digamma function o(z) using the sunu nation above. The summation should continue until the difference between two consecutive terms in the series e. the estimates for two successive values of n s less than or equal to 10-. The function my.psi should return the value of n required for this agreement, as well as the approximation (s). Write a Fortran program digamma.f95 that asks the user to input a real number x and a positive integer N. The progran should create an array z, with N elements, containing the values zi-ih, 1.2, . . . N with h 4max/ N. For each i, the program should call my psi to calculate the values (%) and store these in another array p, also with N elements. It should also save the value of n needed in each case, to a third array np, also with N elements. The elements of the arrays z, p and np should be written to the screen as N rows, with the i-th row displaying the i-th elements of the three arrays (and no other text) should be written as a normal decimal with five decimal places, (s) in scientific (exponential) format with ten digits of precision, and n as an integer 10 characters wide. The same output should also be written to a file digamma.tat Submit a listing of digamma f95, including a note of the finale of the output (i.e. the output for 3x-tmax) for the case zmax = 5, N = 10

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

1. Outline the listening process and styles of listening

Answered: 1 week ago

Question

4. Explain key barriers to competent intercultural communication

Answered: 1 week ago