Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Machine Problem in Fortran 90

  1. Dec 16, 2012 #1

    I have the code.
    Code (Text):

    program star
    implicit none
    real (kind=8) :: x
    integer :: i


    do i=1, Nsteps
         t = n*dt
         !calculate acceleration
         !calculate values at next step
    end do

    print *, "vx= ", vx

    end program star
    What should I put as Ax and Ay??
    Last edited: Dec 16, 2012
  2. jcsd
  3. Dec 16, 2012 #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.
    Last edited: Dec 16, 2012
  4. Dec 16, 2012 #3


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    atan is an intrinsic function.

    atan(1.0) is proper syntax
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook