|Dec16-12, 02:54 AM||#1|
Blog Entries: 1
Machine Problem in Fortran 90
I have the code.
program star implicit none real (kind=8) :: x integer :: i dt=0.001 pi=4*(atan1.0) do i=1, Nsteps t = n*dt !calculate acceleration ax= ay=... !calculate values at next step vy=vy+ay*dt vx=vx+ax*dt x=x+vx*dt y=y+vy*dt end do print *, "vx= ", vx end program star
|Dec16-12, 05:52 PM||#2|
like the question says, use a = -r/r^3 in component form... you'll need to start the program with some initial x and y value.
I don't know fortran very well, but it looks like you haven't defined Nsteps or n. Also the syntax for defining pi looks dodgy.
|Dec16-12, 07:37 PM||#3|
atan is an intrinsic function.
atan(1.0) is proper syntax
|Similar Threads for: Machine Problem in Fortran 90|
|Fortran 77 help making an empty array (or blank list if they exist in fortran)||Programming & Comp Sci||5|
|Material in machine tool body (milling machine)||Materials & Chemical Engineering||0|
|Machine Problem||Introductory Physics Homework||3|
|Accessing Fortran Modules within a Fortran library from Fortran||Programming & Comp Sci||0|