# Machine Problem in Fortran 90

by jhosamelly
Tags: fortran, machine
 PF Patron P: 126 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 What should I put as Ax and Ay??
 P: 279 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.
 HW Helper Thanks P: 4,321 atan is an intrinsic function. atan(1.0) is proper syntax

 Related Discussions Programming & Computer Science 5 Materials & Chemical Engineering 0 Introductory Physics Homework 3 Programming & Computer Science 0