Some simple programs in Fortran 90 for first stage of Physics Department, in College of Science, at University of Sulaim...
Description
Kurdistan Iraqi Region Ministry of Higher Education University of Sulaimani College of Science Physics Department
First step to Computer Programming With FORTRAN 90 First stage Dr. Dlear R. Saber Dr. Omed Gh. Abdullah Mr. Ary A. Abdulrahman Mr. Shaho Osman
2009 - 2010
Problem (1): Write a Fortran program to calculate the value of function 𝒇𝒇(𝒙𝒙); where x= [-5, 0, 5]: (𝐱𝐱 > 0) 𝐭𝐭𝐭𝐭𝐭𝐭−𝟏𝟏 (𝐱𝐱) + 𝐞𝐞𝐱𝐱 (𝐱𝐱 = 𝟎𝟎) 𝐟𝐟(𝐱𝐱) = � 𝟎𝟎 Solution: read*, x if(x>0) then y=Atan(x) +exp(x) print*, x, y elseif(x0) goto 50 z=(x+y)**3/(x+z) w=x**2+2*z goto 70 50 z=abs (x)+(x+y) w=z/abs(x+z) 70 print*, z,w read*, choice if (choice==0) exit enddo end
Problem (3): Write a Fortran program to calculate exponential of (1) from library function (𝑬𝑬𝑬𝑬𝑬𝑬) and from the following series up to (15): 𝐱𝐱 𝟐𝟐 𝐱𝐱 𝟑𝟑 𝐱𝐱 𝟒𝟒 𝐱𝐱 𝐞𝐞 = 𝟏𝟏 + 𝐱𝐱 + + + + ⋯ 𝟐𝟐! 𝟑𝟑! 𝟒𝟒! Solution: x=1 s=1 do i=1,15 f=1 do j=1,i f=f*j enddo s=s+x**i/f enddo print*,s,exp(x) end ################################################################################# Problem (4): Write a Fortran program to calculate exponential of (1) from library function (𝑬𝑬𝑬𝑬𝑬𝑬) and from the following series up to (15), [without using do-loops]: 𝐱𝐱 𝟐𝟐 𝐱𝐱 𝟑𝟑 𝐱𝐱 𝟒𝟒 𝐞𝐞𝐱𝐱 = 𝟏𝟏 + 𝐱𝐱 + + + + ⋯ 𝟐𝟐! 𝟑𝟑! 𝟒𝟒! Solution: x=1 b=1 n=0 s=1 10 n=n+1 if (n
Thank you for interesting in our services. We are a non-profit group that run this website to share documents. We need your help to maintenance this website.