PyCatKin classes
Submodules
pycatkin.classes.state module
- class pycatkin.classes.state.ScalingState(state_type=None, name=None, path=None, vibs_path=None, sigma=None, mass=None, inertia=None, gasdata=None, add_to_energy=None, path_to_pickle=None, read_from_alternate=None, truncate_freq=True, energy_source=None, freq_source=None, freq=None, i_freq=None, Gelec=None, Gzpe=None, Gvibr=None, Gtran=None, Grota=None, Gfree=None, scaling_coeffs=None, scaling_reactions=None, dereference=False, use_descriptor_as_reactant=False)[source]
Bases:
State
- class pycatkin.classes.state.State(state_type=None, name=None, path=None, vibs_path=None, sigma=None, mass=None, inertia=None, gasdata=None, add_to_energy=None, path_to_pickle=None, read_from_alternate=None, truncate_freq=True, energy_source=None, freq_source=None, freq=None, i_freq=None, Gelec=None, Gzpe=None, Gvibr=None, Gtran=None, Grota=None, Gfree=None)[source]
Bases:
object- calc_rotational_contrib(T, verbose=False)[source]
Calculates rotational contribution to free energy accounting for linear/non-linear molecule.
Saves value in eV.
- calc_translational_contrib(T, p, verbose=False)[source]
Calculates translational contribution to free energy.
Saves value in eV.
pycatkin.classes.scaling module
pycatkin.classes.energy module
- class pycatkin.classes.energy.Energy(name='landscape', minima=None, labels=None, path_to_pickle=None)[source]
Bases:
object- construct_energy_landscape(T, p, verbose=False)[source]
Records free and electronic energies of minima and transition states on the energy landscape relative to the first entry in minima.
- draw_energy_landscape(T, p, etype='free', eunits='eV', legend_location='upper right', verbose=False, path=None, show_labels=False, figtitle=None)[source]
Records free and electronic energies of minima and transition states on the energy landscape relative to the first entry in minima.
- draw_energy_landscape_simple(T, p, fig, ax, linecolor='k', etype='free', eunits='eV', verbose=False, show_labels=False)[source]
Records free and electronic energies of minima and transition states relative to the first entry in minima on the supplied figure axis.
Return the updated figure axis.
pycatkin.classes.reaction module
- class pycatkin.classes.reaction.Reaction(name='reaction', reac_type=None, reversible=True, reactants=None, products=None, TS=None, area=1e-19, scaling=1.0, path_to_pickle=None)[source]
Bases:
object- calc_reaction_energy(T, p, verbose=False)[source]
Computes reaction energies and barriers in J/mol.
- get_reaction_barriers(T, p, verbose=False, etype='free')[source]
Returns the reaction barriers in J/mol.
- class pycatkin.classes.reaction.ReactionDerivedReaction(reac_type, reversible=True, reactants=None, products=None, TS=None, area=1e-19, name='reaction', scaling=1.0, base_reaction=None)[source]
Bases:
Reaction
pycatkin.classes.reactor module
- class pycatkin.classes.reactor.CSTReactor(name='reactor', volume=None, catalyst_area=None, residence_time=None, flow_rate=None)[source]
Bases:
Reactor- get_dynamic_indices(adsorbate_indices, gas_indices)[source]
Returns which indicies in the solution vector experience transient changes.
- class pycatkin.classes.reactor.InfiniteDilutionReactor(name='reactor', volume=None, catalyst_area=None, residence_time=None, flow_rate=None, path_to_pickle=None)[source]
Bases:
Reactor- get_dynamic_indices(adsorbate_indices, gas_indices)[source]
Returns which indicies in the solution vector have transient change.
- class pycatkin.classes.reactor.Reactor(name='reactor', volume=None, catalyst_area=None, residence_time=None, flow_rate=None, path_to_pickle=None)[source]
Bases:
object- get_dynamic_indices(adsorbate_indices, gas_indices)[source]
Returns which indicies in the solution vector vary with time (e.g., not pressure boundary conditions for ID reactors).
- jacobian(adsorbate_jacobian)[source]
Construct the Jacobian function. Multiplies the rows of the Jacobian by 1 if they are required or 0 if they are not required (e.g., pressure boundary conditions).
Returns a function handle.
- rhs(adsorbate_kinetics)[source]
Construct the ODE right hand side (rhs). Multiplies the species ODEs by 1 if they are required or 0 if they are not required (e.g., pressure boundary conditions).
Returns a function handle.
pycatkin.classes.system module
- class pycatkin.classes.system.System(path_to_pickle=None)[source]
Bases:
object- activity(tof_terms, ss_solve=False)[source]
Calculate the activity from the TOF
Returns the activity.
- add_energy_landscape(energy_landscape)[source]
Adds an energy landscape to the dictionary of reactions.
- add_state(state)[source]
Adds a state to the dictionary of states and adds its name to the list of names. Checks state names are unique.
- check_rate_constants()[source]
Check if the rate constants have been calculated and are updated to the current conditions.
- degree_of_rate_control(tof_terms, ss_solve=False, eps=0.001)[source]
Calculate the degree of rate control xi_i
Returns array of xi_i terms for each step i.
- find_steady(store_steady=False, plot_comparison=False, path=None)[source]
Solve for the steady state solution
Returns the steady state solution.
- names_to_indices()[source]
Assigns indicies corresponding to the species for easier access to elements of the solution vector.
- plot_transient(path=None)[source]
Plot transient rates, coverages and pressures. If path is specified, figures are saved to path
- reaction_derivatives(y)[source]
Constructs derivative of reactions wrt each species by multiplying rate constants by reactant coverages/pressures.
Returns an (Nr x Ns) array of derivatives.
- reaction_terms(y)[source]
Constructs forward and reverse reaction rate terms by multiplying rate constants by reactant coverages/pressures.
- run_and_return_tof(tof_terms, ss_solve=False)[source]
Integrate or solve for the steady state and compute the TOF by summing steps in tof_terms
Returns array of xi_i terms for each step i.
- set_parameters(times=None, start_state=None, inflow_state=None, T=293.15, p=101325.0, use_jacobian=True, ode_solver='solve_ivp', nsteps=10000.0, rtol=1e-08, atol=1e-10, xtol=1e-08, ftol=1e-08, verbose=False)[source]
Store simulation conditions, solver tolerances and verbosity.
- species_jacobian(y)[source]
Constructs derivatives of species ODEs for adsorbate coverages and pressures.
Returns Jacobian with shape (Ns x Ns).
pycatkin.classes.uncertainty module
- class pycatkin.classes.uncertainty.Uncertainty(sys=None, mu=0.0, sigma=0.01, nruns=1)[source]
Bases:
objectSamples a white noise value to add to adsorbate energies. Multiplies this by a uniform variate to perturb each transition state energy.
Returns a dictionary of state names and noises.
- get_mean_property_value(property_handle)[source]
Uses the function property_handle to compute the property values for all noisy systems.
Returns the values, their mean and standard deviation.
- get_noise(noise_type='white')[source]
Samples from either a Gaussian or uniform distribution. Default is white noise with mean zero and variance sigma^2.
Returns a noise value.
- get_noisy_sys_samples()[source]
Runs the ODE solver for the original system and generates nruns copies, with noisy state energies. Runs the ODE solver for the noisy systems. Saves the perturbations used in each run.
Obtains a dictionary of state names and noises. Copies the system object and sets the perturbations for state energies in the new noisy system.
Returns the new noisy system.