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: Write a function to co...
def compute_hydrostatic_pressure(density_kg_m3, depth, g): '''Compute the hydrostatic pressure at a given depth. Inputs: density_kg_m3: density of the fluid in kg/m^3, float depth: depth below the surface in meters, float g: acceleration due to gravity in m/s^2, float Output: hydrostatic_pre...
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_final_volume(initial_volume, initial_pressure, hydrostatic_pressure): '''Compute the final volume of the gas using Boyle's Law. Inputs: initial_volume: initial volume of the gas in m^3, float initial_pressure: initial absolute pressure (atmospheric) in Pa, float hydrostatic_pressure: hyd...
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 diving_bell_volume(initial_volume, depth, density_g_cm3, initial_pressure, g): '''Calculate the final volume of a diving bell's air space at a given depth. Inputs: initial_volume: initial volume of the air space on deck in m^3, float depth: depth to which the bell is lowered in meters, float den...
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_gas_density(pressure, molar_mass, temperature): '''Compute the density of an ideal gas. Inputs: pressure: pressure of the gas in Pascals, float molar_mass: molar mass of the gas in kg/mol, float temperature: absolute temperature in Kelvin, float Outputs: density: density of ...
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_scale_height(molar_mass, temperature, gravity): '''Compute the scale height of an isothermal atmosphere. Inputs: molar_mass: molar mass of the gas in kg/mol, float temperature: absolute temperature in Kelvin, float gravity: acceleration due to gravity in m/s^2, 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 compute_pressure_at_altitude(p0, altitude, scale_height): '''Compute the atmospheric pressure at a given altitude using the scale height. Inputs: p0: pressure at sea level, float altitude: altitude above sea level in meters, float scale_height: scale height of the atmosphere 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 solve_barometric_problem(p0, altitude, molar_mass, temperature, gravity): '''Evaluate the external atmospheric pressure at a given altitude. Inputs: p0: pressure at sea level in atm, float altitude: altitude in meters, float molar_mass: molar mass of the gas in kg/mol, float temperature: abs...
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_isochoric_work(volume_initial, volume_final): '''Compute the work done during an isochoric process. Inputs: volume_initial: initial volume, float volume_final: final volume, float Output: work done, float ''' work = 0.0 return 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 ca...
def compute_delta_u(q_kj, work_j): '''Compute the change in internal energy. Inputs: q_kj: heat supplied in kJ, float work_j: work done in Joules, float Output: change in internal energy in kJ, float ''' work_kj = work_j / 1000.0 delta_u = q_kj + work_kj return delta_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_problem(n_mol, volume_dm3, t1_k, q_kj, t2_k): '''Solve for the change in internal energy of the gas. Inputs: n_mol: amount of substance in moles, float volume_dm3: fixed volume of the gas in dm^3, float t1_k: initial temperature in Kelvin, float q_kj: energy supplied as heat in kJ, 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: NEXT STEP - PROBLEM ...
def compute_lifting_force(mass, g, acceleration): '''Compute the total lifting force required to move an object vertically. Inputs: mass: mass of the object in kg, float g: acceleration due to gravity in m/s^2, float acceleration: vertical acceleration of the object in m/s^2, float Output: 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_mechanical_work(force, distance, angle): '''Calculate the mechanical work done by a force over a distance. Inputs: force: magnitude of the force in Newtons, float distance: displacement distance in meters, float angle: angle between force and displacement in radians, 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 calculate_climbing_work(mass, distance, g): '''Calculate the total work needed for a person to climb a vertical distance. Inputs: mass: mass of the person in kg, float distance: vertical distance climbed in meters, float g: acceleration due to gravity in m/s^2, float Output: total_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: NEXT STEP - PROBLEM ...
def combustion_coefficients(x, y): '''Determine the stoichiometric coefficients for the combustion of CxHy. Inputs: x: number of carbon atoms, int y: number of hydrogen atoms, int Outputs: coeff_CO2: moles of CO2 produced, float coeff_H2O: moles of H2O produced, float coeff_O2: moles of ...
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 enthalpy_of_combustion(coeff_CO2, coeff_H2O, Hf_CO2, Hf_H2O, Hf_hydrocarbon): '''Calculate the standard enthalpy of combustion. Inputs: coeff_CO2: moles of CO2 produced, float coeff_H2O: moles of H2O produced, float Hf_CO2: standard enthalpy of formation of CO2 in kJ/mol, float Hf_H2O: stand...
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_problem(Hf_ethylbenzene, Hf_CO2, Hf_H2O): '''Calculate the standard enthalpy of combustion of ethylbenzene. Inputs: Hf_ethylbenzene: standard enthalpy of formation of ethylbenzene in kJ/mol, float Hf_CO2: standard enthalpy of formation of CO2(g) in kJ/mol, float Hf_H2O: standard enthalpy 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_gravitational_force(mass, gravity): '''Compute the gravitational force on an object. Inputs: mass: mass of the object in kg, float gravity: acceleration due to gravity in m/s^2, float Output: force: gravitational force in Newtons, float ''' force = mass * gravity 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_work_done(force, distance): '''Calculate the mechanical work done by a force over a distance. Inputs: force: applied force in Newtons, float distance: vertical distance in meters, float Output: work: work done in Joules, float ''' work = float(force * distance) return 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 calculate_climbing_work_moon(mass, distance, gravity): '''Calculate the total work needed to climb a distance under specific gravity. Inputs: mass: mass of the person in kg, float distance: vertical distance climbed in meters, float gravity: local 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_thermometer_constant(pressure_ref, temp_ref): '''Compute the thermometer constant (pressure to temperature ratio). Inputs: pressure_ref: pressure at the reference temperature, float temp_ref: reference temperature, float Output: thermometer_constant: ratio of pressure to temperature,...
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_pressure_change(thermometer_constant, delta_temp): '''Compute the change in pressure for a given temperature change. Inputs: thermometer_constant: ratio of pressure to temperature, float delta_temp: change in temperature, float Output: delta_pressure: change in pressure, 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 solve_pressure_change(pressure_ref, temp_ref, delta_temp): '''Solve for the change in pressure given a change in temperature. Inputs: pressure_ref: pressure at the reference temperature in kPa, float temp_ref: reference temperature in K, float delta_temp: change in temperature in K, float Ou...
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_units(mass_kg, temp_hot_c, temp_cold_c): '''Convert mass to grams and temperatures to Kelvin. Inputs: mass_kg: mass in kg, float temp_hot_c: hot temperature in Celsius, float temp_cold_c: cold temperature in Celsius, float Outputs: mass_g: mass in grams, float temp_hot_k: hot...
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_final_temperature(temp_hot_k, temp_cold_k): '''Calculate the final equilibrium temperature of two identical blocks. Inputs: temp_hot_k: initial temperature of the hot block in Kelvin, float temp_cold_k: initial temperature of the cold block in Kelvin, float Outputs: temp_final_k: fin...
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_entropy_change(mass_g, temp_hot_k, temp_cold_k, temp_final_k, specific_heat_j_g_k): '''Calculate the total entropy change of the two blocks. Inputs: mass_g: mass of each block in grams, float temp_hot_k: initial temperature of the hot block in Kelvin, float temp_cold_k: initial tem...
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(mass_kg, temp_hot_c, temp_cold_c, specific_heat_j_g_k): '''Calculate the total entropy change when two copper blocks are placed in contact. Inputs: mass_kg: mass of each copper block in kg, float temp_hot_c: initial temperature of the hot block in Celsius, float temp_cold_c: initia...
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_adiabatic_factor(v_initial, v_final, gamma): '''Compute the adiabatic pressure factor for a reversible adiabatic process. Inputs: v_initial: initial volume, float v_final: final volume, float gamma: heat capacity ratio, float Output: adiabatic_factor: ratio of final to initial pr...
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_final_pressure(p_initial, adiabatic_factor): '''Compute the final pressure using the initial pressure and the adiabatic factor. Inputs: p_initial: initial pressure, float adiabatic_factor: ratio of final to initial pressure, float Output: final_pressure: final pressure in the same un...
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 adiabatic_expansion_pressure(p_initial, v_initial, v_final, gamma): '''Calculate the final pressure of a gas undergoing reversible adiabatic expansion. Inputs: p_initial: initial pressure in kPa, float v_initial: initial volume in dm^3, float v_final: final volume in dm^3, float gamma: heat ...
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_entropy_change(delta_h, delta_g1, t1): '''Calculate the standard entropy of reaction. Inputs: delta_h: standard enthalpy of reaction in kJ/mol, float delta_g1: standard Gibbs energy of reaction at T1 in kJ/mol, float t1: initial temperature in Kelvin, float Output: delta_s: stand...
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_new_gibbs_energy(delta_h, delta_s, t2_celsius): '''Estimate the standard Gibbs energy at a new temperature. Inputs: delta_h: standard enthalpy of reaction in kJ/mol, float delta_s: standard entropy of reaction in kJ/(K*mol), float t2_celsius: new temperature in degrees Celsius, 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 compute_additional_work(delta_g1, delta_g2): '''Calculate the additional non-expansion work obtained. Inputs: delta_g1: standard Gibbs energy at T1 in kJ/mol, float delta_g2: standard Gibbs energy at T2 in kJ/mol, float Output: additional_work: difference in Gibbs energy in kJ/mol, 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 solve_problem(delta_h, delta_g1, t1, t2_celsius): '''Solve for the additional non-expansion work obtained by raising the temperature. Inputs: delta_h: standard enthalpy of combustion at T1 in kJ/mol, float delta_g1: standard Gibbs energy of combustion at T1 in kJ/mol, float t1: initial temperatu...
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_molar_heat_capacity_pressure(q, n, delta_T): '''Compute the molar heat capacity at constant pressure. Inputs: q: heat supplied at constant pressure in Joules, float n: amount of substance in moles, float delta_T: increase in temperature in Kelvin, float Output: C_p_m: molar heat ...
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_molar_heat_capacity_volume(C_p_m, R): '''Compute the molar heat capacity at constant volume for a perfect gas. Inputs: C_p_m: molar heat capacity at constant pressure in J/(K*mol), float R: universal gas constant in J/(K*mol), float Output: C_v_m: molar heat capacity at constant volu...
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_molar_heat_capacity(q, n, delta_T, R): '''Calculate the molar heat capacity at constant volume for a perfect gas. Inputs: q: heat supplied at constant pressure in Joules, float n: amount of substance in moles, float delta_T: increase in temperature in Kelvin, float R: universal gas con...
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_moles(mass, molar_mass): '''Calculate the amount of substance in moles. Inputs: mass: mass of the sample in grams, float molar_mass: molar mass of the substance in g/mol, float Output: n_moles: amount of substance in moles, float ''' n_moles = float(mass) / float(molar_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 ca...
def compute_molar_volume(volume, n_moles): '''Compute the molar volume of the gas. Inputs: volume: total volume of the gas in dm^3, float n_moles: amount of substance in moles, float Output: molar_volume: volume per mole in dm^3/mol, float ''' if n_moles == 0: raise ValueError("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: Write a function to ca...
def calculate_vdw_pressure(temperature_c, molar_volume, a, b, R): '''Calculate the pressure using the van der Waals equation. Inputs: temperature_c: temperature in degrees Celsius, float molar_volume: molar volume in dm^3/mol, float a: van der Waals constant a, float b: van der Waals constant 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 ca...
def solve_xenon_vdw_pressure(mass, volume, temperature_c, molar_mass, a, b, R): '''Calculate the final pressure of the xenon gas. Inputs: mass: mass of the gas in grams, float volume: volume of the vessel in dm^3, float temperature_c: temperature in degrees Celsius, float molar_mass: molar 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: NEXT STEP - PROBLEM ...
def compute_cubic_coefficients(p, T, a, b, R): '''Compute the coefficients of the van der Waals cubic equation. Inputs: p: pressure, float T: temperature, float a: van der Waals parameter a, float b: van der Waals parameter b, float R: gas constant, float Output: coefficients of the cubi...
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_molar_volume(coefficients): '''Solve the cubic equation to find the molar volume of the gas phase. Inputs: coefficients: coefficients of the cubic equation [c3, c2, c1, c0], list of floats Output: molar volume of the gas phase, float ''' roots = np.roots(coefficients) real_roots = ...
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 van_der_waals_molar_volume(T, p, a, b, R): '''Estimate the molar volume of a van der Waals gas. Inputs: T: temperature, float p: pressure, float a: van der Waals parameter a, float b: van der Waals parameter b, float R: gas constant, float Output: molar volume of the gas, 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_molar_mass(n_C, n_H, n_O): '''Compute the molar mass of a compound containing C, H, and O. Inputs: n_C: number of carbon atoms, int n_H: number of hydrogen atoms, int n_O: number of oxygen atoms, int Output: molar_mass: molar mass in g/mol, float ''' molar_mass = float(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: Write a function to ca...
def compute_calorimeter_heat_capacity(mass_mg, molar_mass, delta_H_c, temp_rise): '''Compute the heat capacity of the calorimeter. Inputs: mass_mg: mass of the calibration substance in mg, float molar_mass: molar mass of the calibration substance in g/mol, float delta_H_c: standard enthalpy of combu...
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_temperature_rise(mass_mg, molar_mass, delta_H_c, heat_capacity): '''Compute the temperature rise for the combustion of a substance. Inputs: mass_mg: mass of the substance in mg, float molar_mass: molar mass of the substance in g/mol, float delta_H_c: standard enthalpy of combustion 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: Write a function to ca...
def solve_problem(mass_naphthalene_mg, temp_rise_naphthalene, mass_phenol_mg, delta_H_c_naphthalene, delta_H_c_phenol): '''Solve for the temperature rise when phenol is burned. Inputs: mass_naphthalene_mg: mass of naphthalene burned in mg, float temp_rise_naphthalene: temperature rise when naphthalene 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 hess_law_enthalpy(dH1, dH2): '''Calculate the standard enthalpy of reaction (3) using Hess's Law. Inputs: dH1: standard enthalpy of reaction (1) in kJ/mol, float dH2: standard enthalpy of reaction (2) in kJ/mol, float Output: dH3: standard enthalpy of reaction (3) in kJ/mol, 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 gas_mole_change(stoich_reactants, stoich_products): '''Calculate the change in the number of moles of gas for a reaction. Inputs: stoich_reactants: list of stoichiometric coefficients of gaseous reactants, list of floats stoich_products: list of stoichiometric coefficients of gaseous products, list ...
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 enthalpy_to_internal_energy(dH, delta_nu_g, T): '''Calculate the standard internal energy of reaction from enthalpy. Inputs: dH: standard enthalpy of reaction in kJ/mol, float delta_nu_g: change in the number of moles of gas, float T: temperature in Kelvin, float Output: dU: standard int...
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 reaction_internal_energy(dH1, dH2, stoich_reactants, stoich_products, T): '''Determine the standard internal energy of reaction (3). Inputs: dH1: standard enthalpy of reaction (1) in kJ/mol, float dH2: standard enthalpy of reaction (2) in kJ/mol, float stoich_reactants: list of stoichiometric 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 mass_frac_to_partial_pressures(mass_frac_N2, mass_frac_O2, P_total): '''Convert mass fractions to partial pressures. Inputs: mass_frac_N2: mass fraction of nitrogen, float mass_frac_O2: mass fraction of oxygen, float P_total: total pressure, float Outputs: P_N2: partial pressure of nitro...
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_height(mass_frac_N2_0, mass_frac_O2_0, mass_frac_N2_h, mass_frac_O2_h, T_C, P0_atm): '''Calculate the height where the specified composition is reached. Inputs: mass_frac_N2_0: mass fraction of nitrogen at sea level, float mass_frac_O2_0: mass fraction of oxygen at sea level, float mas...
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_total_pressure_at_height(h, P_N2_0, P_O2_0, T_C): '''Calculate the total pressure at height h. Inputs: h: height in meters, float P_N2_0: partial pressure of nitrogen at sea level, float P_O2_0: partial pressure of oxygen at sea level, float T_C: temperature in Celsius, 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_atmosphere_problem(mass_frac_N2_0, mass_frac_O2_0, mass_frac_N2_h, mass_frac_O2_h, T_C, P0_atm): '''Solve for the height and total pressure where the atmosphere reaches a specific composition. Inputs: mass_frac_N2_0: mass fraction of nitrogen at sea level, float mass_frac_O2_0: mass fraction 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 convert_celsius_to_kelvin(temp_c): '''Convert temperature from Celsius to Kelvin. Inputs: temp_c: Temperature in degrees Celsius, float Outputs: temp_k: Temperature in Kelvin, float ''' temp_k = float(temp_c) + 273.15 return temp_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 compute_mb_parameters(temp_k, molar_mass, gas_constant): '''Compute the Maxwell-Boltzmann distribution parameters a and N. Inputs: temp_k: Absolute temperature in Kelvin, float molar_mass: Molar mass of the gas in kg/mol, float gas_constant: Ideal gas constant in J/(K*mol), 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 compute_mean_speed_from_params(a, N): '''Compute the mean speed using the distribution parameters. Inputs: a: Exponent factor, float N: Normalization constant, float Outputs: mean_speed: Mean speed of the molecules in m/s, float ''' mean_speed = N / (2.0 * a**2) return mean_speed
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_n2_mean_speed(temp_c, molar_mass, gas_constant): '''Calculate the mean speed of N2 molecules given the temperature in Celsius. Inputs: temp_c: Temperature in degrees Celsius, float molar_mass: Molar mass of the gas in kg/mol, float gas_constant: Ideal gas constant in J/(K*mol), 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_units(T_C, x_half_cm): '''Convert temperature to Kelvin and distance to meters. Inputs: T_C: temperature in degrees Celsius, float x_half_cm: half-distance in centimeters, float Outputs: T_K: temperature in Kelvin, float x_half_m: half-distance in meters, float ''' T_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 compute_decay_constant(x_half_m): '''Compute the decay constant from the half-distance. Inputs: x_half_m: half-distance in meters, float Outputs: lambda_decay: decay constant in meters, float ''' import math lambda_decay = x_half_m / math.log(2) return lambda_decay
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_thermodynamic_force(T_K, lambda_decay): '''Calculate the thermodynamic force in kN/mol. Inputs: T_K: temperature in Kelvin, float lambda_decay: decay constant in meters, float Outputs: force_kN: thermodynamic force in kN/mol, float ''' R = 8.3145 force_kN = (R * T_K) / (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: Write a function to co...
def thermodynamic_force_exponential_decay(T_C, x_half_cm): '''Calculate the thermodynamic force on a solute with an exponentially decaying concentration. Inputs: T_C: temperature in degrees Celsius, float x_half_cm: half-distance in centimeters, float Outputs: final_force: thermodynamic force 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 convert_celsius_to_kelvin(t_celsius): '''Convert temperature from Celsius to Kelvin. Inputs: t_celsius: temperature in degrees Celsius, float Output: t_kelvin: temperature in Kelvin, float ''' t_kelvin = t_celsius + 273.15 return t_kelvin
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_volume_ratio(v_initial, v_final): '''Compute the ratio of initial to final volume. Inputs: v_initial: initial volume of the gas, float v_final: final volume of the gas after expansion, float Output: v_ratio: ratio of initial to final volume, float ''' v_ratio = v_initial / 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 co...
def compute_expansion_gibbs(n_moles, t_kelvin, v_ratio): '''Calculate the Gibbs energy change for isothermal expansion of an ideal gas. Inputs: n_moles: amount of gas in moles, float t_kelvin: absolute temperature in Kelvin, float v_ratio: ratio of initial to final volume, float Output: 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 calculate_total_mixing_gibbs(n_h2, n_n2, t_celsius): '''Calculate the total Gibbs energy of mixing in kJ. Inputs: n_h2: amount of hydrogen gas in moles, float n_n2: amount of nitrogen gas in moles, float t_celsius: temperature in degrees Celsius, float Output: delta_g_mix_kj: total Gibbs...
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_to_si(pressure_bar, density_c_g_cm3, density_a_g_cm3, molar_mass_g_mol): '''Convert pressure, densities, and molar mass to SI units. Inputs: pressure_bar: pressure in bar, float density_c_g_cm3: density of calcite in g/cm^3, float density_a_g_cm3: density of aragonite in g/cm^3, 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_molar_volumes(density_c_kg_m3, density_a_kg_m3, molar_mass_kg_mol): '''Compute the molar volumes of calcite and aragonite. Inputs: density_c_kg_m3: density of calcite in kg/m^3, float density_a_kg_m3: density of aragonite in kg/m^3, float molar_mass_kg_mol: molar mass in kg/mol, 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_enthalpy_internal_energy_diff(pressure_pa, molar_volume_c, molar_volume_a): '''Compute the difference between molar enthalpy and internal energy changes. Inputs: pressure_pa: pressure in Pa, float molar_volume_c: molar volume of calcite in m^3/mol, float molar_volume_a: molar volume of 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 solve_problem(pressure_bar, density_c_g_cm3, density_a_g_cm3, molar_mass_g_mol): '''Solve for the difference between molar enthalpy and internal energy changes. Inputs: pressure_bar: pressure in bar, float density_c_g_cm3: density of calcite in g/cm^3, float density_a_g_cm3: density of aragonite...
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_real_gas_gibbs_term(temperature, pressure, fugacity_coefficient, gas_constant, standard_pressure): '''Compute the molar Gibbs energy term for a real gas relative to the standard state. Inputs: temperature: temperature in Kelvin, float pressure: pressure in bar, float fugacity_coefficient...
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_perfect_gas_gibbs_term(temperature, pressure, gas_constant, standard_pressure): '''Compute the molar Gibbs energy term for a perfect gas relative to the standard state. Inputs: temperature: temperature in Kelvin, float pressure: pressure in bar, float gas_constant: universal gas constant...
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_gibbs_difference(real_term, perfect_term, conversion_factor): '''Compute the difference in molar Gibbs energy and convert to kilojoules. Inputs: real_term: molar Gibbs energy term for real gas in J/mol, float perfect_term: molar Gibbs energy term for perfect gas in J/mol, float conversio...
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_molar_gibbs_difference(temperature, pressure, fugacity_coefficient, gas_constant, standard_pressure, conversion_factor): '''Calculate the difference of the molar Gibbs energy from that of a perfect gas. Inputs: temperature: temperature in Kelvin, float pressure: pressure in bar, 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_reciprocal_squared(a, b, c): '''Compute the squared reciprocal lattice parameters. Inputs: a: lattice parameter a in nm, float b: lattice parameter b in nm, float c: lattice parameter c in nm, float Outputs: recip_sq_a: 1/a^2 in nm^-2, float recip_sq_b: 1/b^2 in nm^-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: Write a function to co...
def compute_interplanar_spacing(recip_sq_a, recip_sq_b, recip_sq_c, h, k, l): '''Calculate the interplanar spacing d_hkl. Inputs: recip_sq_a: 1/a^2 in nm^-2, float recip_sq_b: 1/b^2 in nm^-2, float recip_sq_c: 1/c^2 in nm^-2, float h: Miller index h, int k: Miller index k, int l: Miller ...
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_orthorhombic_spacing(a, b, c, h, k, l): '''Solve for the interplanar spacing of an orthorhombic unit cell. Inputs: a: lattice parameter a in nm, float b: lattice parameter b in nm, float c: lattice parameter c in nm, float h: Miller index h, int k: Miller index k, int l: Miller...
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_units(bond_length_pm, bond_angle_deg): '''Convert bond length to meters and bond angle to radians. Inputs: bond_length_pm: bond length in picometers, float bond_angle_deg: bond angle in degrees, float Outputs: bond_length_m: bond length in meters, float bond_angle_rad: bond angle...
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_perpendicular_distance(bond_length_m, bond_angle_rad): '''Calculate the perpendicular distance from the H atoms to the angle bisector. Inputs: bond_length_m: bond length in meters, float bond_angle_rad: bond angle in radians, float Outputs: distance_m: perpendicular distance in meter...
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_moment_of_inertia(distance_m, mass_h_kg): '''Calculate the moment of inertia of the molecule. Inputs: distance_m: perpendicular distance of H atoms from the axis in meters, float mass_h_kg: mass of a hydrogen atom in kilograms, float Outputs: moment_of_inertia: total moment of inerti...
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_h2o_inertia(bond_length_pm, bond_angle_deg, mass_h_kg): '''Calculate the moment of inertia of an H2O molecule around the HOH bisector. Inputs: bond_length_pm: bond length in picometers, float bond_angle_deg: bond angle in degrees, float mass_h_kg: mass of a hydrogen atom in kilograms, floa...
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 transform_data(T_array, K_array): '''Transform temperature and equilibrium constant data for a van 't Hoff plot. Inputs: T_array: temperatures in Kelvin, list or numpy array of floats K_array: equilibrium constants, list or numpy array of floats Outputs: inv_T: reciprocal temperatures (1/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 tr...
def calculate_slope(inv_T, ln_K): '''Calculate the slope of the linear regression line for ln K vs 1/T. Inputs: inv_T: reciprocal temperatures (1/T), numpy array of floats ln_K: natural logarithm of equilibrium constants, numpy array of floats Outputs: slope: slope of the best-fit line, 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 tr...
def compute_enthalpy(slope): '''Compute the standard reaction enthalpy from the van 't Hoff plot slope. Inputs: slope: slope of the ln K vs 1/T plot, float Outputs: enthalpy: standard reaction enthalpy in kJ/mol, float ''' R = 8.314 # Ideal gas constant in J/(K*mol) enthalpy = -slope * ...
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 tr...
def standard_reaction_enthalpy(T_array, K_array): '''Calculate the standard reaction enthalpy from temperature and equilibrium constant data. Inputs: T_array: temperatures in Kelvin, list or numpy array of floats K_array: equilibrium constants, list or numpy array of floats Outputs: enthalpy: st...
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): '''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.602e-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 co...
def calculate_decay_constant(energy_joules): '''Calculate the decay constant kappa for the electron wavefunction. Inputs: energy_joules: energy barrier V - E in Joules, float Output: kappa: decay constant in m^-1, float ''' import math if energy_joules <= 0.0: return 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 calculate_current_ratio(kappa, L1_nm, L2_nm): '''Calculate the ratio of tunnelling currents for two different gap distances. Inputs: kappa: decay constant in m^-1, float L1_nm: initial distance in nanometers, float L2_nm: final distance in nanometers, float Output: current_ratio: ratio 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 stm_current_drop_factor(energy_ev, L1_nm, L2_nm): '''Calculate the factor by which the STM tunnelling current drops. Inputs: energy_ev: energy barrier V - E in electron-volts, float L1_nm: initial distance in nanometers, float L2_nm: final distance in nanometers, float Output: current_ra...
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_hole_area(diameter): '''Compute the area of a circular hole. Inputs: diameter: diameter of the hole in meters, float Output: area: area of the hole in square meters, float ''' import math area = math.pi * (diameter ** 2) / 4.0 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 ca...
def compute_mass_flux(mass_loss, area, time): '''Compute the mass flux of the escaping gas. Inputs: mass_loss: mass loss in kilograms, float area: area of the hole in square meters, float time: duration in seconds, float Output: mass_flux: mass flux in kg/(m^2 s), float ''' if 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 ca...
def compute_vapour_pressure(mass_flux, temperature, molar_mass): '''Compute the vapour pressure of the gas. Inputs: mass_flux: mass flux in kg/(m^2 s), float temperature: temperature in Kelvin, float molar_mass: molar mass in kg/mol, float Output: pressure: vapour pressure in Pascals, 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 caesium_vapour_pressure(diameter, time, mass_loss, temperature, molar_mass): '''Calculate the vapour pressure of liquid caesium from effusion data. Inputs: diameter: diameter of the hole in meters, float time: duration the hole was opened in seconds, float mass_loss: mass loss measured in kilogr...
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_thermal_momentum(mass, temp, k_b): '''Calculate the thermal momentum of a particle in one dimension. Inputs: mass: mass of the particle in kg, float temp: absolute temperature in Kelvin, float k_b: Boltzmann constant in J/K, float Outputs: momentum: thermal momentum in kg*m/s, 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 compute_de_broglie_wavelength(momentum, h): '''Calculate the de Broglie wavelength of a particle. Inputs: momentum: momentum of the particle in kg*m/s, float h: Planck constant in J*s, float Outputs: wavelength_m: de Broglie wavelength in meters, float ''' if momentum == 0: 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 convert_meters_to_picometers(wavelength_m): '''Convert a length from meters to picometers. Inputs: wavelength_m: length in meters, float Outputs: wavelength_pm: length in picometers, float ''' wavelength_pm = float(wavelength_m * 1e12) return wavelength_pm
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 thermal_neutron_wavelength(temp): '''Calculate the typical de Broglie wavelength of thermal neutrons at a given temperature. Inputs: temp: absolute temperature in Kelvin, float Outputs: wavelength_pm: typical de Broglie wavelength in picometers, float ''' m = 1.675e-27 k_B = 1.381e-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: NEXT STEP - PROBLEM ...
def calculate_reaction_heat_capacity(cp_h2o, cp_h2, cp_o2): '''Calculate the change in molar heat capacity for the formation of H2O(g). Inputs: cp_h2o: molar heat capacity of H2O(g) in J/(K mol), float cp_h2: molar heat capacity of H2(g) in J/(K mol), float cp_o2: molar heat capacity of O2(g) in J/(...
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_temperature_change(t1_k, t2_c): '''Calculate the temperature difference in Kelvin. Inputs: t1_k: initial temperature in Kelvin, float t2_c: final temperature in Celsius, float Output: delta_t: temperature difference in Kelvin, float ''' t2_k = t2_c + 273.15 delta_t = t2...