3 Replies - 1032 Views - Last Post: 30 October 2012 - 06:59 PM Rate Topic: -----

#1 jhosamelly  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 30-October 12

Help in programming using Fortran 90 for Computational Physics.

Posted 30 October 2012 - 05:56 PM

Well, our professor in Computational Physics asked us to make a program for interpolation and differentiation.

Its on this link: (Chapter 4 and 5 only)
http://ww2.odu.edu/~.../solutions.html



We haven't discussed this yet and he asked us to do this "activity" while he's gone. :(

I don't have any idea whatsoever on how to do this. Since this is my first course which involves programming.

Can someone please please help me? Please? I'll appreciate in so much


P.S: I'm new here so if I'm doing anything wrong please tell me. Thanks for the help in advance. :)

Is This A Good Question/Topic? 0
  • +

Replies To: Help in programming using Fortran 90 for Computational Physics.

#2 jhosamelly  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 30-October 12

Re: Help in programming using Fortran 90 for Computational Physics.

Posted 30 October 2012 - 06:51 PM

program FDA2
implicit none

real (kind=8) :: h, t, x, df1, xdf1, err 
integer :: count

h=0.1
t=2.0

!print *,"Enter value for h: "
!read *,h

!print *,"Enter value for t: "
!read *,t
count=1
do
	df1 = ((sin (x)) - (sin(x)))/h
	xdf1 = cos (x)
	err = abs((df1-xdf1)/xdf1)*100

	!print *,"FDA Method: ",df1
	!print *,"Actual Val: ",xdf1
	print *,"h: ", h,"% Error: ", err
	h=h/10
	count=count+1
	if (count==8) exit

end do
end program FDA2



This is the problem: Write a program to calculate sin and cosine and determine the forward difference.
Do I have the write codes for sin? we are using Fortran 90.

Thanks.
Was This Post Helpful? 0
  • +
  • -

#3 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10803
  • View blog
  • Posts: 40,256
  • Joined: 27-December 08

Re: Help in programming using Fortran 90 for Computational Physics.

Posted 30 October 2012 - 06:54 PM

Duplicate threads merged. Please avoid duplicate posting.

You tell us if your code is correct. Did you run it? Does it work as expected?
Was This Post Helpful? 0
  • +
  • -

#4 jhosamelly  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 30-October 12

Re: Help in programming using Fortran 90 for Computational Physics.

Posted 30 October 2012 - 06:59 PM

Did I duplicate my post? the second one is only with one question. Anyway, I run it and yes it works. But, I don't exactly know what is expected.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1