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_heat_transfer(n_moles, T_initial, T_final, Cv_m): '''Compute the heat transferred during a reversible adiabatic process. Inputs: n_moles: amount of substance in moles, float T_initial: initial temperature in Kelvin, float T_final: final temperature in Kelvin, float Cv_m: molar consta...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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(n_moles, T_initial, T_final, Cv_m): '''Solve for the heat transferred during the reversible adiabatic compression. Inputs: n_moles: amount of substance in moles, float T_initial: initial temperature in Kelvin, float T_final: final temperature in Kelvin, float Cv_m: molar consta...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_gas_mole_change(moles_gas_products, moles_gas_reactants): '''Calculate the change in the number of moles of gas for a reaction. Inputs: moles_gas_products: total moles of gaseous products, float moles_gas_reactants: total moles of gaseous reactants, float Output: delta_nu_g: change...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_enthalpy_internal_energy_diff(delta_nu_g, temperature): '''Compute the difference between enthalpy and internal energy for a reaction. Inputs: delta_nu_g: change in moles of gas, float temperature: temperature in Kelvin, float Output: energy_diff: difference in energy in kJ/mol, 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 calculate_reaction_enthalpy(delta_u, energy_diff): '''Calculate the standard reaction enthalpy. Inputs: delta_u: standard internal energy of reaction in kJ/mol, float energy_diff: difference between enthalpy and internal energy in kJ/mol, float Output: delta_h: standard reaction enthalpy 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 solve_enthalpy_problem(moles_gas_products, moles_gas_reactants, temperature, delta_u): '''Solve for the standard reaction enthalpy of the combustion reaction. Inputs: moles_gas_products: number of moles of gaseous products, float moles_gas_reactants: number of moles of gaseous reactants, float t...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def calculate_volume_change(V_initial, V_final): '''Calculate the change in volume. Inputs: V_initial: initial volume, float V_final: final volume, float Output: delta_V: change in volume, float ''' delta_V = float(V_final - V_initial) return delta_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 calculate_expansion_work(delta_V): '''Compute the expansion work done on the system. Inputs: delta_V: change in volume, float Output: w: work done, float ''' w = 0.0 return w
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_work(n, V, T_initial, q, T_final): '''Calculate the work done on the CO2 sample. Inputs: n: amount of substance in moles, float V: fixed volume in dm^3, float T_initial: initial temperature in K, float q: heat supplied in kJ, float T_final: final temperature in K, 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: NEXT STEP - PROBLEM ...
def convert_pressure_kpa_to_pa(pressure_kpa): '''Convert pressure from kPa to Pa. Inputs: pressure_kpa: pressure in kilopascals, float Output: pressure_pa: pressure in Pascals, float ''' pressure_pa = float(pressure_kpa) * 1000.0 return pressure_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 co...
def calculate_molar_volume(temperature, pressure_pa): '''Calculate the molar volume of an ideal gas. Inputs: temperature: absolute temperature in Kelvin, float pressure_pa: pressure in Pascals, float Output: molar_volume: molar volume in m^3/mol, float ''' R = 8.314 molar_volume = (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 co...
def compute_molar_mass(density, molar_volume): '''Compute the molar mass of the gas in g/mol. Inputs: density: density of the gas in kg/m^3, float molar_volume: molar volume in m^3/mol, float Output: molar_mass_g: molar mass in g/mol, float ''' molar_mass_g = density * molar_volume * 100...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_gas_molar_mass(density, temperature, pressure_kpa): '''Determine the molar mass of a gaseous compound. Inputs: density: density of the gas in kg/m^3, float temperature: absolute temperature in Kelvin, float pressure_kpa: pressure of the gas in kPa, float Output: final_molar_mass: 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_initial_state(mass, molar_mass, v_initial_dm3, temperature): '''Compute the initial state of the ideal gas. Inputs: mass: mass of the gas in grams, float molar_mass: molar mass of the gas in g/mol, float v_initial_dm3: initial volume in dm^3, float temperature: temperature in 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_final_state(n_moles, v_initial_m3, v_increase_dm3, temperature): '''Compute the final state of the gas after expansion. Inputs: n_moles: number of moles, float v_initial_m3: initial volume in m^3, float v_increase_dm3: volume increase in dm^3, float temperature: temperature in 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_reversible_work(n_moles, temperature, v_initial_m3, v_final_m3): '''Calculate the work done during reversible isothermal expansion. Inputs: n_moles: number of moles, float temperature: temperature in Kelvin, float v_initial_m3: initial volume in m^3, float v_final_m3: final volume in...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def solve_expansion_work(mass, molar_mass, v_initial_dm3, v_increase_dm3, temperature): '''Solve for the work done during the reversible expansion of the gas. Inputs: mass: mass of the gas in grams, float molar_mass: molar mass of the gas in g/mol, float v_initial_dm3: initial volume in dm^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: NEXT STEP - PROBLEM ...
def calculate_moles_h2(mass_mg, molar_mass_mg): '''Calculate the moles of hydrogen gas produced. Inputs: mass_mg: mass of magnesium in grams, float molar_mass_mg: molar mass of magnesium in g/mol, float Output: moles_h2: moles of hydrogen gas, float ''' moles_h2 = float(mass_mg) / 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 calculate_expansion_work(moles_h2, temp_celsius, r_const): '''Calculate the expansion work in Joules. Inputs: moles_h2: moles of hydrogen gas, float temp_celsius: temperature in degrees Celsius, float r_const: ideal gas constant in J/(mol K), float Output: work_joules: work done by the s...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def solve_work_done(mass_mg, temp_celsius, molar_mass_mg, r_const): '''Compute the total work done by the system in kilojoules. Inputs: mass_mg: mass of magnesium in grams, float temp_celsius: temperature in degrees Celsius, float molar_mass_mg: molar mass of magnesium in g/mol, float r_const: 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 convert_vdw_constant_a(a_vdw): '''Convert van der Waals constant a to SI units. Inputs: a_vdw: van der Waals constant a in dm^6 atm mol^-2, float Outputs: a_si: van der Waals constant a in J m^3 mol^-2, float ''' a_si = a_vdw * 101325.0 * 1e-6 return a_si
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def convert_volumes(v_initial_dm3, v_final_dm3): '''Convert volumes from dm^3 to m^3. Inputs: v_initial_dm3: initial volume in dm^3, float v_final_dm3: final volume in dm^3, float Outputs: v_initial_m3: initial volume in m^3, float v_final_m3: final volume in m^3, float ''' v_initial...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_delta_u_m(a_si, v_initial_m3, v_final_m3): '''Calculate the change in molar internal energy for an isothermal expansion. Inputs: a_si: van der Waals constant a in J m^3 mol^-2, float v_initial_m3: initial molar volume in m^3, float v_final_m3: final molar volume in m^3, 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 solve_problem(initial_volume_dm3, final_volume_dm3, a_vdw): '''Solve for the change in molar internal energy of a van der Waals gas. Inputs: initial_volume_dm3: initial volume in dm^3, float final_volume_dm3: final volume in dm^3, float a_vdw: van der Waals constant a in dm^6 atm mol^-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 joule_thomson_coeff(a, b, T, R, Cp_m): '''Calculate the Joule-Thomson coefficient for a van der Waals gas. Inputs: a: van der Waals parameter a, float b: van der Waals parameter b, float T: temperature, float R: gas constant, float Cp_m: molar heat capacity at constant 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 ca...
def isothermal_jt_coeff(mu, Cp_m): '''Calculate the isothermal Joule-Thomson coefficient. Inputs: mu: Joule-Thomson coefficient, float Cp_m: molar heat capacity at constant pressure, float Output: mu_T: isothermal Joule-Thomson coefficient, float ''' mu_T = -Cp_m * mu return mu_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 ca...
def enthalpy_change_kJ(mu_T, p1, p2): '''Calculate the molar enthalpy change in kJ/mol. Inputs: mu_T: isothermal Joule-Thomson coefficient in dm^3/mol, float p1: initial pressure in atm, float p2: final pressure in atm, float Output: delta_H_kJ: molar enthalpy change 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(a, b, p1, p2, T): '''Calculate the molar enthalpy change for a van der Waals gas. Inputs: a: van der Waals parameter a in dm^6 atm mol^-2, float b: van der Waals parameter b in dm^3 mol^-1, float p1: initial pressure in atm, float p2: final pressure in atm, float T: tempera...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 molar_heat_capacity_monatomic(R): '''Calculate the constant-volume molar heat capacity for a monatomic perfect gas. Inputs: R: universal gas constant in J K^-1 mol^-1, float Output: C_v_m: constant-volume molar heat capacity in J K^-1 mol^-1, float ''' C_v_m = 1.5 * R return C_v_m
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to ca...
def entropy_change_constant_volume(C_v_m, T1, T2): '''Calculate the change in molar entropy for a constant-volume process. Inputs: C_v_m: constant-volume molar heat capacity in J K^-1 mol^-1, float T1: initial temperature in Kelvin, float T2: final temperature in Kelvin, float Output: delta_...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 final_molar_entropy(T1, T2, S1): '''Calculate the final molar entropy of a monatomic perfect gas at constant volume. Inputs: T1: initial temperature in Kelvin, float T2: final temperature in Kelvin, float S1: initial molar entropy at T1 in J K^-1 mol^-1, float Output: S2: final molar ent...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_heat_capacity_ratio(): '''Compute the heat capacity ratio for a monatomic perfect gas. Inputs: None Outputs: gamma: heat capacity ratio, float ''' gamma = 5.0 / 3.0 return gamma
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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(initial_temperature, initial_volume, final_volume, gamma): '''Calculate the final temperature after a reversible adiabatic expansion. Inputs: initial_temperature: initial temperature in K, float initial_volume: initial volume, float final_volume: final volume, 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_adiabatic_expansion(mass, initial_volume, initial_temperature, final_volume): '''Calculate the final temperature of an argon gas sample after reversible adiabatic expansion. Inputs: mass: mass of the argon sample in grams, float initial_volume: initial volume in dm^3, float initial_tempera...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_temperature(T_C): '''Convert temperature from Celsius to Kelvin. Inputs: T_C: temperature in degrees Celsius, float Output: temperature in Kelvin, float ''' T_K = T_C + 273.15 return 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 convert_heat(q_kJ): '''Convert heat from kilojoules to joules. Inputs: q_kJ: heat in kilojoules, float Output: heat in joules, float ''' q_J = q_kJ * 1000.0 return q_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 co...
def calculate_entropy_change(q_J, T_K): '''Calculate the entropy change for a reversible isothermal process. Inputs: q_J: heat transferred reversibly in joules, float T_K: absolute temperature in Kelvin, float Output: entropy change in J/K, float ''' delta_S = q_J / T_K return delta_S
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def entropy_change_iron_block(q_kJ, T_C): '''Calculate the change in entropy of the iron block. Inputs: q_kJ: heat transferred in kilojoules, float T_C: temperature of the iron block in degrees Celsius, float Output: change in entropy in J/K, float ''' T_K = convert_temperature(T_C) q_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: NEXT STEP - PROBLEM ...
def calculate_pressure_change(n, V, T1, T2, b, R): '''Calculate the change in pressure for a van der Waals gas at constant volume. Inputs: n: amount of substance in moles, float V: volume in cubic meters, float T1: initial temperature in Kelvin, float T2: final temperature in Kelvin, float 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 calculate_delta_pV(delta_p, V): '''Calculate the change in the pV product at constant volume. Inputs: delta_p: change in pressure in Pascals, float V: volume in cubic meters, float Output: delta_pV: change in pV product in Joules, float ''' delta_pV = delta_p * V return delta_pV
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_delta_H(q_V, delta_pV): '''Calculate the change in enthalpy in kilojoules. Inputs: q_V: heat supplied at constant volume in Joules, float delta_pV: change in pV product in Joules, float Output: delta_H: change in enthalpy in kilojoules, float ''' delta_H = (q_V + delta_pV) ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_change_vdw(n, V, T1, T2, q_V, b, R): '''Calculate the change in enthalpy for a van der Waals gas heated at constant volume. Inputs: n: amount of substance in moles, float V: volume in cubic meters, float T1: initial temperature in Kelvin, float T2: final temperature in Kelvin, 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_joule_thomson_coefficient(dH_dp_T, Cp_m): '''Compute the Joule-Thomson coefficient. Inputs: dH_dp_T: isothermal Joule-Thomson coefficient in J MPa^-1 mol^-1, float Cp_m: molar heat capacity at constant pressure in J K^-1 mol^-1, float Output: mu: Joule-Thomson coefficient in K MPa^-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: Write a function to co...
def solve_problem(dH_dp_T, Cp_m): '''Solve for the Joule-Thomson coefficient of refrigerant 123. Inputs: dH_dp_T: isothermal Joule-Thomson coefficient in J MPa^-1 mol^-1, float Cp_m: molar heat capacity at constant pressure in J K^-1 mol^-1, float Output: mu: Joule-Thomson coefficient in K MPa^-...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_perfect_molar_volume(T, P, R): '''Calculate the perfect gas molar volume. Inputs: T: temperature in Kelvin, float P: pressure in atm, float R: universal gas constant, float Outputs: perfect_molar_volume: ideal molar volume, float ''' if P == 0.0: if T == 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_actual_molar_volume(perfect_molar_volume, reduction_percentage): '''Calculate the actual molar volume given the perfect molar volume and reduction percentage. Inputs: perfect_molar_volume: ideal molar volume, float reduction_percentage: percentage by which the actual volume is smaller, 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 calculate_gas_molar_volume(T, P, reduction_percentage): '''Calculate the actual molar volume of the gas. Inputs: T: temperature in Kelvin, float P: pressure in atm, float reduction_percentage: percentage by which the actual volume is smaller, float Outputs: final_molar_volume: actual mol...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_pressure_change(p_initial, p_final): '''Calculate the change in pressure during expansion. Inputs: p_initial: initial pressure in bar, float p_final: final pressure in bar, float Output: delta_p: change in pressure in bar, float ''' delta_p = float(p_final - p_initial) ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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(delta_p, mu): '''Calculate the temperature change using the Joule-Thomson coefficient. Inputs: delta_p: change in pressure in bar, float mu: Joule-Thomson coefficient in K/bar, float Output: delta_t: temperature change in Kelvin, float ''' delta_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: Write a function to ca...
def adiabatic_expansion_temp_change(n_moles, p_initial, p_final, t_initial, mu): '''Compute the temperature change during adiabatic expansion. Inputs: n_moles: amount of the refrigerant in moles, float p_initial: initial pressure in bar, float p_final: final pressure in bar, float t_initial: ini...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_hot_C, T_cold_C): '''Convert temperatures from Celsius to Kelvin. Inputs: T_hot_C: Temperature of the hot reservoir in degrees Celsius, float T_cold_C: Temperature of the cold reservoir in degrees Celsius, float Outputs: T_hot_K: Temperature of the hot reservoir 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 calculate_carnot_efficiency(T_hot_K, T_cold_K): '''Calculate the Carnot efficiency using absolute temperatures. Inputs: T_hot_K: Temperature of the hot reservoir in Kelvin, float T_cold_K: Temperature of the cold reservoir in Kelvin, float Outputs: efficiency: The Carnot efficiency, 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 steam_turbine_efficiency(T_hot_C, T_cold_C): '''Calculate the Carnot efficiency of a steam turbine from Celsius temperatures. Inputs: T_hot_C: Temperature of the hot reservoir in degrees Celsius, float T_cold_C: Temperature of the cold reservoir in degrees Celsius, float Outputs: efficiency:...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_pressure_change(p_initial, p_final): '''Calculate the change in pressure. Inputs: p_initial: initial pressure in atm, float p_final: final pressure in atm, float Output: delta_p: change in pressure in atm, float ''' delta_p = p_final - p_initial return 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 ca...
def compute_joule_thomson_coefficient(delta_T, delta_p): '''Compute the Joule-Thomson coefficient. Inputs: delta_T: change in temperature in K, float delta_p: change in pressure in atm, float Output: mu: Joule-Thomson coefficient in K/atm, float ''' if delta_p == 0.0: if delta_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 ca...
def solve_problem(p_initial, p_final, temp_fall): '''Calculate the Joule-Thomson coefficient for the given expansion. Inputs: p_initial: initial pressure in atm, float p_final: final pressure in atm, float temp_fall: magnitude of temperature fall in K, float Output: mu: Joule-Thomson coeffic...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_enthalpy_units(enthalpy_vap_kj): '''Convert enthalpy from kJ/mol to J/mol. Inputs: enthalpy_vap_kj: enthalpy of vaporization in kJ/mol, float Outputs: enthalpy_vap_j: enthalpy of vaporization in J/mol, float ''' enthalpy_vap_j = float(enthalpy_vap_kj) * 1000.0 retur...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_surroundings_entropy(enthalpy_vap_j, temperature_k): '''Calculate the entropy change of the surroundings. Inputs: enthalpy_vap_j: enthalpy of vaporization in J/mol, float temperature_k: temperature of the surroundings in Kelvin, float Outputs: entropy_change_surr: entropy c...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_entropy_change(enthalpy_vap_kj, temperature_k): '''Compute the entropy change of the surroundings for the vaporization process. Inputs: enthalpy_vap_kj: enthalpy of vaporization in kJ/mol, float temperature_k: normal boiling point in Kelvin, float Outputs: entropy_c...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_hf_hcl(delta_h1): '''Compute the standard enthalpy of formation of HCl(g). Inputs: delta_h1: standard enthalpy of reaction 1 in kJ/mol, float Outputs: hf_hcl: standard enthalpy of formation of HCl in kJ/mol, float ''' hf_hcl = delta_h1 / 2.0 return hf_hcl
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_hf_h2o(delta_h2): '''Compute the standard enthalpy of formation of H2O(g). Inputs: delta_h2: standard enthalpy of reaction 2 in kJ/mol, float Outputs: hf_h2o: standard enthalpy of formation of H2O in kJ/mol, float ''' hf_h2o = delta_h2 / 2.0 return hf_h2o
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_target_reaction_enthalpy(delta_h1, delta_h2): '''Calculate the standard enthalpy of reaction 3. Inputs: delta_h1: standard enthalpy of reaction 1 in kJ/mol, float delta_h2: standard enthalpy of reaction 2 in kJ/mol, float Outputs: delta_h3: standard enthalpy of reaction 3 in kJ/mol...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 linear_coefficients(pv_0, pv_100): '''Calculate the slope and intercept of the linear relationship between pV and temperature. Inputs: pv_0: value of pV at 0 degrees N, float pv_100: value of pV at 100 degrees N, float Outputs: a: slope of the linear relationship, float b: intercept of 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 ca...
def absolute_zero(a, b): '''Calculate the absolute zero temperature on the Neptunian scale. Inputs: a: slope of the linear relationship, float b: intercept of the linear relationship, float Outputs: abs_zero: absolute zero temperature in degrees N, float ''' abs_zero = -b / a 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 ca...
def solve_neptunian_temperature(pv_0, pv_100): '''Determine the absolute zero of temperature on the Neptunian scale. Inputs: pv_0: value of pV at 0 degrees N, float pv_100: value of pV at 100 degrees N, float Outputs: abs_zero_N: absolute zero on the Neptunian scale in degrees N, 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_heat_to_joules(heat_MJ): '''Convert heat from megajoules to joules. Inputs: heat_MJ: heat in megajoules, float Output: heat_J: heat in joules, float ''' heat_J = heat_MJ * 1e6 return heat_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 co...
def compute_total_heat_capacity(mass_kg, specific_heat_capacity): '''Compute the total heat capacity of an object. Inputs: mass_kg: mass of the object in kilograms, float specific_heat_capacity: specific heat capacity in J/(kg K), float Output: total_heat_capacity: total heat capacity in J/K, fl...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_temperature_rise(heat_J, total_heat_capacity): '''Compute the temperature rise given heat and total heat capacity. Inputs: heat_J: heat added to the system in joules, float total_heat_capacity: total heat capacity of the system in J/K, float Output: temperature_rise: temperature incr...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 body_temperature_rise(heat_MJ, mass_kg, specific_heat_capacity): '''Calculate the temperature rise of a human body modeled as an isolated system. Inputs: heat_MJ: heat produced by the body in megajoules, float mass_kg: mass of the human body in kilograms, float specific_heat_capacity: specific h...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def convert_enthalpy_units(enthalpy_value, current_unit_scale, target_unit_scale): '''Convert enthalpy units based on scale factors. Inputs: enthalpy_value: the numerical value of enthalpy, float current_unit_scale: the scale of the current unit (e.g., 1000 for kJ), float target_unit_scale: the scal...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_entropy_of_vaporization(enthalpy_j_mol, temperature_k, pressure_atm): '''Compute the entropy of vaporization at a given temperature and pressure. Inputs: enthalpy_j_mol: enthalpy of vaporization in J/mol, float temperature_k: boiling temperature in Kelvin, float pressure_atm: pressure in...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def entropy_of_vaporization_chloroform(enthalpy_kj_mol, temperature_k, pressure_atm): '''Calculate the entropy of vaporization of chloroform. Inputs: enthalpy_kj_mol: enthalpy of vaporization in kJ/mol, float temperature_k: normal boiling point in Kelvin, float pressure_atm: pressure in atmospheres,...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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(n_mmol, v_i_cm3, v_f_cm3): '''Convert amount of substance and volumes to standard SI units. Inputs: n_mmol: amount of substance in millimoles, float v_i_cm3: initial volume in cubic centimeters, float v_f_cm3: final volume in cubic centimeters, float Outputs: n_mol: amount ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_free_energy_change(n_mol, v_i_m3, v_f_m3, T): '''Calculate the change in Gibbs free energy for an isothermal expansion. Inputs: n_mol: amount of substance in moles, float v_i_m3: initial volume in cubic meters, float v_f_m3: final volume in cubic meters, float T: absolute tempe...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 gibbs_expansion_process(n_mmol, v_i_cm3, v_f_cm3, T): '''Calculate the change in Gibbs free energy for the expansion process from raw inputs. Inputs: n_mmol: amount of substance in millimoles, float v_i_cm3: initial volume in cubic centimeters, float v_f_cm3: final volume in cubic centimeters, 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: NEXT STEP - PROBLEM ...
def compute_enthalpy_of_reaction(delta_u_reaction, temperature, delta_nu_gas): '''Compute the standard enthalpy of reaction from internal energy of reaction. Inputs: delta_u_reaction: standard internal energy of reaction in kJ/mol, float temperature: temperature in Kelvin, float delta_nu_gas: change...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_enthalpy_of_formation_compound(delta_h_reaction, delta_h_f_benzene_gas): '''Compute the standard enthalpy of formation of the compound. Inputs: delta_h_reaction: standard enthalpy of reaction in kJ/mol, float delta_h_f_benzene_gas: standard enthalpy of formation of gaseous benzene in kJ/mol,...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_u_reaction, temperature, delta_nu_gas, delta_h_f_benzene_gas): '''Estimate the standard enthalpy of formation of the compound at the given temperature. Inputs: delta_u_reaction: standard internal energy of reaction in kJ/mol, float temperature: temperature in Kelvin, float de...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_total_moles(moles_h2, moles_n2): '''Compute the total number of moles in the gas mixture. Inputs: moles_h2: amount of hydrogen gas in moles, float moles_n2: amount of nitrogen gas in moles, float Output: total_moles: total amount of gas in moles, float ''' total_moles = 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_pressure_pa(total_moles, volume_dm3, temperature_k): '''Compute the pressure of an ideal gas in Pascals. Inputs: total_moles: total amount of gas in moles, float volume_dm3: volume of the vessel in cubic decimeters, float temperature_k: temperature in Kelvin, float Output: pressu...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def convert_pa_to_atm(pressure_pa): '''Convert pressure from Pascals to atmospheres. Inputs: pressure_pa: pressure in Pascals, float Output: pressure_atm: pressure in atmospheres, float ''' pressure_atm = pressure_pa / 101325.0 return pressure_atm
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 total_pressure_mixture(moles_h2, moles_n2, volume_dm3, temperature_k): '''Compute the total pressure of a gas mixture in atmospheres. Inputs: moles_h2: amount of hydrogen gas in moles, float moles_n2: amount of nitrogen gas in moles, float volume_dm3: volume of the vessel in cubic decimeters, 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: NEXT STEP - PROBLEM ...
def volume_ratio(temperature, a, b, c): '''Calculate the ratio of the volume at temperature T to the reference volume. Inputs: temperature: The temperature in Kelvin, float a: The constant term in the volume polynomial, float b: The linear coefficient in the volume polynomial, float c: The quadr...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 volume_derivative_ratio(temperature, a, b, c): '''Calculate the derivative of the volume ratio with respect to temperature. Inputs: temperature: The temperature in Kelvin, float a: The constant term in the volume polynomial, float b: The linear coefficient in the volume polynomial, float c: ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 expansion_coefficient(temperature, a, b, c): '''Calculate the expansion coefficient alpha. Inputs: temperature: The temperature in Kelvin, float a: The constant term in the volume polynomial, float b: The linear coefficient in the volume polynomial, float c: The quadratic coefficient in 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: Write a function to ca...
def solve_problem(temperature, a, b, c): '''Solve for the expansion coefficient at the given temperature. Inputs: temperature: The temperature in Kelvin, float a: The constant term in the volume polynomial, float b: The linear coefficient in the volume polynomial, float c: The quadratic coeffici...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_reaction_enthalpy(H_f, nu): '''Compute the standard reaction enthalpy. Inputs: H_f: standard enthalpies of formation in J/mol, list of floats nu: stoichiometric coefficients, list of floats Output: delta_H: standard reaction enthalpy in J/mol, float ''' delta_H = sum(n * h fo...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_reaction_entropy(S_m, nu): '''Compute the standard reaction entropy. Inputs: S_m: standard molar entropies in J/(K mol), list of floats nu: stoichiometric coefficients, list of floats Output: delta_S: standard reaction entropy in J/(K mol), float ''' delta_S = sum(n * s for 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 co...
def compute_gibbs_energy(delta_H, delta_S, T): '''Compute the standard reaction Gibbs energy at temperature T. Inputs: delta_H: standard reaction enthalpy in J/mol, float delta_S: standard reaction entropy in J/(K mol), float T: target temperature in Kelvin, float Output: delta_G: standard 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 co...
def estimate_reaction_gibbs(T, H_f, S_m, nu): '''Estimate the standard reaction Gibbs energy at temperature T. Inputs: T: target temperature in Kelvin, float H_f: standard enthalpies of formation at 298 K in J/mol, list of floats S_m: standard molar entropies at 298 K in J/(K mol), list of floats ...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: NEXT STEP - PROBLEM ...
def compute_total_moles(mass_pure_n2, molar_mass_n2): '''Compute the total number of moles in the globe. Inputs: mass_pure_n2: mass of the pure nitrogen sample in grams, float molar_mass_n2: molar mass of nitrogen (N2) in g/mol, float Output: total number of moles, float ''' total_moles = fl...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be to generate the disciplinary knowledge necessary for solving the next step and then develop a Python solution focused on this step. PREVIOUS STEPS DESCRIPTION: Write a function to co...
def compute_average_molar_mass(mass_mixture, total_moles): '''Compute the average molar mass of the mixture. Inputs: mass_mixture: mass of the atmospheric nitrogen mixture in grams, float total_moles: total number of moles in the globe, float Output: average molar mass of the mixture in g/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_mole_fraction_argon(average_molar_mass, molar_mass_n2, molar_mass_ar): '''Compute the mole fraction of argon in the mixture. Inputs: average_molar_mass: average molar mass of the mixture in g/mol, float molar_mass_n2: molar mass of nitrogen (N2) in g/mol, float molar_mass_ar: 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 co...
def solve_problem(mass_pure_n2, mass_mixture, molar_mass_n2, molar_mass_ar): '''Solve for the mole fraction of argon in the atmospheric nitrogen sample. Inputs: mass_pure_n2: mass of the pure nitrogen sample in grams, float mass_mixture: mass of the atmospheric nitrogen mixture in grams, float molar...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 number of moles of a substance. Inputs: mass: mass of the sample in grams, float molar_mass: molar mass of the substance in g/mol, float Output: n: number of moles, float ''' n = mass / molar_mass return 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_final_temperature(T_i, V_ratio, C_vm): '''Calculate the final temperature after an adiabatic reversible expansion. Inputs: T_i: initial temperature in Kelvin, float V_ratio: ratio of final volume to initial volume (V_f / V_i), float C_vm: molar heat capacity at constant volume in J/(mo...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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_entropy_change(n, T_i, T_f, V_ratio, C_vm): '''Calculate the entropy change of the system and surroundings. Inputs: n: number of moles, float T_i: initial temperature in Kelvin, float T_f: final temperature in Kelvin, float V_ratio: ratio of final volume to initial volume (V_f / 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 total_entropy_change(mass, molar_mass, T_i, V_ratio, C_vm): '''Calculate the total change in entropy for the adiabatic reversible expansion. Inputs: mass: mass of the nitrogen gas in grams, float molar_mass: molar mass of nitrogen gas in g/mol, float T_i: initial temperature in Kelvin, 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 perfect_gas_molar_volume(temperature, pressure, R): '''Calculate the molar volume of a perfect gas. Inputs: temperature: Temperature in Kelvin, float pressure: Pressure in atm, float R: Ideal gas constant, float Output: v_m_perfect: Perfect gas molar volume, float ''' v_m_perfect...
PROBLEM DESCRIPTION: You will be provided with the main description of the problem, previous steps, and the next step. Your task will be 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 actual_molar_volume(v_m_perfect, reduction_percentage): '''Calculate the actual molar volume given a percentage reduction from the perfect gas molar volume. Inputs: v_m_perfect: Perfect gas molar volume, float reduction_percentage: Percentage reduction, float Output: v_m_actual: Actual molar...