0

I get a syntax error at the first while loop, specifically at the "Y"

#Calculates trajectory under various angles
from math import*
from Density import*
from Fdrag import*
from pylab import title, xlabel, ylabel, show, plot, legend

#constants
rho0=1.2            #standard density of air at ground (kg/m^3)
g=9.81              #acceleration due to gravity (m/s/s)
T0=288.15           #ground temperature
D=0.1               #diameter (m)
A=pi*D^2/4          #Area
m=4                 #mass (kg)

for theta in (25, 50, 75):  #range of trajectories
    #initial conditions
    V=2800                  #velocity m/s
    Vx=V*cos(theta)         #horizontal velocity component
    Vy=V*sin(theta)         #vertical velocity component
    t=0                     #time
    dt=0.01                #time step (s)
    X=0                     #position
    Y=0.0                     #position
    x=[0]                    #position list (x component)
    y=[0]                    #position list (y component)
    vx=[Vx]                   #velocity list (x component)
    vy=[Vy]                   #velocity list (y component)
    T=[]                    #time list
    peaked=0                #use peakes as flag

    While Y>=0:
Then the rest of my code

3 Answers 3

2

While has to be written with a lowercase 'w', otherwise Python wont recognize it/

Sign up to request clarification or add additional context in comments.

2 Comments

whoops, looks like I got beat to it by seconds.
@chown it would have been longer, except for the stupid 30 character limit
1

While should be lowercase (while)

Comments

0

While should be while (lower case 'w') in the While Y>=0: line at the end of the script.

2 Comments

@hodofhod same here, by 7 seconds =)
it would have been more like 20 seconds earlier, except for the stupid 30 character limit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.