Home > other >  Beg good intention to save the humble students Python small white on inclined throwing movement with
Beg good intention to save the humble students Python small white on inclined throwing movement with

Time:09-24

CodePudding user response:

Physics has also physics teacher, and I was not sure, you see whether you want to the function of
 
The import numpy as np
The import math
The import matplotlib. Pyplot as PLT

Xx=[]
Yy=[]
M=1
Where v0=50
G=9.8
K=0.3
Theta=45 * math.h PI/180
V0x=where v0 * math. Cos (theta)
V0y math.=where v0 * sin (theta)
Dt=0.01
Sx=0
Sy=0
While True:
VX=(1/m) * (k * v0x) * dt
VY=(1/m) * (m + k * * g v0y) * dt
V0x +=vX
V0y +=vY
Sx +=v0x * dt
Sy +=v0y * dt
If sy<0: break
Xx. Append (sx)
Yy. Append (sy)

PLT. The plot (xx, yy, '-')
PLT. The show ()

CodePudding user response:

According to the perspective mapping x axes is probably so to change
 
The import math
The import matplotlib. Pyplot as PLT

Def get_sx (jiaodu) :
M=1
Where v0=50
G=9.8
K=0.3
Theta=jiaodu * math.h PI/180
V0x=where v0 * math. Cos (theta)
V0y math.=where v0 * sin (theta)
Dt=0.01
Sx=0
Sy=0
While True:
VX=(1/m) * (k * v0x) * dt
VY=(1/m) * (m + k * * g v0y) * dt
V0x +=vX
V0y +=vY
Sx +=v0x * dt
Sy +=v0y * dt
If sy<0:
Return sx

Xx=[]
Yy=[]
For I in range (10,80,5) :
Xx. Append (I)
Yy. Append (get_sx (I))

PLT. The plot (xx, yy, '-')
PLT. The show ()




You write the code I don't understand your logic, so don't know how to change, you can refer to my own change again

CodePudding user response:

Really thank you! Physical relationship is all right! But my problem is with the x axis displacement Angle theta image, if you can point me to use for statement to draw out the image of syntax errors would be even better! Thank you again for

CodePudding user response:

I figure is not Angle theta and corresponding relation of x axis direction? Theta in the x direction distance between 30 ~ 40 Angle reaches the maximum,

You r in the for loop is to represent the Angle? Not involved in calculating your point of view,

CodePudding user response:

refer to fifth floor ice of wind response:
my figure is not Angle theta and corresponding relation of x axis direction? Theta in the x direction distance between 30 ~ 40 Angle reaches the maximum,

You r in the for loop is to represent the Angle? Your point of view is not involved in calculation,

Yes, how to participate in the operation? Do you understand I am now a part of, don't understand is while statement vX overspending: superposition of the cycle of operations, the effect is always added +=? This step can be implemented in the for statement, please? I have been reading recently has not learned while statement or trouble thank you

CodePudding user response:

X axes and Angle, can be directly calculated with a function, if any, do you use a for loop Angle can be achieved, if the x axes and Angle, can't use a function to calculate directly, that would require the two layers of circulation, the first layer cycle point of view, the second loop to calculate the distance x axis under every Angle, I inside the while loop used to cycle to objects fall to the ground, if use a for loop variable is not set, because the uncertain time

CodePudding user response:

Understand, really thank you very much, please!
  • Related