Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- # Constants and parameters
- P_max = 6500 # kW
- eta = 0.9
- rho = 1.2 # kg/m^3
- A = 13 # m^2
- Cd = 0.3
- m_train = 860000 # kg
- m_loc = 20.5 # tonnes
- m_coach = 35 # tonnes
- n_coaches = 24
- m = m_train + m_loc + n_coaches * m_coach # Total mass of the train
- g = 9.81 # m/s^2
- Crr = 0.002
- k = 0.01 # constant for curvature resistance
- r = 1000 # radius of curvature for a typical railway curve
- # Calculate maximum speed using the equation from before
- v_max = math.sqrt((2 * P_max * eta / (rho * A * Cd)) - (2 * m * g * math.sin(0) / (rho * A * Cd)) - (Crr * g * math.cos(0)) - (m * v_max**2 * k) / (r * g))
- v = 0
- while v < v_max:
- F_res = (0.5 * rho * A * Cd * v**2) + (Crr * m * g * math.cos(0)) + (m * v**2 * k) / r
- F_grade = m * g * math.sin(0)
- a = (P_max * eta - F_res - F_grade) / m
- v += a * 0.01 # Use a small time step of 0.01 seconds for numerical integration
- print(f"Velocity: {v:.2f} m/s, Acceleration: {a:.2f} m/s^2")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement