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 compute_lifting_force(weight_lb):
'''Compute the force required to lift the object.
Inputs:
weight_lb: weight of the object in pounds, float
Output:
force_lb: force required in pounds, float
'''
force_lb = weight_lb
return force_lb | |
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_work(force_lb, height_ft):
'''Compute the work done by a constant force over a distance.
Inputs:
force_lb: constant force applied in pounds, float
height_ft: distance moved in the direction of the force in feet, float
Output:
work_ft_lb: work done in foot-pounds, float
'''
wo... | |
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_gorilla_work(weight_lb, height_ft, time_s):
'''Calculate the total work done by the gorilla climbing the tree.
Inputs:
weight_lb: weight of the gorilla in pounds, float
height_ft: height climbed in feet, float
time_s: time taken to climb in seconds, float
Output:
total_work: 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:
NEXT STEP - PROBLEM ... | def get_velocity_coefficients(v0, c):
'''Compute the coefficients of the linear velocity function.
Inputs:
v0: initial velocity, float
c: quadratic coefficient of the height function, float
Outputs:
A: constant term of the velocity function, float
B: linear coefficient of the velocity functi... | |
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_velocity(A, B, t):
'''Evaluate the velocity at a given time using the linear coefficients.
Inputs:
A: constant term of the velocity function, float
B: linear coefficient of the velocity function, float
t: time in seconds, float
Outputs:
velocity: instantaneous velocity at time 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:
Write a function to co... | def solve_velocity(v0, c, t):
'''Find the velocity of the ball at time t given the height function coefficients.
Inputs:
v0: initial velocity, float
c: quadratic coefficient of the height function, float
t: time in seconds, float
Outputs:
final_velocity: velocity of the ball at time t, 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 convert_wavelength_to_meters(lambda_nm):
'''Convert wavelength from nanometers to meters.
Inputs:
lambda_nm: wavelength in nanometers, float
Outputs:
lambda_m: wavelength in meters, float
'''
lambda_m = float(lambda_nm) * 1e-9
return lambda_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_blackbody_temperature(lambda_m, wien_constant):
'''Compute the temperature of a blackbody given its peak wavelength.
Inputs:
lambda_m: peak emission wavelength in meters, float
wien_constant: Wien's displacement constant in m*K, float
Outputs:
temperature: absolute temperature in Kel... | |
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_blackbody_temperature(lambda_nm, wien_constant):
'''Calculate the required temperature for a blackbody to have a specific peak wavelength.
Inputs:
lambda_nm: peak emission wavelength in nanometers, float
wien_constant: Wien's displacement constant in m*K, float
Outputs:
temperature: re... | |
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_fluid_resistance(eta, R, l):
'''Compute the fluidic resistance of a cylindrical pipe.
Inputs:
eta: dynamic viscosity, float
R: radius of the pipe, float
l: length of the pipe, float
Output:
resistance: fluidic resistance, float
'''
import math
resistance = (8.0 * eta ... | |
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_flow_rate(pressure_diff, resistance):
'''Compute the volumetric flow rate given pressure difference and fluidic resistance.
Inputs:
pressure_diff: pressure difference across the pipe, float
resistance: fluidic resistance of the pipe, float
Output:
flow_rate: volumetric flow rate, flo... | |
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 artery_flow_rate(eta, R, l, P):
'''Calculate the volumetric flow rate in an artery.
Inputs:
eta: dynamic viscosity, float
R: radius of the artery, float
l: length of the artery, float
P: pressure difference, float
Output:
total_flow_rate: volumetric flow rate, float
'''
resis... | |
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_energy_uncertainty(lifetime_s, planck_constant):
'''Calculate the minimum energy uncertainty in Joules.
Inputs:
lifetime_s: The lifetime of the excited state in seconds, float.
planck_constant: Planck's constant in J*s, float.
Outputs:
energy_uncertainty_J: The minimum uncertainty 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 ca... | def scale_energy_uncertainty(energy_uncertainty_J):
'''Scale the energy uncertainty to units of 10^{-25} J.
Inputs:
energy_uncertainty_J: The minimum uncertainty in energy in Joules, float.
Outputs:
energy_uncertainty_scaled: The energy uncertainty in units of 10^{-25} J, float.
'''
energy_u... | |
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_energy_time_uncertainty(lifetime_s, planck_constant):
'''Solve the energy-time uncertainty problem.
Inputs:
lifetime_s: The lifetime of the excited state in seconds, float.
planck_constant: Planck's constant in J*s, float.
Outputs:
energy_uncertainty_scaled: The minimum uncertainty 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:
NEXT STEP - PROBLEM ... | def compute_quadratic_coefficient(D, beta):
'''Compute the quadratic coefficient of the Morse potential expansion.
Inputs:
D: dissociation energy in J/molecule, float
beta: width parameter in m^-1, float
Outputs:
c2: quadratic coefficient in J/m^2, float
'''
c2 = D * beta**2
return 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 co... | def compute_force_constant(c2):
'''Compute the force constant from the quadratic coefficient.
Inputs:
c2: quadratic coefficient in J/m^2, float
Outputs:
k: force constant in N/m, float
'''
k = 2.0 * c2
return float(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 calculate_hcl_force_constant(D, beta):
'''Calculate the force constant of HCl from its Morse parameters.
Inputs:
D: dissociation energy in J/molecule, float
beta: width parameter in m^-1, float
Outputs:
force_constant: force constant of the bond in N/m, float
'''
quadratic_coeff = 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:
NEXT STEP - PROBLEM ... | def compute_wiens_constant(h, c, k_B, x_root):
'''Compute Wien's displacement constant from fundamental physical constants.
Inputs:
h: Planck's constant in J*s, float
c: speed of light in m/s, float
k_B: Boltzmann constant in J/K, float
x_root: root of the transcendental equation, float
Outp... | |
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_lambda_max(b, T):
'''Compute the peak wavelength using Wien's displacement law.
Inputs:
b: Wien's displacement constant in m*K, float
T: temperature in Kelvin, float
Output:
lambda_max: peak wavelength in meters, float
'''
lambda_max = b / T
return lambda_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:
Write a function to co... | def thermonuclear_fireball_lambda(T, h, c, k_B, x_root):
'''Compute the peak wavelength of a thermonuclear fireball in 10^{-10} m.
Inputs:
T: temperature of the fireball in Kelvin, float
h: Planck's constant in J*s, float
c: speed of light in m/s, float
k_B: Boltzmann constant in J/K, 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 cardioid_integrand(theta):
'''Compute the integrand for the arc length of the cardioid r = 1 + sin(theta).
Inputs:
theta: angle in radians, float
Output:
integrand_value: the value of the integrand at theta, float
'''
import math
val = 2.0 * (1.0 + math.sin(theta))
if val < 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 compute_cardioid_length():
'''Compute the total arc length of the cardioid by integrating the integrand.
Inputs:
None
Output:
total_length: the total arc length, float
'''
import numpy as np
from scipy.integrate import quad
total_length, _ = quad(cardioid_integrand, 0, 2 * n... | |
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_price(a, b, c, x):
'''Calculate the unit price at a given sales level.
Inputs:
a: constant term, float
b: linear coefficient, float
c: quadratic coefficient, float
x: sales level, float
Output:
price: unit price at sales level x, float
'''
price = float(a - b * x - ... | |
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 calculate_total_willingness(a, b, c, x):
'''Calculate the total willingness to pay by integrating the demand function.
Inputs:
a: constant term, float
b: linear coefficient, float
c: quadratic coefficient, float
x: sales level, float
Output:
total_willingness: total willingness to pa... | |
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 calculate_consumer_surplus(a, b, c, x):
'''Compute the consumer surplus using the demand function parameters and sales level.
Inputs:
a: constant term, float
b: linear coefficient, float
c: quadratic coefficient, float
x: sales level, float
Output:
consumer_surplus: the calculated 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:
NEXT STEP - PROBLEM ... | def compute_integral(a, b):
'''Compute the definite integral of f(x) = 1 + x^2 from a to b.
Inputs:
a: lower limit of the interval, float
b: upper limit of the interval, float
Output:
integral_value: the value of the definite integral, float
'''
integral_value = (b + (b**3) / 3.0) - (a +... | |
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_interval_length(a, b):
'''Compute the length of the interval [a, b].
Inputs:
a: lower limit of the interval, float
b: upper limit of the interval, float
Output:
length: the length of the interval, float
'''
length = float(b - a)
return length | |
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 average_value_quadratic(a, b):
'''Compute the average value of f(x) = 1 + x^2 on [a, b].
Inputs:
a: lower limit of the interval, float
b: upper limit of the interval, float
Output:
average_value: the average value of the function, float
'''
if a == b:
average_value = 1.0 + a*... | |
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_exact_value(x):
'''Compute the exact value of ln(1+x).
Inputs:
x: the numerical value to evaluate, float
Output:
exact_val: the exact value of ln(1+x), float
'''
exact_val = math.log1p(x)
return exact_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 compute_percentage_difference(exact_val, approx_val):
'''Calculate the percentage difference between an exact and approximate value.
Inputs:
exact_val: the exact mathematical value, float
approx_val: the approximate value, float
Output:
percentage_diff: the percentage difference, 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 evaluate_approximation_error(x):
'''Evaluate the percentage difference between ln(1+x) and x.
Inputs:
x: the value at which to evaluate the approximation, float
Output:
final_percentage_diff: the calculated percentage difference, float
'''
exact_value = compute_exact_value(x)
final_p... | |
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_error_contribution(exponent, max_percentage_error):
'''Compute the maximum percentage error contribution from a single variable.
Inputs:
exponent: the exponent of the variable in the power-law model, float
max_percentage_error: the maximum percentage error of the variable, 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 co... | def compute_total_percentage_error(contributions):
'''Compute the total maximum percentage error from individual contributions.
Inputs:
contributions: a list of individual percentage error contributions, list of floats
Output:
total_error: the total maximum percentage error, float
'''
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 co... | def human_surface_area_error(perc_error_w, perc_error_h):
'''Estimate the maximum percentage error in the calculated surface area.
Inputs:
perc_error_w: maximum percentage error in weight measurement, float
perc_error_h: maximum percentage error in height measurement, float
Output:
max_perc_erro... | |
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_length_units(length, from_factor, to_factor):
'''Convert a length measurement from one unit scale to another.
Inputs:
length: the length value to be converted, float
from_factor: the scale factor of the original unit relative to meters, float
to_factor: the scale factor of the target 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:
Write a function to co... | def compute_frequency(wavelength_m, speed_of_light, refractive_index):
'''Calculate the frequency of a light wave.
Inputs:
wavelength_m: the wavelength of the light in meters, float
speed_of_light: the speed of light in a vacuum in m/s, float
refractive_index: the refractive index of the medium, flo... | |
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 laser_frequency(wavelength_nm, speed_of_light, refractive_index):
'''Compute the frequency of the helium-neon laser light.
Inputs:
wavelength_nm: the wavelength of the laser light in nanometers, float
speed_of_light: the speed of light in a vacuum in m/s, float
refractive_index: the refractive i... | |
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 get_geometric_parameters(x):
'''Determine the first term and common ratio of the series.
Inputs:
x: the base of the denominator, float
Outputs:
a: the first term of the series, float
r: the common ratio of the series, float
'''
a = 1.0 / x
r = -1.0 / x
return a, 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 de... | def compute_infinite_sum(a, r):
'''Compute the sum of an infinite geometric series.
Inputs:
a: the first term of the series, float
r: the common ratio of the series, float
Outputs:
series_sum: the sum of the infinite series, float
'''
series_sum = float(a) / (1.0 - float(r))
return 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 de... | def evaluate_series(x):
'''Evaluate the infinite alternating series for a given base x.
Inputs:
x: the base of the denominator, float
Outputs:
final_sum: the evaluated sum of the series, float
'''
a, r = get_geometric_parameters(x)
final_sum = compute_infinite_sum(a, r)
return final_... | |
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_momentum(wavelength, h):
'''Calculate the momentum of a particle from its de Broglie wavelength.
Inputs:
wavelength: de Broglie wavelength in meters, float
h: Planck's constant in J*s, float
Output:
momentum: particle momentum in kg*m/s, float
'''
if wavelength == 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 ca... | def compute_kinetic_energy(momentum, mass):
'''Compute the kinetic energy of a non-relativistic particle.
Inputs:
momentum: particle momentum in kg*m/s, float
mass: mass of the particle in kg, float
Output:
kinetic_energy: kinetic energy in Joules, float
'''
kinetic_energy = float((momen... | |
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_accelerating_potential(kinetic_energy, charge):
'''Calculate the accelerating potential required to achieve a given kinetic energy.
Inputs:
kinetic_energy: kinetic energy in Joules, float
charge: charge of the particle in Coulombs, float
Output:
potential: accelerating potential in 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 proton_accelerating_potential(wavelength, h, mass, charge):
'''Calculate the accelerating potential for a proton to reach a target de Broglie wavelength.
Inputs:
wavelength: target de Broglie wavelength in meters, float
h: Planck's constant in J*s, float
mass: mass of the proton in kg, 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 calculate_wavenumber(R_H):
'''Calculate the wavenumber for the Lyman series limit.
Inputs:
R_H: Rydberg constant in cm^-1, float
Output:
wavenumber: wavenumber in cm^-1, float
'''
wavenumber = float(R_H)
return wavenumber | |
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 calculate_wavelength_nm(wavenumber):
'''Calculate the wavelength in nanometers from the wavenumber.
Inputs:
wavenumber: wavenumber in cm^-1, float
Output:
wavelength_nm: wavelength in nanometers, float
'''
if wavenumber == 0:
return float('inf')
wavelength_nm = 1e7 / wavenumb... | |
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 calculate_photon_energy(wavelength_nm, h, c):
'''Calculate the energy of a photon given its wavelength in nm.
Inputs:
wavelength_nm: wavelength in nanometers, float
h: Planck's constant in J s, float
c: speed of light in m/s, float
Output:
energy_J: energy of the photon in Joules, 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 lyman_series_limit(R_H, h, c):
'''Calculate the wavelength and energy of the Lyman series limit photon.
Inputs:
R_H: Rydberg constant in cm^-1, float
h: Planck's constant in J s, float
c: speed of light in m/s, float
Outputs:
wavelength_nm: wavelength in nanometers, float
energy_J: 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 chord_length(x, cx, cy, R):
'''Compute the length of a chord perpendicular to the x-axis.
Inputs:
x: x-coordinate of the cross-section, float
cx: x-coordinate of the circle center, float
cy: y-coordinate of the circle center, float
R: radius of the circle, float
Output:
length: lengt... | |
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 cross_section_area(base_length, height_ratio, scale_factor):
'''Compute the area of a triangular cross-section.
Inputs:
base_length: length of the base of the triangle, float
height_ratio: ratio of the height to the base length, float
scale_factor: overall scaling factor for the area, 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 solid_volume(R, cx, cy):
'''Compute the total volume of the solid by integrating the cross-sectional area.
Inputs:
R: radius of the circular base, float
cx: x-coordinate of the center of the base, float
cy: y-coordinate of the center of the base, float
Output:
volume: total volume of the... | |
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_ionization_energy_ev(Z, ie_h_ev):
'''Calculate the ionization energy of a hydrogen-like ion in eV.
Inputs:
Z: atomic number of the ion, int
ie_h_ev: ionization energy of hydrogen in eV, float
Output:
ie_ev: ionization energy of the ion in eV, float
'''
ie_ev = float(Z**2 * ie... | |
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 convert_ev_to_joules(energy_ev):
'''Convert energy from electron volts to Joules.
Inputs:
energy_ev: energy in electron volts, float
Output:
energy_joules: energy in Joules, float
'''
energy_joules = energy_ev * 1.602176634e-19
return energy_joules | |
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 convert_joules_to_kj_per_mol(energy_joules):
'''Convert energy from Joules per atom to kilojoules per mole.
Inputs:
energy_joules: energy in Joules per atom, float
Output:
energy_kj_mol: energy in kJ/mol, float
'''
N_A = 6.02214076e23
energy_kj_mol = float(energy_joules * N_A / 1000.... | |
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 helium_ionization_energy(Z, ie_h_ev):
'''Calculate the ionization energy of a hydrogen-like ion in eV and kJ/mol.
Inputs:
Z: atomic number of the ion, int
ie_h_ev: ionization energy of hydrogen in eV, float
Outputs:
ie_ev: ionization energy in eV, float
ie_kj_mol: ionization energy in kJ... | |
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_reduced_planck(planck_constant):
'''Compute the reduced Planck constant.
Inputs:
planck_constant : float
Planck's constant $h$ in J s.
Outputs:
hbar : float
The reduced Planck constant $\hbar$ in J s.
'''
import math
hbar = planck_constant / (2 * math.pi)
... | |
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_energy_uncertainty(hbar, lifetime):
'''Compute the minimum energy uncertainty.
Inputs:
hbar : float
The reduced Planck constant in J s.
lifetime : float
The lifetime of the state $\Delta t$ in seconds.
Outputs:
delta_e : float
The minimum uncertainty in energy... | |
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 scale_uncertainty(delta_e):
'''Scale the energy uncertainty to units of 10^-22 J.
Inputs:
delta_e : float
The energy uncertainty in Joules.
Outputs:
scaled_delta_e : float
The energy uncertainty in units of 10^-22 J.
'''
scaled_delta_e = float(delta_e) / 1e-22
return ... | |
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(lifetime, planck_constant):
'''Solve for the scaled energy uncertainty of the gamma ray.
Inputs:
lifetime : float
The lifetime of the excited state in seconds.
planck_constant : float
Planck's constant $h$ in J s.
Outputs:
uncertainty_scaled : float
The ... | |
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_mass(L, a, b):
'''Compute the total mass of the rod by integrating the linear density.
Inputs:
L: length of the rod, float
a: parameter a in the density function, float
b: parameter b in the density function, float
Output:
total_mass: total mass of the rod, 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 compute_average_density(total_mass, L):
'''Calculate the average density of the rod.
Inputs:
total_mass: total mass of the rod, float
L: length of the rod, float
Output:
average_density: average density of the rod, float
'''
if total_mass == 0.0:
return 0.0
if L == 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_rod_average_density(L, a, b):
'''Solve for the average density of the rod given its length and density parameters.
Inputs:
L: length of the rod, float
a: parameter a in the density function, float
b: parameter b in the density function, float
Output:
final_average_density: average ... | |
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_length_unit(length_pm):
'''Convert length from picometers to meters.
Inputs:
length_pm: length in picometers, float
Outputs:
length_m: length in meters, float
'''
length_m = length_pm * 1e-12
return length_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 calculate_momentum_uncertainty(delta_x_m):
'''Calculate the momentum uncertainty given the position uncertainty in meters.
Inputs:
delta_x_m: uncertainty in position in meters, float
Outputs:
delta_p: uncertainty in momentum in kg m/s, float
'''
h = 6.626e-34
delta_p = h / delta_x_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 format_uncertainty_result(delta_p):
'''Scale the momentum uncertainty to units of 10^-23 kg m/s.
Inputs:
delta_p: uncertainty in momentum in kg m/s, float
Outputs:
scaled_delta_p: scaled momentum uncertainty, float
'''
scaled_delta_p = delta_p / 1e-23
return scaled_delta_p | |
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_electron_momentum_uncertainty(delta_x_pm):
'''Calculate the scaled momentum uncertainty for an electron given its position uncertainty in pm.
Inputs:
delta_x_pm: uncertainty in position in picometers, float
Outputs:
scaled_delta_p: the numerical coefficient of the momentum uncertainty in u... | |
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_wavelength_to_meters(wavelength_nm):
'''Convert wavelength from nanometers to meters.
Inputs:
wavelength_nm: wavelength in nanometers, float
Outputs:
wavelength_m: wavelength in meters, float
'''
wavelength_m = float(wavelength_nm) * 1e-9
return 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 co... | def compute_threshold_frequency(wavelength_m, speed_of_light):
'''Compute the threshold frequency from the wavelength.
Inputs:
wavelength_m: threshold wavelength in meters, float
speed_of_light: speed of light in m/s, float
Outputs:
frequency_hz: threshold frequency in Hz, float
'''
freq... | |
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_work_function(frequency_hz, planck_constant):
'''Compute the work function and scale it to 10^-19 J.
Inputs:
frequency_hz: threshold frequency in Hz, float
planck_constant: Planck's constant in J*s, float
Outputs:
work_function_scaled: work function in 10^-19 J, float
'''
wor... | |
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_work_function(wavelength_nm):
'''Calculate the work function of a metal given its threshold wavelength.
Inputs:
wavelength_nm: threshold wavelength in nanometers, float
Outputs:
work_function_scaled: work function in 10^-19 J, float
'''
c = 2.9979e8
h = 6.626e-34
wavel... | |
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_energy_ev_to_joules(energy_ev, elementary_charge):
'''Convert kinetic energy from electron-volts to Joules.
Inputs:
energy_ev: kinetic energy in eV, float
elementary_charge: charge of an electron in Coulombs, float
Output:
energy_joules: kinetic energy in Joules, float
'''
en... | |
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_electron_momentum(energy_joules, mass_kg):
'''Compute the momentum of a non-relativistic electron.
Inputs:
energy_joules: kinetic energy in Joules, float
mass_kg: mass of the electron in kg, float
Output:
momentum: momentum of the electron in kg*m/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 co... | def compute_de_broglie_wavelength(momentum, planck_constant):
'''Calculate the de Broglie wavelength from momentum.
Inputs:
momentum: momentum of the particle in kg*m/s, float
planck_constant: Planck constant in J*s, float
Output:
wavelength_m: de Broglie wavelength 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 co... | def calculate_electron_wavelength_nm(energy_ev):
'''Calculate the de Broglie wavelength of an electron in nm given its energy in eV.
Inputs:
energy_ev: kinetic energy of the electron in eV, float
Output:
wavelength_nm: de Broglie wavelength in nm, float
'''
elementary_charge = 1.602176634e-1... | |
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_vertices(edge_x, edge_y, edge_z):
'''Determine the coordinates of the four vertices of the tetrahedron.
Inputs:
edge_x: length of the edge along the x-axis, float
edge_y: length of the edge along the y-axis, float
edge_z: length of the edge along the z-axis, float
Outputs:
v0: 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 de... | def compute_edge_vectors(v0, v1, v2, v3):
'''Compute the three displacement vectors from the common vertex.
Inputs:
v0: coordinates of the origin vertex, tuple of 3 floats
v1: coordinates of the first adjacent vertex, tuple of 3 floats
v2: coordinates of the second adjacent vertex, tuple of 3 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 de... | def compute_volume_from_vectors(vec1, vec2, vec3):
'''Compute the volume of the tetrahedron using the scalar triple product.
Inputs:
vec1: first edge vector, numpy array of 3 floats
vec2: second edge vector, numpy array of 3 floats
vec3: third edge vector, numpy array of 3 floats
Outputs:
vo... | |
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_tetrahedron_volume(edge_x, edge_y, edge_z):
'''Compute the total volume of the tetrahedron with mutually perpendicular edges.
Inputs:
edge_x: length of the first mutually perpendicular edge, float
edge_y: length of the second mutually perpendicular edge, float
edge_z: length of the third 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:
NEXT STEP - PROBLEM ... | def compute_rest_energy(mass_kg):
'''Compute the rest mass energy of a particle.
Inputs:
mass_kg: mass of the particle in kg, float
Outputs:
rest_energy: rest mass energy in Joules, float
'''
c = 299792458
rest_energy = mass_kg * (c ** 2)
return rest_energy | |
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_minimum_lifetime(rest_energy):
'''Compute the minimum lifetime for a particle to be considered real.
Inputs:
rest_energy: rest mass energy of the particle in Joules, float
Outputs:
lifetime: minimum lifetime in seconds, float
'''
h = 6.62607015e-34
lifetime = h / rest_energy
... | |
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 scale_lifetime(lifetime):
'''Scale the lifetime by 10^23.
Inputs:
lifetime: minimum lifetime in seconds, float
Outputs:
scaled_lifetime: lifetime scaled by 10^23, float
'''
scaled_lifetime = float(lifetime * 1e23)
return scaled_lifetime | |
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(mass_kg):
'''Solve for the scaled minimum lifetime of a particle to be considered real.
Inputs:
mass_kg: mass of the particle in kg, float
Outputs:
min_lifetime_scaled: minimum lifetime scaled by 10^23, float
'''
energy = compute_rest_energy(mass_kg)
lifetime = compute_... | |
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_elongations(L0, L1, L2):
'''Convert lengths to meters and calculate elongations.
Inputs:
L0: natural length of the spring in cm, float
L1: stretched length of the spring in cm, float
L2: final stretched length of the spring in cm, float
Outputs:
x1: elongation corresponding to ... | |
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_spring_constant(F1, x1):
'''Compute the spring constant using Hooke's Law.
Inputs:
F1: force required to maintain the spring at elongation x1 in N, float
x1: elongation of the spring in meters, float
Output:
k: spring constant in N/m, float
'''
if x1 == 0.0:
if F1 == ... | |
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_work_done(k, x2):
'''Calculate the work done in stretching the spring.
Inputs:
k: spring constant in N/m, float
x2: final elongation of the spring in meters, float
Output:
work: work done in Joules, float
'''
work = 0.5 * k * (x2 ** 2)
return float(work) | |
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_spring_work(F1, L0, L1, L2):
'''Calculate the work done in stretching the spring from L0 to L2.
Inputs:
F1: force required to maintain the spring at length L1 in N, float
L0: natural length of the spring in cm, float
L1: stretched length of the spring corresponding to F1 in cm, float
L... | |
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_series_parameters(term1, term2):
'''Compute the initial term and common ratio of a geometric series.
Inputs:
term1: the first term of the series, float
term2: the second term of the series, float
Outputs:
a: the first term of the series, float
r: the common ratio of the series, 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 co... | def evaluate_infinite_geometric_series(a, r):
'''Evaluate the sum of an infinite geometric series.
Inputs:
a: the first term of the series, float
r: the common ratio of the series, float
Outputs:
S: the sum of the infinite geometric series, float
'''
if a == 0.0:
return 0.0
i... | |
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_series(term1, term2):
'''Evaluate the infinite geometric series given its first two terms.
Inputs:
term1: the first term of the series, float
term2: the second term of the series, float
Outputs:
S: the sum of the infinite geometric series, float
'''
if term1 == 0 and term2 != 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:
NEXT STEP - PROBLEM ... | def compute_photon_energy(wavelength, h, c):
'''Compute the energy of a photon from its wavelength.
Inputs:
wavelength: wavelength of the photon in meters, float
h: Planck's constant in J*s, float
c: speed of light in m/s, float
Output:
photon_energy: energy of the photon in Joules, 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 compute_initial_energy(photon_energy, final_n, E0):
'''Compute the energy of the initial state of the electron.
Inputs:
photon_energy: energy of the emitted photon in Joules, float
final_n: principal quantum number of the final state, int
E0: Rydberg energy for hydrogen in Joules, float
Outp... | |
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_quantum_number(initial_energy, E0):
'''Compute the principal quantum number from the state energy.
Inputs:
initial_energy: energy of the state in Joules, float
E0: Rydberg energy for hydrogen in Joules, float
Output:
quantum_number: principal quantum number, int
'''
n = 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 co... | def solve_lyman_series(wavelength):
'''Find the original energy level of the electron for a given Lyman series wavelength.
Inputs:
wavelength: wavelength of the emitted photon in meters, float
Output:
original_n: the original principal quantum number, int
'''
h = 6.626e-34
c = 2.998e8
... | |
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 get_geometric_parameters(x):
'''Determine the first term and common ratio of the geometric series.
Inputs:
x: the base of the denominator, float
Outputs:
a: the first term of the series, float
r: the common ratio of the series, float
'''
a = 1.0
r = 1.0 / x
return a, 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 de... | def compute_infinite_series_sum(a, r):
'''Compute the sum of an infinite geometric series.
Inputs:
a: the first term of the series, float
r: the common ratio of the series, float
Outputs:
S: the sum of the infinite series, float
'''
S = float(a) / (1.0 - float(r))
return 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 de... | def evaluate_series(x):
'''Evaluate the infinite geometric series for a given base x.
Inputs:
x: the base of the denominator, float
Outputs:
sum_series: the evaluated sum of the infinite series, float
'''
a, r = get_geometric_parameters(x)
sum_series = compute_infinite_series_sum(a, 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:
NEXT STEP - PROBLEM ... | def partial_r(r, h):
'''Compute the partial derivative of the cone's volume with respect to its radius.
Inputs:
r: base radius of the cone in cm, float
h: height of the cone in cm, float
Outputs:
dV_dr: partial derivative of volume with respect to radius, float
'''
import math
dV_dr ... | |
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 partial_h(r):
'''Compute the partial derivative of the cone's volume with respect to its height.
Inputs:
r: base radius of the cone in cm, float
Outputs:
dV_dh: partial derivative of volume with respect to height, float
'''
import math
dV_dh = (1.0 / 3.0) * math.pi * (r ** 2)
ret... | |
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_total_differential(dV_dr, dV_dh, dr, dh):
'''Compute the total differential to estimate the maximum error in volume.
Inputs:
dV_dr: partial derivative of volume with respect to radius, float
dV_dh: partial derivative of volume with respect to height, float
dr: maximum error in the measur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.