instruction
stringlengths
2.01k
8.44k
input
stringclasses
1 value
output
stringlengths
180
2.3k
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def time_of_fall(h, g): '''Calculate the time of fall for an object dropped from rest. Inputs: h: height of the fall in meters, float g: acceleration due to gravity in m/s^2, float Output: t_f: time of fall in seconds, float ''' t_f = math.sqrt(2 * h / g) return t_f
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def coriolis_deflection(t, latitude_deg, omega, g): '''Compute the eastward Coriolis deflection of a falling object. Inputs: t: time of fall in seconds, float latitude_deg: latitude in degrees, float omega: angular velocity of the Earth in rad/s, float g: acceleration due to gravity in m/s^2, fl...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def solve_problem(h, latitude_deg, omega, g): '''Solve for the eastward deflection of the lead bullets. Inputs: h: height of the fall in meters, float latitude_deg: latitude in degrees, float omega: angular velocity of the Earth in rad/s, float g: acceleration due to gravity in m/s^2, float ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_final_velocity_ratio(): '''Compute the ratio of the final to initial velocity of the second particle. Inputs: None Output: velocity_ratio: ratio v2/u2, float ''' import math velocity_ratio = math.sqrt(2) return velocity_ratio
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_initial_velocity_ratio(v2_u2_ratio): '''Compute the initial velocity ratio u1/u2. Inputs: v2_u2_ratio: ratio of final to initial velocity of the second particle, float Output: u1_u2_ratio: initial velocity ratio u1/u2, float ''' if v2_u2_ratio == 1.0: raise ValueError("v2_u2_...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_problem(): '''Solve for the mass ratio m2/m1. Inputs: None Output: mass_ratio: the ratio m2/m1, float ''' v2_u2_ratio = compute_final_velocity_ratio() u1_u2_ratio = compute_initial_velocity_ratio(v2_u2_ratio) mass_ratio = u1_u2_ratio ** 2 return float(mass_ratio)
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_orbital_radii(h_p, h_a, R_E): '''Compute the radial distances at perigee and apogee. Inputs: h_p: altitude at perigee in km, float h_a: altitude at apogee in km, float R_E: radius of the Earth in km, float Outputs: r_p: radial distance at perigee in km, float r_a: radial dist...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_orbital_parameters(r_p, r_a): '''Compute the semi-latus rectum and eccentricity of the orbit. Inputs: r_p: radial distance at perigee in km, float r_a: radial distance at apogee in km, float Outputs: p: semi-latus rectum in km, float e: orbital eccentricity, float ''' e =...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_altitude_at_angle(p, e, theta_deg, R_E): '''Compute the altitude of the satellite at a given angle from perigee. Inputs: p: semi-latus rectum in km, float e: orbital eccentricity, float theta_deg: angle from perigee in degrees, float R_E: radius of the Earth in km, float Outputs:...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def satellite_altitude(h_p, h_a, theta_deg, R_E): '''Calculate the altitude of a satellite at a given angle from perigee. Inputs: h_p: altitude at perigee in km, float h_a: altitude at apogee in km, float theta_deg: angle from perigee in degrees, float R_E: radius of the Earth in km, float O...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_natural_frequency(mass_car, mass_added, deflection): '''Calculate the spring constant and natural angular frequency. Inputs: mass_car: mass of the automobile in kg, float mass_added: additional mass in kg, float deflection: static deflection in meters, float Outputs: k: spring co...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def compute_driving_frequency(speed_kmh, road_wavelength): '''Calculate the driving angular frequency. Inputs: speed_kmh: horizontal speed in km/h, float road_wavelength: wavelength of the bumps in meters, float Outputs: omega: driving angular frequency in rad/s, float ''' import math ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def compute_oscillation_amplitude(omega_0, omega, road_amplitude): '''Calculate the amplitude of oscillation. Inputs: omega_0: natural angular frequency in rad/s, float omega: driving angular frequency in rad/s, float road_amplitude: amplitude of the road bumps in meters, float Outputs: ampl...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def solve_automobile_oscillation(mass_car, mass_added, deflection, speed_kmh, road_amplitude, road_wavelength, wheelbase): '''Solve for the amplitude of oscillation of the automobile. Inputs: mass_car: mass of the automobile in kg, float mass_added: additional mass in kg, float deflection: static de...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def circular_orbit_velocity(mu, r): '''Calculate the velocity of a circular orbit. Inputs: mu: standard gravitational parameter in m^3/s^2, float r: orbital radius in meters, float Output: v: circular orbital velocity in m/s, float ''' import math v = math.sqrt(mu / r) return v
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def transfer_orbit_semi_major_axis(r1, r2): '''Calculate the semi-major axis of a Hohmann transfer orbit. Inputs: r1: radius of the first circular orbit in meters, float r2: radius of the second circular orbit in meters, float Output: a: semi-major axis of the transfer orbit in meters, float ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def elliptical_orbit_velocity(mu, r, a): '''Calculate the velocity of an object in an elliptical orbit. Inputs: mu: standard gravitational parameter in m^3/s^2, float r: current distance from the central body in meters, float a: semi-major axis of the elliptical orbit in meters, float Output: ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def hohmann_transfer_total_delta_v(mu, r_earth, r_venus): '''Calculate the total delta-v for a Hohmann transfer between two circular orbits. Inputs: mu: standard gravitational parameter in m^3/s^2, float r_earth: radius of the initial circular orbit (Earth) in meters, float r_venus: radius of the fi...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def calculate_term_change(wavelength_m, R): '''Calculate the change in the inverse square of the principal quantum number. Inputs: wavelength_m: wavelength of the photon in meters, float R: Rydberg constant in m^-1, float Output: term_change: change in 1/n^2, float ''' if wavelength_m ==...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def state_after_absorption(n_i, term_change): '''Calculate the principal quantum number after absorption. Inputs: n_i: initial principal quantum number, float or int term_change: change in 1/n^2 due to absorption, float Output: n_f: final principal quantum number, float ''' n_f = (1.0 / ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def state_after_emission(n_i, term_change): '''Calculate the principal quantum number after emission. Inputs: n_i: initial principal quantum number before emission, float or int term_change: change in 1/n^2 due to emission, float Output: n_f: final principal quantum number, float ''' inv...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def hydrogen_atom_transitions(initial_state, lambda_abs_nm, lambda_emit_nm, R): '''Determine the final state of the hydrogen atom after absorption and emission. Inputs: initial_state: principal quantum number of the initial state, int lambda_abs_nm: wavelength of the absorbed photon in nanometers, float...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_mass_defect(m_n, m_p, m_e): '''Compute the mass defect for the beta decay of a neutron. Inputs: m_n: mass of the neutron in atomic mass units (u), float m_p: mass of the proton in atomic mass units (u), float m_e: mass of the electron in atomic mass units (u), float Output: mass_...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_available_energy(mass_defect, conversion_factor): '''Compute the available energy (Q-value) from the mass defect. Inputs: mass_defect: the mass difference in atomic mass units (u), float conversion_factor: energy equivalent of one atomic mass unit (e.g., 931.5 MeV/u), float Output: e...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def neutron_decay_energy(m_n, m_p, m_e, conversion_factor): '''Compute the total available energy in the beta decay of a free neutron. Inputs: m_n: mass of the neutron in atomic mass units (u), float m_p: mass of the proton in atomic mass units (u), float m_e: mass of the electron in atomic mass uni...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def decompose_velocity(v0, angle_deg): '''Decompose the initial velocity into normal and tangential components. Inputs: v0: initial velocity magnitude, float angle_deg: angle from the normal in degrees, float Outputs: v0n: normal component of initial velocity, float v0t: tangential component...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to de...
def compute_post_collision_components(v0n, v0t, e): '''Compute the post-collision velocity components. Inputs: v0n: normal component of initial velocity, float v0t: tangential component of initial velocity, float e: coefficient of restitution, float Outputs: vfn: normal component of final ve...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to de...
def compute_final_velocity_magnitude(vfn, vft): '''Calculate the magnitude of the final velocity vector. Inputs: vfn: normal component of final velocity, float vft: tangential component of final velocity, float Outputs: vf: magnitude of the final velocity, float ''' import math vf = ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to de...
def solve_bounce_velocity(v0, angle_deg, e): '''Solve for the final bounce velocity of the steel ball. Inputs: v0: initial velocity magnitude in m/s, float angle_deg: angle of incidence from the normal in degrees, float e: coefficient of restitution, float Outputs: final_velocity: magnitude ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def ho_wavefunction(v, xi, alpha): '''Compute the harmonic oscillator wavefunction. Inputs: v: vibrational quantum number (0, 1, or 2), int xi: dimensionless position coordinate, float alpha: scaling parameter, float Output: psi: value of the wavefunction at xi, float ''' import nump...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def transition_integrand(v, xi, alpha): '''Compute the integrand for the transition dipole moment. Inputs: v: final vibrational quantum number, int xi: dimensionless position coordinate, float alpha: scaling parameter, float Output: integrand_val: value of the integrand at xi, float ''' ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def trapezoidal_integral(v, alpha, xi_max, num_points): '''Numerically integrate the transition dipole moment integrand. Inputs: v: final vibrational quantum number, int alpha: scaling parameter, float xi_max: symmetric integration limit, float num_points: number of points for the trapezoidal gr...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def evaluate_forbidden_transition(): '''Evaluate the 0 -> 2 transition integral to show it is forbidden. Inputs: None Output: integral_v2: the numerical value of the integral for v=2, float ''' alpha = 1.0 xi_max = 10.0 num_points = 10000 v = 2 integral_v2 = trapezoidal_inte...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def convert_speed(v_kmh): '''Convert speed from km/hr to m/s. Inputs: v_kmh: speed in km/hr, float Outputs: v_ms: speed in m/s, float ''' v_ms = float(v_kmh) * 1000.0 / 3600.0 return v_ms
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_time_of_flight(h_m): '''Compute the time of flight for a dropped object. Inputs: h_m: drop height in meters, float Outputs: t_flight: time of flight in seconds, float ''' g = 9.8 t_flight = (2.0 * float(h_m) / g) ** 0.5 return float(t_flight)
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_time_error(v_ms, d_safe): '''Compute the time error required to achieve a specific horizontal distance error. Inputs: v_ms: horizontal speed in m/s, float d_safe: safe distance in meters, float Outputs: time_error: required time error in seconds, float ''' if v_ms == 0.0: ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_problem(v_kmh, h_m, d_safe): '''Solve for the minimum time error to not hit the cattle. Inputs: v_kmh: horizontal speed of the airplane in km/hr, float h_m: height of the airplane above the ground in meters, float d_safe: minimum safe distance from the cattle in meters, float Outputs: ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def cubic_map_step(x, alpha): '''Compute the next value in the cubic map sequence. Inputs: x: current value x_n, float alpha: parameter alpha, float Output: next value x_{n+1}, float ''' x_next = alpha * x * (1.0 - x * x) return x_next
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def generate_trajectory(x1, alpha, max_steps): '''Generate the trajectory of the cubic map. Inputs: x1: initial value, float alpha: parameter alpha, float max_steps: total number of steps to generate (including x1), int Output: list of values [x_1, x_2, ..., x_{max_steps}], list of floats ''...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def find_divergence_step(traj1, traj2, threshold): '''Find the first step where two trajectories diverge by more than the threshold. Inputs: traj1: first trajectory, list of floats traj2: second trajectory, list of floats threshold: absolute difference threshold, float Output: step number n (1-b...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_problem(x1_a, x1_b, alpha, threshold, max_steps): '''Determine the lowest value of n for which the two trajectories diverge. Inputs: x1_a: first initial value, float x1_b: second initial value, float alpha: parameter alpha, float threshold: absolute difference threshold, float max_...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_initial_energy(mass, d1, theta_deg): '''Compute the initial mechanical energy of the skier. Inputs: mass: mass of the skier in kg, float d1: distance down the hill in meters, float theta_deg: angle of the hill in degrees, float Output: initial_energy: initial mechanical energy in...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_friction_work_factor(mass, d1, d2, theta_deg): '''Compute the friction work factor (work done by friction per unit mu_k). Inputs: mass: mass of the skier in kg, float d1: distance down the hill in meters, float d2: distance along level snow in meters, float theta_deg: angle of the hi...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_friction_coefficient(initial_energy, friction_work_factor): '''Compute the coefficient of kinetic friction using the Work-Energy Theorem. Inputs: initial_energy: initial mechanical energy in Joules, float friction_work_factor: magnitude of friction work per unit mu_k in Joules, float Out...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def skier_friction_coefficient(mass, d1, d2, theta_deg): '''Find the coefficient of kinetic friction between the skis and the snow. Inputs: mass: mass of the skier in kg, float d1: distance skied down the hill in meters, float d2: distance coasted along the level snow in meters, float theta_deg:...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_acceleration_incline(theta_deg, mu_k, g): '''Calculate the net acceleration of the skier on the incline. Inputs: theta_deg : float Angle of the hill inclination in degrees. mu_k : float Coefficient of kinetic friction. g : float Acceleration due to gravity in m/s^...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def compute_velocity_bottom(a_incline, d1): '''Calculate the velocity at the bottom of the hill. Inputs: a_incline : float Net acceleration down the hill in m/s^2. d1 : float Distance skied down the hill in meters. Outputs: v_bottom : float Velocity at the bottom of the h...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def skier_velocity(m, theta_deg, d1, mu_k, g): '''Calculate the velocity of the skier at the bottom of the hill. Inputs: m : float Mass of the skier in kg. theta_deg : float Angle of the hill inclination in degrees. d1 : float Distance skied down the hill in meters. mu_k ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_mass_decay_constant(g_earth, gravity_ratio, exhaust_velocity): '''Compute the mass decay constant for a hovering rocket. Inputs: g_earth: Earth's gravitational acceleration in m/s^2, float gravity_ratio: ratio of local gravity to Earth's gravity, float exhaust_velocity: exhaust velocity ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_hover_time(decay_constant, fuel_fraction): '''Compute the hover time for a rocket given its mass decay constant and fuel fraction. Inputs: decay_constant: mass decay constant in s^-1, float fuel_fraction: fraction of the total mass available as fuel, float Output: hover_time: maximum...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def lunar_craft_hover_time(g_earth, gravity_ratio, exhaust_velocity, fuel_fraction): '''Calculate the maximum hover time for a lunar landing craft. Inputs: g_earth: Earth's gravitational acceleration in m/s^2, float gravity_ratio: ratio of lunar gravity to Earth's gravity, float exhaust_velocity: ex...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_orbital_radius(altitude_km, earth_radius_km): '''Compute the total orbital radius in meters. Inputs: altitude_km: altitude of the spacecraft in km, float earth_radius_km: radius of the Earth in km, float Output: radius_m: total orbital radius in meters, float ''' radius_m = (...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_circular_velocity(radius_m, mu): '''Compute the circular orbital velocity. Inputs: radius_m: total orbital radius in meters, float mu: standard gravitational parameter in m^3/s^2, float Output: v_circular: circular orbital velocity in m/s, float ''' v_circular = math.sqrt(mu ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_escape_velocity(radius_m, mu): '''Compute the escape velocity from a given radius. Inputs: radius_m: total orbital radius in meters, float mu: standard gravitational parameter in m^3/s^2, float Output: v_escape: escape velocity in m/s, float ''' if radius_m <= 0: rais...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_escape_delta_v(v_circular, v_escape): '''Compute the minimum additional speed required to escape in km/s. Inputs: v_circular: circular orbital velocity in m/s, float v_escape: escape velocity in m/s, float Output: delta_v_km_s: minimum additional speed in km/s, float ''' delt...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def minimum_escape_speed(altitude_km, earth_radius_km, mu): '''Calculate the minimum escape speed (delta-v) from a circular orbit. Inputs: altitude_km: altitude of the spacecraft in km, float earth_radius_km: radius of the Earth in km, float mu: standard gravitational parameter in m^3/s^2, float ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_curl(a, b, c): '''Compute the curl of the vector field A. Inputs: a: coefficient of the x-component of A, float b: coefficient of the y-component of A, float c: coefficient of the z-component of A, float Outputs: curl_x, curl_y, curl_z: components of the curl, tuple of floats ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_projected_area(R): '''Compute the area of the projected surface on the xy-plane. Inputs: R: radius of the paraboloid base, float Outputs: area: area of the circular base, float ''' import math area = math.pi * R**2 return area
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def evaluate_integral(curl_z, area): '''Evaluate the surface integral. Inputs: curl_z: z-component of the curl, float area: area of the projected surface, float Outputs: integral_value: value of the surface integral, float ''' integral_value = float(curl_z * area) return integral_val...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_problem(a, b, c, R): '''Solve the surface integral problem. Inputs: a: coefficient of the x-component of A, float b: coefficient of the y-component of A, float c: coefficient of the z-component of A, float R: radius of the paraboloid base, float Outputs: integral_value: the val...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_air_time(num_balls, cycle_time): '''Compute the time a ball spends in the air. Inputs: num_balls: number of balls being juggled, int cycle_time: time to cycle each ball through hands in seconds, float Output: air_time: time the ball spends in the air in seconds, float ''' air...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_initial_speed(air_time, g): '''Compute the initial vertical speed required for a given air time. Inputs: air_time: time the ball spends in the air in seconds, float g: acceleration due to gravity in m/s^2, float Output: initial_speed: initial vertical speed in m/s, float ''' ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def juggling_speed(num_balls, cycle_time, g): '''Compute the minimum vertical throwing speed for juggling. Inputs: num_balls: number of balls being juggled, int cycle_time: time to cycle each ball through hands in seconds, float g: acceleration due to gravity in m/s^2, float Output: min_spee...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_spatial_norm_sq(S_1s): '''Compute the norm squared of the spatial part of the wavefunction. Inputs: S_1s: overlap integral of the 1s orbital with itself, float Output: spatial_norm_sq: norm squared of the spatial part, float ''' spatial_norm_sq = S_1s ** 2 return spatial_norm...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_spin_norm_sq(S_aa, S_bb, S_ab): '''Compute the norm squared of the spin part of the wavefunction. Inputs: S_aa: overlap integral of the alpha spin state with itself, float S_bb: overlap integral of the beta spin state with itself, float S_ab: overlap integral between the alpha and beta s...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_normalization_constant(spatial_norm_sq, spin_norm_sq): '''Compute the overall normalization constant for the wavefunction. Inputs: spatial_norm_sq: norm squared of the spatial part, float spin_norm_sq: norm squared of the spin part, float Output: c: normalization constant, float ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def normalization_of_wavefunction(S_1s, S_aa, S_bb, S_ab): '''Compute the normalization constant of the two-electron wavefunction. Inputs: S_1s: overlap integral of the 1s orbital with itself, float S_aa: overlap integral of the alpha spin state with itself, float S_bb: overlap integral of the beta ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def rocket_velocity(mass_fraction, exhaust_velocity): '''Compute the velocity of a rocket given its mass fraction and exhaust velocity. Inputs: mass_fraction: the ratio of current mass to initial mass (m/m0), float exhaust_velocity: the effective exhaust velocity of the rocket, float Output: vel...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def rocket_momentum(initial_mass, mass_fraction, exhaust_velocity): '''Compute the momentum of a rocket given its initial mass, mass fraction, and exhaust velocity. Inputs: initial_mass: the initial mass of the rocket, float mass_fraction: the ratio of current mass to initial mass (m/m0), float exha...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def optimal_mass_fraction(): '''Find the mass fraction that maximizes the rocket's momentum. Inputs: None Output: mass_fraction: the optimal mass fraction, float ''' import math mass_fraction = math.exp(-1) return mass_fraction
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_rocket_max_momentum(): '''Solve for the mass fraction at which the rocket's momentum is maximized. Inputs: None Output: mass_fraction: the optimal mass fraction, float ''' mass_fraction = optimal_mass_fraction() return mass_fraction
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def initial_velocity_components(v, theta_deg): '''Compute the normal and tangential components of the initial velocity. Inputs: v: initial velocity magnitude, float theta_deg: angle of incidence from the normal in degrees, float Outputs: v_i_n: normal component of the initial velocity, float ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def final_velocity_components(v_i_n, v_i_t, e): '''Compute the final velocity components after the collision. Inputs: v_i_n: normal component of the initial velocity, float v_i_t: tangential component of the initial velocity, float e: coefficient of restitution, float Outputs: v_f_n: normal ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def bounce_angle(v_f_n, v_f_t): '''Calculate the final bounce angle from the normal. Inputs: v_f_n: normal component of the final velocity, float v_f_t: tangential component of the final velocity, float Outputs: theta_f_deg: final bounce angle from the normal in degrees, float ''' import...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_bounce_angle(v, theta_deg, e): '''Solve for the final bounce angle of the steel ball. Inputs: v: initial velocity of the steel ball in m/s, float theta_deg: angle of incidence from the normal in degrees, float e: coefficient of restitution, float Outputs: theta_f_deg: final bounce ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_theoretical_gravity_pole(polar_radius_km, earth_mass_kg, G): '''Compute the theoretical effective gravity at the poles. Inputs: polar_radius_km: polar radius of the Earth in kilometers, float earth_mass_kg: mass of the Earth in kilograms, float G: gravitational constant in m^3/(kg s^2), ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def compute_empirical_gravity(latitude_degrees): '''Compute the empirical gravity at a given latitude. Inputs: latitude_degrees: latitude in degrees, float Output: g_empirical: empirical gravity in m/s^2, float ''' import math lam_rad = math.radians(latitude_degrees) sin_lam = math.s...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def solve_effective_gravity(polar_radius_km, equatorial_radius_km, earth_mass_kg, G): '''Calculate the theoretical and empirical gravity at the poles and their difference. Inputs: polar_radius_km: polar radius of the Earth in kilometers, float equatorial_radius_km: equatorial radius of the Earth in kilo...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def convert_distance_ly_to_m(distance_ly): '''Convert distance from light years to meters. Inputs: distance_ly: distance in light years, float Outputs: distance_m: distance in meters, float ''' c = 299792458 seconds_in_julian_year = 365.25 * 24 * 3600 distance_m = distance_ly * c * s...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_orbital_period_s(distance_m, mass_kg): '''Compute the orbital period of the binary star system in seconds. Inputs: distance_m: separation distance in meters, float mass_kg: mass of a single star in kilograms, float Outputs: period_s: orbital period in seconds, float ''' impor...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def convert_period_s_to_scaled_yr(period_s): '''Convert period from seconds to 10^7 years. Inputs: period_s: orbital period in seconds, float Outputs: period_scaled: orbital period in units of 10^7 years, float ''' seconds_per_julian_year = 365.25 * 24 * 3600 period_scaled = period_s / (...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def double_star_period(distance_ly, mass_kg): '''Calculate the orbital period of a binary star system in units of 10^7 years. Inputs: distance_ly: separation distance in light years, float mass_kg: mass of a single star in kilograms, float Outputs: period_scaled: orbital period in units of 10^7 ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_total_energy(momentum, mass, c): '''Compute the total relativistic energy of a particle. Inputs: momentum: momentum of the particle, float mass: rest mass of the particle, float c: speed of light in the chosen unit system, float Output: total_energy: total relativistic energy, fl...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_kinetic_energy(total_energy, mass, c): '''Compute the relativistic kinetic energy of a particle. Inputs: total_energy: total relativistic energy, float mass: rest mass of the particle, float c: speed of light in the chosen unit system, float Output: kinetic_energy: relativistic k...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def electron_kinetic_energy(momentum_mev_c, electron_mass_mev_c2=0.511, c=1.0): '''Calculate the kinetic energy of an electron given its momentum. Inputs: momentum_mev_c: momentum of the electron in MeV/c, float electron_mass_mev_c2: rest mass of the electron in MeV/c^2, float c: speed of light in t...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def convert_angle_to_radians(psi_deg): '''Convert an angle from degrees to radians. Inputs: psi_deg: angle in degrees, float Output: angle in radians, float ''' psi_rad = psi_deg * math.pi / 180.0 return psi_rad
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_quadratic_coefficients(m1, m2, v0, psi_rad): '''Compute the coefficients of the quadratic equation for the final speed. Inputs: m1: mass of the projectile, float m2: mass of the target, float v0: initial speed of the projectile, float psi_rad: scattering angle in radians, float O...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_kinematic_quadratic(A, B, C): '''Solve the quadratic equation and return the maximum root. Inputs: A: quadratic coefficient, float B: linear coefficient, float C: constant term, float Output: maximum final speed, float ''' import math if A == 0: max_v1 = -C / B ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def deuteron_final_speed(v0, psi_deg): '''Calculate the final speed of the deuteron. Inputs: v0: initial speed of the deuteron in km/s, float psi_deg: scattering angle in degrees, float Output: final speed of the deuteron in km/s, float ''' psi_rad = convert_angle_to_radians(psi_deg) m1 ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_mass_ratio(m1, m2): '''Compute the mass ratio of the incident particle to the target particle. Inputs: m1: mass of the incident particle, float m2: mass of the target particle, float Output: rho: mass ratio m1/m2, float ''' rho = m1 / m2 return float(rho)
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_max_scattering_angle_rad(rho): '''Compute the maximum scattering angle in radians. Inputs: rho: mass ratio m1/m2, float Output: psi_max_rad: maximum scattering angle in radians, float ''' if rho > 1.0: psi_max_rad = math.asin(1.0 / rho) else: psi_max_rad = mat...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def max_scattering_angle_degrees(m1, m2): '''Calculate the maximum scattering angle of the incident particle in degrees. Inputs: m1: mass of the incident particle, float m2: mass of the target particle, float Output: psi_max_deg: maximum scattering angle in degrees, float ''' rho = compu...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_delta_v_gas(m_total, m_gas, v_ex): '''Calculate the change in velocity due to gas exhaustion. Inputs: m_total: total initial mass, float m_gas: mass of the gas, float v_ex: exhaust velocity of the gas, float Output: change in velocity, float ''' import math m_f = m_total ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def compute_required_delta_v_tank(v_orbiter, delta_v_gas): '''Calculate the required additional velocity change. Inputs: v_orbiter: relative velocity of the orbiter, float delta_v_gas: velocity change from gas exhaustion, float Output: required additional velocity change, float ''' delta_v_r...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def compute_throw_velocity(m_total, m_gas, m_tank, delta_v_req): '''Calculate the relative throw velocity of the tank. Inputs: m_total: total initial mass, float m_gas: mass of the gas, float m_tank: mass of the empty tank, float delta_v_req: required additional velocity change, float Output...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def solve_astronaut_rescue(v_orbiter, m_total, m_tank, m_gas, v_ex): '''Solve for the required throw velocity of the tank. Inputs: v_orbiter: relative velocity of the orbiter, float m_total: total initial mass, float m_tank: mass of the empty tank, float m_gas: mass of the gas, float v_ex: e...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_drag_parameter(radius_cm, mass_g, air_density, drag_coeff): '''Compute the drag parameter k = (rho * C_d * A) / (2 * m). Inputs: radius_cm: radius of the ball in cm, float mass_g: mass of the ball in grams, float air_density: density of air in kg/m^3, float drag_coeff: drag coefficie...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def simulate_trajectory(v0, launch_angle_deg, initial_height, distance_fence, k, g): '''Simulate the trajectory and return the height at the fence distance. Inputs: v0: initial speed in m/s, float launch_angle_deg: launch angle in degrees, float initial_height: initial height in meters, float di...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def find_required_initial_speed(launch_angle_deg, initial_height, distance_fence, height_fence, k, g): '''Find the initial speed required to exactly clear the fence. Inputs: launch_angle_deg: launch angle in degrees, float initial_height: initial height in meters, float distance_fence: horizontal di...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_softball_problem(distance_fence, height_fence, initial_height, launch_angle_deg, radius_cm, mass_g, air_density, drag_coeff, g): '''Solve for the initial speed needed to clear the fence. Inputs: distance_fence: horizontal distance to the fence in meters, float height_fence: height of the fence...