Functions ModuleΒΆ
Provides a wide collection of scientific formulas and utility functions commonly used in engineering applications.
Examples:
Thermodynamics equations (Gibbs free energy)
Mechanical stress and strain calculations
Fluid dynamics formulas
General utility functions
- PyGamLab.Functions.Activation_Energy(k, k0, T)[source]
Calculates the activation energy (Ea) using the Arrhenius equation.
- Parameters:
k (float) β The rate constant at temperature T.
k0 (float) β The pre-exponential factor (frequency factor).
T (float) β The temperature in Kelvin.
- Returns:
The activation energy (Ea) in Joules per mole (J/mol).
- Return type:
float
- PyGamLab.Functions.Activity_Coef(wB, wC, wD, eBB, eCB, eDB)[source]
- Parameters:
wB (float) β Weight percent of B
wC (float) β Weight percent of C
wD (float) β Weight percent of D
eBB (float) β Interaction coefficient of B and B
eCB (float) β Interaction coefficient of C and B
eDB (float) β Interaction coefficient of D and B
- Returns:
fB β Activity coefficient of B
- Return type:
float
- PyGamLab.Functions.Aeroscope_Stress_Concentration(max_stress, nominal_stresss)[source]
Calculates the stress concentration factor.
- Parameters:
max_stress (float) β The maximum stress experienced by the material.
nominal_stresss (float) β The nominal stress applied to the material.
- Returns:
The stress concentration factor (K).
- Return type:
float
- PyGamLab.Functions.Archimedes_Principle(density_fluid, volume_displaced, gravitational_acceleration)[source]
Calculates the buoyant force acting on an object submerged in a fluid, based on Archimedesβ principle.
- Parameters:
density_fluid (float) β The density of the fluid in which the object is submerged (e.g., kg/m^3).
volume_displaced (float) β The volume of the fluid displaced by the object (e.g., m^3).
gravitational_acceleration (float) β The acceleration due to gravity (e.g., m/s^2).
- Returns:
The buoyant force acting on the object (e.g., in Newtons).
- Return type:
float
- PyGamLab.Functions.Arithmetic_Sequence(start_num, common_difference, n)[source]
An arithmetic sequence is an ordered set of numbers that have a common difference between each consecutive term. :type start_num: :param start_num: the first term in the sequence. :type start_num: int :type common_difference: :param common_difference: the common difference between terms. :type common_difference: int :type n: :param n: number of terms. :type n: int
- Returns:
a_n β the nα΅Κ° term in the sequence
- Return type:
int
- PyGamLab.Functions.Atomic_Packing_Factor(radius, crystal_structure)[source]
- Parameters:
crystal_structure (Type of the crystal (Fccc , Bcc or ...))
(float) (radiuse)
Returns
SC (Atomic packing factor for)
BCC
FCC
- PyGamLab.Functions.Atomic_Percentage(n_1, n_2, n_3, n_4, Entry, output, m_1, m_2, m_3, m_4, M_1, M_2, M_3, M_4, w_1, w_2, w_3, w_4)[source]
- Parameters:
n_1 (float) β The number of moles of the first atom.
n_2 (float) β The number of moles of the second atom.
n_3 (float) β The number of moles of the third atom.
n_4 (float) β The number of moles of the fourth atom.
Entry (str) β what type of entery you have?
output (str) β The atomic percentage is based on which atom?
m_1 (float) β The mass of the first atom.
m_2 (float) β The mass of the second atom.
m_3 (float) β The mass of the third atom.
m_4 (float) β The mass of the fourth atom.
M_1 (float) β The atomic mass of the first atom.
M_2 (float) β The atomic mass of the second atom.
M_3 (float) β The atomic mass of the third atom.
M_4 (float) β The atomic mass of the fourth atom.
w_1 (float) β The weight percentage of the first atom.
w_2 (float) β The weight percentage of the second atom.
w_3 (float) β The weight percentage of the third atom.
w_4 (float) β The weight percentage of the fourth atom.
- Returns:
It will return the atomic percentage based on the given inputs.
- Return type:
float
- PyGamLab.Functions.Austenite_Martensite_VC(C)[source]
This function calaculates the volume change of a unit cell in Austenite to Marteniste transformation.
- Parameters:
C (float) β C is the percentage of carbon in chemical composition of steel.
- Returns:
VC β VC is the percentage of volume change of a unit cell in Austenite to Marteniste transformation.
- Return type:
float
- PyGamLab.Functions.Beer_Lambert_Law(a, l, I0)[source]
This function caclculate the output light intensity when a light pass through a material :type a: :param a: absorption coefficient. :type a: float :type l: :param l: length. :type l: float :type I0: :param I0: incomming light intensity. :type I0: float
- Returns:
I β output light intensity.
- Return type:
float
- PyGamLab.Functions.Binomial_Probability(n, k, p)[source]
- Parameters:
p (float) β ehtemal voghoo beyn 0ta 1
n (int) β tedad dafat azmayesh
K (int) β tedad dafaat bord
pishamadi(bord (return ehtemal rokh dadan pishamad dar fazaye do) β ba tedad n azmayesh va tedad k bord
shekast) β ba tedad n azmayesh va tedad k bord
- PyGamLab.Functions.Biomaterial_Degredation_Rate(W1, W2, T)[source]
This function calculates the degradation rate of biomaterials
- W1int
initial mass
- W2int
final mass
- Tint
time of degredation
Returns int
Biomaterial_Degredation_Rate
- PyGamLab.Functions.Boltzmann_Distribution(energy, temperature, boltzmann_constant)[source]
Calculates the probability of a particle being in a specific energy state according to the Boltzmann distribution.
- Parameters:
energy (float) β The energy of the specific state.
temperature (float) β The temperature of the system in Kelvin.
boltzmann_constant (float) β The Boltzmann constant (approximately 1.380649 Γ 10^-23 J/K).
- Returns:
The probability of the particle being in the specified energy state.
- Return type:
float
- PyGamLab.Functions.Bouyancy_Force(d, V)[source]
Calculates the buoyant force acting on an object submerged in a fluid.
- Parameters:
d (float) β The density of the fluid (e.g., in kg/m^3).
V (float) β The volume of the fluid displaced by the object (e.g., in m^3).
- Returns:
The buoyant force in Newtons (N).
- Return type:
float
- PyGamLab.Functions.Boyles_Law(initial_volume, initial_pressure, final_volume)[source]
Calculates the final pressure based on Boyleβs Law (assuming constant temperature).
- Parameters:
initial_volume (float) β The initial volume of the gas.
initial_pressure (float) β The initial pressure of the gas.
final_volume (float) β The final volume of the gas.
- Returns:
The final pressure of the gas.
- Return type:
float
- PyGamLab.Functions.Bragg_Law(h, k, l, a, y)[source]
This function calculate the diffraction angle of a incidence wavelenght through a crytal special plate
- Parameters:
h (int) β x direction of the plate.
k (int) β y direction of the plate.
l (int) β z direction of the plate.
a (float) β Unit Cell.
y (float) β incidence wavelenght.
- PyGamLab.Functions.Brinell_Hardness_Calculation(d1, d2, D, p)[source]
this function is utilized for calculating Brinell hardness. characterizes the indentation hardness of materials through the scale of penetration of an indenter, loaded on a material test-piece. It is one of several definitions of hardness in materials science. In this method, steel ball indentor is used.
1. d1: float d1 represents diameter of impress of indentor.
2. d2 : float d2 represents diameter of impress of indentor
3. D : float diameter of indenter
3. p : int applied load
Returns β> BHN (Brinell Hardness Number)
- PyGamLab.Functions.Burning_Rate(L, t)[source]
Calculates the burning rate according to the ASTM D3801 UL-94 test.
- Parameters:
L (float) β The burning length in millimeters (mm).
t (float) β The burning time in seconds (sec).
- Returns:
The burning rate in millimeters per minute (mm/min).
- Return type:
float
- PyGamLab.Functions.Calculate_Debye_Temperature(velocity, atomic_mass, density, n_atoms)[source]
Estimate the Debye temperature (ΞΈ_D) of a solid material.
- Parameters:
velocity (float) β Average sound velocity in m/s.
atomic_mass (float) β Atomic mass of the element (in g/mol).
density (float) β Density of the material (in kg/m^3).
n_atoms (int) β Number of atoms per formula unit.
- Returns:
Debye temperature in Kelvin (K).
- Return type:
float
- PyGamLab.Functions.Calculate_ECB(chi, Ee, Eg)[source]
This function calculates the conduction band edge energy (ECB) of a semiconductor using Mulliken electronegativity theory.
- Parameters:
chi (float) β The absolute electronegativity of the semiconductor (eV), calculated as the geometric mean of the absolute electronegativity of the constituent elements. For ZnO, chi=sqrt(chi_Zn*chi_O)=5.79 eV.
Ee (float) β The energy of free electrons on the standard hydrogen electrode (SHE) scale (eV). For standard scale, Ee=4.5 eV.
Eg (float) β The bandgap energy of the semiconductor (eV). For ZnO, Eg=3.23 eV.
- Returns:
ECB β The conduction band edge energy (eV).
- Return type:
float
- PyGamLab.Functions.Calculate_Hardness_From_Young_And_Poisson(E, nu)[source]
Estimate Vickers hardness (HV) from Youngβs modulus and Poissonβs ratio.
- Parameters:
E (float) β Youngβs modulus (GPa).
nu (float) β Poissonβs ratio (dimensionless).
- Returns:
Estimated Vickers hardness (HV) in GPa.
- Return type:
float
- PyGamLab.Functions.Calculate_Pipe_Heat_Transfer(mu, muW, rho, Cp, Pr, K, u, d, l, Tw, Tb1)[source]
- Parameters:
mu (float) β Fluid dynamic viscosity (pa.s).
muW (float) β Dynamic viscosity at wall temperature (pa.s).
rho (float) β fluid density (kg/mΒ³).
Cp (float) β DESCRIPTION.
Pr (float) β Prantel number.
K (flout) β Thermal conductivity(W/m.K).
u (float) β fluid velocity (m/s).
d (float) β Pipe diameter (m).
L (float) β Pipe length (m).
Tw (float) β Pipe wall temperature.
Tb1 (float) β Average fluid temperature().
Returns
number (Nusselt)
number
coefficient (convective heat transfer)
transfer (total heat)
temperature. (and outlet)
-------
None.
- PyGamLab.Functions.Carnot_Efficiency(T_c, T_h)[source]
- Parameters:
(float) (T_cold)
(float)
Returns
float (Efficiency of the cycle)
- PyGamLab.Functions.Change_In_Pressure_Of_a_Mercury_OR_Water_Column_Manometer(Type_Of_Fluid, h, g=9.81)[source]
Calculates the change in pressure in Pascals (Pa) for a mercury or water column manometer.
- Parameters:
Type_Of_Fluid (str) β The type of fluid in the manometer (βwaterβ or βmercuryβ). Case-insensitive.
h (float) β The height difference in the manometer column in meters (m).
g (float, optional) β The acceleration due to gravity in meters per second squared (m/s^2). Defaults to 9.81.
- Returns:
The change in pressure (Delta_P) in Pascals (Pa).
- Return type:
float
- Raises:
ValueError β If the Type_Of_Fluid is not βwaterβ or βmercuryβ.
- PyGamLab.Functions.Circle_Area(radius)[source]
- Parameters:
radius (int) β radius of circle.
- Returns:
circle_area β area of circle.
- Return type:
int
- PyGamLab.Functions.Circle_Perimeter(radius)[source]
- Parameters:
radius (int) β radius of circle.
- Returns:
circle_perimeter β perimeter of circle.
- Return type:
int
- PyGamLab.Functions.Cohen(m, r, /)[source]
Cohen equation is used to predict the yield stress of a polymeric blend containing a rubbery dispersion phase.
- mint or float
The yield stress of polymeric matrix, N/m^2 or Pa or β¦
- rfloat
Volume fraction of rubbery phase, 0<r<1.
b : int or float The yield stress of polymeric blend, N/m^2 or Pa or β¦
- PyGamLab.Functions.Component(a, b)[source]
- alist
multi-dimensional vector
- blist
multi-dimensional vector
- cfloat
The component of b on a
- PyGamLab.Functions.Concentration_Calculator(CA1, unit_CA1, CA2, unit_CA2, Q1, unit_Q1, Q2, unit_Q2)[source]
- Parameters:
CA1 (float) β Concentratoion of the first flow
unit_CA1 (str) β Unit of concentratoion of the first flow
CA2 (float) β DESCRIPTION.Concentratoion of the second flow
unit_CA2 (str) β Unit of concentratoion of the second flow
Q1 (float) β Molar volume of the first flow
unit_Q1 (str) β Unit of molar volume of the first flow
Q2 (float) β Molar volume of the second flow
unit_Q2 (str) β Unit of molar volume of the second flow
- Return type:
Flowrate and concentration of the output flow
- PyGamLab.Functions.Contact_Angle(num1, num2, num3)[source]
- Parameters:
num1 (float) β a solid and atmospher surface tenssion.
num2 (float) β a liquid and atmospher surface tension.
num3 (float) β a solid and liquid boundary tension.
Returns
degrees
- PyGamLab.Functions.Convective_Heat_Transfer_Internal_Flow_Dittus_Boelter(Re, Pr, fluid_thermal_conductivity, hydraulic_diameter, delta_T, length, heating=True)[source]
Calculates the convective heat transfer rate for fully developed turbulent flow inside a smooth circular tube using the Dittus-Boelter correlation. This is a widely used empirical correlation in heat exchanger design and thermal analysis of internal flows.
- Parameters:
Re (float) β The Reynolds number of the flow (dimensionless, Re > 10000 for turbulent flow).
Pr (float) β The Prandtl number of the fluid (dimensionless).
fluid_thermal_conductivity (float) β The thermal conductivity of the fluid (in W/(m*K)).
hydraulic_diameter (float) β The hydraulic diameter of the tube (in meters). For a circular tube, this is simply the inner diameter.
delta_T (float) β The temperature difference between the surface and the bulk fluid (in Kelvin).
length (float) β The length of the tube over which heat transfer occurs (in meters).
heating (bool, optional) β A boolean indicating whether the fluid is being heated (True) or cooled (False). This affects the exponent of the Prandtl number. Defaults to True (heating).
- Returns:
The convective heat transfer rate (in Watts).
- Return type:
float
- PyGamLab.Functions.Convert_Gas_Constant(gas_constant, from_unit, to_unit)[source]
Converts the gas constant from one unit to another.
- Parameters:
gas_constant (float) β The value of the gas constant in the initial unit.
from_unit (str) β The initial unit of the gas constant (e.g., βJ/mol.Kβ, βcal/mol.Kβ, βatm.L/mol.Kβ, βcm^3.atm/mol.Kβ).
to_unit (str) β The desired unit for the gas constant (e.g., βJ/mol.Kβ, βcal/mol.Kβ, βatm.L/mol.Kβ, βcm^3.atm/mol.Kβ).
- Returns:
The converted value of the gas constant in the desired unit, or βInvalidβ if the units are not recognized.
- Return type:
float or str
- PyGamLab.Functions.Copolymer_Type(Copolymer, Polymer_num=2)[source]
Copolymer: str Unit types are shown by charachters which are seperated by a space Example: βpolymer_A polymer_A polymer_B polymer_A polymer_A polymer_Bβ
Polymer_num: int It represents the number of polymers in this structure which could be 2 or 3 default = 2
- PyGamLab.Functions.Corrosion_Rate(W, D, A, t)[source]
- Parameters:
W (int or float) β The change in weight of specimen (mg)
D (int or float) β The density of specimen (g/cm^3)
A (int or float) β The surface area of specimen (in^2)
t (int or float) β The time(h)
- Returns:
CR β The corrosion rate (mpy)
- Return type:
int or float
- PyGamLab.Functions.Coulombs_Law(charge1, charge2, distance)[source]
Calculates the electrostatic force between two point charges using Coulombβs Law.
- Parameters:
charge1 (float) β The magnitude of the first charge (in Coulombs).
charge2 (float) β The magnitude of the second charge (in Coulombs).
distance (float) β The distance between the two charges (in meters).
- Returns:
The electrostatic force between the charges (in Newtons).
- Return type:
float
- PyGamLab.Functions.Critical_Diameter(d, r, /)[source]
This equation predicts the critical diameter of rubber particles toughening a polymeric matrix. :type d: :param d: critical distance between rubbery particles, angstrom or mm or nm or β¦.. :type d: int or float :type r: :param r: Volume fraction of rubbery phase, 0<r<1. :type r: float
- Returns:
dc (int or float)
the critical diameter of rubber particles
- PyGamLab.Functions.Crystal_Percent(H, W, H100)[source]
Calculates the percentage of crystallinity in a polymer.
- Parameters:
H (float) β The enthalpy of the polymer in milliJoules (mJ).
W (float) β The weight of the polymer in milligrams (mg).
H100 (float) β The enthalpy for a 100% crystalline polymer in Joules per gram (J/g).
- Returns:
The crystallinity of the polymer in percent (%).
- Return type:
float
- PyGamLab.Functions.Darcys_Law(flow_rate, permeability, area, pressure_difference)[source]
Calculates the value related to Darcyβs Law for flow through a porous medium. Note: The formula provided returns the difference, not a direct calculation of a single variable.
- Parameters:
flow_rate (float) β The volumetric flow rate of the fluid through the medium.
permeability (float) β The permeability of the porous medium.
area (float) β The cross-sectional area through which the fluid is flowing.
pressure_difference (float) β The pressure difference across the porous medium.
- Returns:
The result of the expression: (permeability * area * pressure_difference) - flow_rate. To solve for a specific variable, rearrange this equation.
- Return type:
float
- PyGamLab.Functions.Debye_Temperature_Heat_Capacity(T, TD)[source]
Calculates the dimensionless heat capacity according to the Debye model, a solid-state physics model that approximates the contribution of phonons (lattice vibrations) to the specific heat of a solid.
- Parameters:
T (float) β The absolute temperature in Kelvin (K).
TD (float) β The Debye temperature of the material in Kelvin (K), a characteristic temperature related to the materialβs lattice vibrations.
- Returns:
The dimensionless heat capacity (Cv / (9 * n * k_B)), where n is the number of atoms and k_B is the Boltzmann constant. To get the actual heat capacity, this value needs to be multiplied by 9 * n * k_B.
- Return type:
float
- PyGamLab.Functions.Defect_Density(Beta, Theta, K=0.9, Landa=1.5406)[source]
- Parameters:
Beta (Float) β Full width at half maximum (FWHM).
Theta (Float) β Braggβs Diffraction Angle.
K (Float, optional) β Scherrer Constant. The default = 0.9.
Landa (Float, optional) β X-ray Wavelength. The default = 1.5406.
- Returns:
D (Float) β Crystallite size (nm)
Delta (Float) β Density of defect for crystallite structures from XED crystallography calculated from reverse the Scherrer Equation.
- PyGamLab.Functions.Degradation_Percentage(C0, Ct)[source]
This function calculates the degradation percentage of a pollutant solution in a photocatalytic process.
- Parameters:
C0 (float) β Initial concentration of the pollutant solution (mg/L)
Ct (float) β Concentration of the pollutant solution at a certain time interval (mg/L)
- Returns:
Percentage β The degradation percentage (%) of the pollutant solution.
- Return type:
float
- PyGamLab.Functions.Density(m, V)[source]
Itβs the formula for obtaining density.
Parameters:ΒΆ
- mfloat
Mass
- V: float
volume
- PyGamLab.Functions.Diffusion_Coefficient_Calculator(Peak_Current, A, C, Scan_Rate, n, is_reversible)[source]
- Parameters:
Peak_Current (Float) β Peak of current (A).
A (Float) β Electrode area (cm**2).
C (Float) β Concentration of electroactive species (mol/L).
Scan_Rate (Float)
(mV/s)
n (int)
electron (number of transfered)
is_reversible (bool) β Type of reaction. βTrueβ is reversible, βFalseβ is irreversible
- Returns:
Diffusion Coefficient calculates from Randles-Sevcik aquation. type
- Return type:
float
- PyGamLab.Functions.Diffusion_in_Gases(Diffusion_Type, Diffusivity, Separate_Panels_Distance, Pressure_in_Panel_A, Pressure_in_Panel_B, PressureBM, Gas_Constant, Total_Pressure=101299.99999999999)[source]
Calculates the molar flux (N_A) for diffusion in gases under different conditions.
- Parameters:
Diffusion_Type (str) β The type of diffusion: βTwo_way_equimolal_diffusionβ or βone-way_diffusionβ.
Diffusivity (str) β A key representing the gas pair for which the diffusivity is known (e.g., βH2_CH4β).
Separate_Panels_Distance (float) β The distance between the two panels or points of measurement (in meters, m).
Pressure_in_Panel_A (float) β The partial pressure of component A at point 1 (in Pascals, Pa).
Pressure_in_Panel_B (float) β The partial pressure of component A at point 2 (in Pascals, Pa).
PressureBM (float) β The log mean pressure of the non-diffusing component B (in Pascals, Pa) - used for one-way diffusion.
Gas_Constant (float) β The ideal gas constant (in J/(molΒ·K)).
Total_Pressure (float, optional) β The total pressure of the system (in Pascals, Pa). Defaults to 1.013 * 10**5.
- Returns:
The molar flux of component A (N_A) in mol/(m^2Β·s).
- Return type:
float
- PyGamLab.Functions.Diffusivity(MA, MB, T, rAB, K, Ξ΅AB, f, Pt=101299.99999999999)[source]
Calculates the binary gas-phase diffusivity using a modified Chapman-Enskog equation. Note: The formula seems to have a sign issue based on typical diffusivity calculations.
- Parameters:
MA (str) β The chemical symbol or identifier for gas A (must be a key in the βMβ dictionary).
MB (str) β The chemical symbol or identifier for gas B (must be a key in the βMβ dictionary).
T (float) β The temperature in Kelvin (K).
rAB (float) β The average collision diameter between molecules A and B (in Angstroms, Γ ).
K (float) β A dimensionless collision integral parameter (related to the Lennard-Jones potential).
Ξ΅AB (float) β The Lennard-Jones energy parameter for the pair A-B (in Kelvin, K).
f (float) β A correction factor (dimensionless).
Pt (float, optional) β The total pressure in Pascals (Pa). Defaults to 1.013 * 10**5 (1 atm).
- Returns:
The binary gas-phase diffusivity (DAB) in m^2/s, or βInvalid inputsβ if MA or MB are not recognized.
- Return type:
float or str
- PyGamLab.Functions.Distance(x, y, z, a, b, c, d)[source]
The formula of the distance between a point and a plane in three-dimensional space is as follows:
D=(abs(a*x+b*y+c*z+d))/sqrt(a**2+b**2+c**2)
- xint
The x-axis component.
- yint
The y-axis component.
- zint
The z-axis component.
- aint
The coefficient of x in the plane equation.
- bint
The coefficient of y in the plane equation.
- cint
The coefficient of z in the plane equation.
- dint
The constant in the plane equation.
- Dfloat
The distance of point-to-plane
- ExampleDistnace between (1,-2,4) and the plane 13*x-6*y-5*z+3=0
is 0.527
- PyGamLab.Functions.Doppler_Effect(observed_frequency, source_frequency, velocity_observer, velocity_source, speed_of_sound)[source]
Calculates the observed frequency of a wave due to the Doppler effect.
- Parameters:
observed_frequency (float) β The frequency of the wave as perceived by the observer.
source_frequency (float) β The frequency of the wave emitted by the source.
velocity_observer (float) β The velocity of the observer relative to the medium (positive if moving towards the source).
velocity_source (float) β The velocity of the source relative to the medium (positive if moving away from the observer).
speed_of_sound (float) β The speed of the wave in the medium.
- Returns:
The calculated observed frequency.
- Return type:
float
- PyGamLab.Functions.Drag_Force(Velocity, Fluid_Coefficent, Fluid_Density, cross_sectional_area)[source]
Calculates the drag force acting on an object moving through a fluid.
- Parameters:
Velocity (float) β The velocity of the object relative to the fluid (e.g., in m/s).
Fluid_Coefficent (float) β The drag coefficient (dimensionless).
Fluid_Density (float) β The density of the fluid (e.g., in kg/m^3).
cross_sectional_area (float) β The cross-sectional area of the object perpendicular to the direction of motion (e.g., in m^2).
- Returns:
The drag force acting on the object (e.g., in Newtons).
- Return type:
float
- PyGamLab.Functions.Elastic_Potential_Energy(spring_constant, displacement)[source]
Calculates the elastic potential energy stored in a spring.
- Parameters:
spring_constant (float) β The spring constant (in Newtons per meter).
displacement (float) β The displacement of the spring from its equilibrium position (in meters).
- Returns:
The elastic potential energy stored in the spring (in Joules).
- Return type:
float
- PyGamLab.Functions.Electrical_Resistance(v, i)[source]
- Parameters:
i (int)
R (It represents electrical resistance.)
v (int) β Voltage or potential difference between two points
i β I is the electric current that passes through a circuit
R
- PyGamLab.Functions.Encapsulation_Efficiency(W1, W2)[source]
This function calculates the percentage of drug loaded in the carrier during drug delivery
- W1float
weight of free drug
- W2float
weight of total drug
Returns float Encapsulation_Efficiency
- PyGamLab.Functions.Entropy_Change(heat_transfer, temperature)[source]
Calculates the change in entropy of a system.
- Parameters:
heat_transfer (float) β The amount of heat transferred to or from the system (in Joules).
temperature (float) β The absolute temperature at which the heat transfer occurs (in Kelvin).
- Returns:
The change in entropy (in Joules per Kelvin).
- Return type:
float
- PyGamLab.Functions.Error_Function(z)[source]
- Parameters:
z (int or float) β Error function argument
- Returns:
erf β error function value
- Return type:
float
- PyGamLab.Functions.Euler_Diff_Solver(a, b, xf, h, x0=0, y0=0)[source]
- This function solve linear differential equation of the following form:
yprim = dy/dx = f(x,y) = a*x^2 + b*x
by the Eulerβs method that is a numerical method for approximating differential equations.
- Parameters:
a (float) β Polynomial coefficient..
b (float) β Polynomial coefficient.
xf (float) β Independent variableβs final value.
h (float) β Step size.
x0 (float, optional) β Independent variableβs initial value. The default is 0.
y0 (float, optional) β Initial function value at x0 (y0 = y(x0)). The default is 0.
- Raises:
TypeError β The quadratic coefficient of the equation should not be zero.
- Returns:
y β Returns function value at desired point (xf) or y(xf).
- Return type:
float
- PyGamLab.Functions.Euler_Method(a, b, h, x0, y0)[source]
Eulerβs method law: y = y0 + h *yprim
- Parameters:
a (float) β Polynomial coefficient.
b (float) β polynomial coefficient.
x0 (float) β Initial value.
y(x0) (y0 =) β function value.
h (float) β Step size.
- Return type:
This function returns function value (y) at specific value (x).
- PyGamLab.Functions.Fabric_Drape_Coefficient(fabric_weight, fabric_thickness, bending_length)[source]
This function estimates the drape coefficient of fabric according to 3 factors:
- Parameters:
fabric_weight (int or float) β weight of fabric.
fabric_thickness (int or float) β thickness of fabric.
bending_length (int or float) β the length difference.
Drape_Coefficient (int or float) β Result.
- PyGamLab.Functions.Fabric_GSM(Warp, Weft, Warp_Count_Nm, Weft_Count_Nm, Shrinkage_Percent=5)[source]
This function calculates weight fabric in GSM unit.
- Parameters:
Warp (int or float) β The number of warps in 1 cm.
Weft (int or float) β The number of wefts in 1 cm.
Warp_Count_Nm (int or float) β Warp yarn metric count.
Weft_Count_Nm (int or float) β Weft yarn metric count.
Shrinkage_Percent (int or float, optional) β The percentage difference in the length of woven and non-woven yarn. The default is 5.
Fabric_GSM (int or float) β Result.
- PyGamLab.Functions.Fabric_Porosity(air_volume, total_volume)[source]
- Parameters:
air_volume (int) β enter the volume of pores in fabric in mm^3.
total_volume (int) β Enter the total volume of fabric in mm^3.
- Returns:
Fabric_porosity β This function calculates the fabric porosity in mm^3.
- Return type:
int
- PyGamLab.Functions.Fabric_weight(density, area)[source]
- Parameters:
density (int) β enter the density of fabric in g/mm^2.
area (int) β Enter the area of fabric in mm^2.
- Returns:
Fabric_weight β This function calculates the fabric weight in g.
- Return type:
int
- PyGamLab.Functions.Factorial(a)[source]
The product of all positive integers less than or equal to a given positive integer.
- Parameters:
a (int)
- Returns:
factorial β the product of all positive integers less than or equal to a given positive integer .
- Return type:
int
- PyGamLab.Functions.Faraday_Corrosion(current_density, time, atomic_weight, density, valence)[source]
calculate penetration depth from corrosion
current_density: A/mΒ² time:hour atomic_weight: g/mol density: g/cmΒ³ valence
- PyGamLab.Functions.Faradays_Law(induced_emf, time, magnetic_flux)[source]
Calculates a value based on Faradayβs Law of induction. Note: The provided formula returns the difference, not a direct calculation of a single variable.
- Parameters:
induced_emf (float) β The induced electromotive force (in Volts).
time (float) β The time interval over which the change in magnetic flux occurs (in seconds).
magnetic_flux (float) β The change in magnetic flux (in Webers).
- Returns:
The result of the expression: induced_emf - (time * magnetic_flux). To solve for a specific variable, rearrange this equation based on Faradayβs Law: induced_emf = - d(magnetic_flux) / dt (the negative rate of change of magnetic flux).
- Return type:
float
- PyGamLab.Functions.Fibonachi_Sequence(N)[source]
Generates a Fibonacci sequence up to the N-th term.
- Parameters:
N (int) β The number of Fibonacci numbers to generate. Must be a positive integer.
- Returns:
A list containing the first N Fibonacci numbers.
- Return type:
list
- PyGamLab.Functions.Fick_Sec_Thin(Thickness, Diffusion_coefficient, Time, Thin_layer_Consistency, Position, Thin_Layer_Metal, Second_metal)[source]
Fickβs second law predicts how diffusion causes the concentration to change with respect to time. In the case where a thin film of a different metal is placed between two thick films of another metal, and due to heat and a certain time, the amount of penetration of the first metal into the second metal will be investigated. :type Thickness: :param Thickness: The thickness of the thin layer metal is used. use cm for input :type Thickness: float :type Diffusion_coefficient: :param Diffusion_coefficient: It shows the diffusion coefficient of the metal placed in the middle compared to the metal on its side. use cm^2/seconds for input :type Diffusion_coefficient: float :type Time: :param Time: It shows the duration of the diffusion check. use seconds for input :type Time: float :type Thin_layer_Consistency: :param Thin_layer_Consistency: It shows the initial concentration of thin metal. use gr/cm^3 for input :type Thin_layer_Consistency: float :type Position: :param Position: Indicates the location required to check the concentration. use cm for input :type Position: float :type Thin_Layer_Metal: :param Thin_Layer_Metal: What is the material of the thin layer used? :type Thin_Layer_Metal: str :type Second_metal: :param Second_metal: What is the metal material in which the primary metal should penetrate?. :type Second_metal: str
- Returns:
C_x_t β It shows the concentration of the metal separated from the thin layer and moved in a certain time in the desired location. output will be gr/cm^3
- Return type:
float
- PyGamLab.Functions.Filler_Weight(M, FR1, FR2, FR3)[source]
Calculates the weight percentages of three fillers in a polymer matrix.
- Parameters:
M (float) β The weight of the polymer matrix in grams (gr).
FR1 (float) β The weight of the first flame retardant in grams (gr).
FR2 (float) β The weight of the second flame retardant in grams (gr).
FR3 (float) β The weight of the third flame retardant in grams (gr).
- Returns:
A tuple containing three lists, representing the weight percentages of FR1, FR2, and FR3, respectively.
- Return type:
tuple
- PyGamLab.Functions.Final_Temp_Irreversible_Adiabatic(Initial_temperature, External_pressure, Internal_pressure, C_V, C_P, R, Unit_of_measurement, Number_of_gas_atoms)[source]
- Initial_temperaturefloat
Initial temperature of an ideal gas.
- External_pressurefloat
The pressure that enters the system from the environment.
- Internal_pressurefloat
The pressure that enters the system wall from the inside.
- C_Vfloat
The ideal gas constant-pressure specific heat.
- C_Pfloat
The ideal gas constant-pressure specific heat..
- Rfloat
The molar gas constant or ideal gas constant.
- Unit_of_measurementstr
DESCRIPTION.
- Number_of_gas_atomsstr
DESCRIPTION.
- Returns:
Final_Temp β Outputs the final temperature if the system operates adiabatically irreversible.
- Return type:
float
- PyGamLab.Functions.First_Row_Pascal_Triangle(k)[source]
Calculates the factorial of a non-negative integer k, which corresponds to the (k+1)-th rowβs first and last element in Pascalβs Triangle (if rows start from 0).
- Parameters:
k (int) β A non-negative integer.
- Returns:
The factorial of k (k!).
- Return type:
int
- PyGamLab.Functions.Fracture_Toughness(s, c, location)[source]
this function calculates fracture toughness based on applied stress, crack length, and location
- fracture toghness formula:
K1C = a*s* (math.sqrt(3.14* c))
where:
K1C is the fracture toughness, a is a geometric factor, s is the applied stress, c is the crack length.
- Parameters:
s (1.) β applied stress
c (2.) β crack length
location (3.) β represents the location of crack
toughness) (Returns --> K1C (fracture)
- PyGamLab.Functions.Friction_Law(mass, angle, /, MOTCS, moving)[source]
This function calculates the friction force on the object by taking the mass of the desired object, the material of the two contact surfaces, the angle of the contact surface with the horizon and the movement state of the object.
- Parameters:
mass (int) β The mass of the desired object (KG).
angle (int) β The angle of the contact surface with respect to the horizon (RAD).
MOTCS (str) β Material of two contact surfaces. The contact surfaces considered : STEEL ON STEEL STEEL ON ALUMINUM STEEL ON COPPER COPPER ON CAST IRON COPPER ON GLASS GLASS ON GLASS RUBBER ON DRY CONCRETE RUBBER ON WET CONCRETE TEFLON ON TEFLON
moving (str) β Is the desired object moving? (YES OR NO).
- Returns:
F β Frictional force applied to the target object (N).
- Return type:
float
- PyGamLab.Functions.Gauss_Law(electric_field, surface_area, electric_flux)[source]
Calculates a value related to Gaussβs Law for electricity. Note: The provided formula returns the difference, not a direct calculation of a single variable.
- Parameters:
electric_field (float) β The magnitude of the electric field (e.g., in N/C).
surface_area (float) β The area of the closed surface through which the electric field passes (e.g., in m^2).
electric_flux (float) β The electric flux through the closed surface (e.g., in NΒ·m^2/C).
- Returns:
The result of the expression: (electric_field * surface_area) - electric_flux. According to Gaussβs Law, the electric flux through a closed surface is proportional to the enclosed electric charge: electric_flux = enclosed_charge / permittivity_of_free_space. For a uniform electric field perpendicular to a surface, electric_flux = electric_field * surface_area. To solve for a specific variable, rearrange the appropriate form of Gaussβs Law.
- Return type:
float
- PyGamLab.Functions.Geometric_Sequence(first_variable, second_variable)[source]
This function obtains the result of a geometric progression
- Parameters:
first_variable (int) β The value of the first variable.
second_variable (int) β The value of the second variable.
- Returns:
gives the result of the geometric exponential function.
- Return type:
int
- PyGamLab.Functions.Gibs_Free_Energy(H0, T, S0)[source]
- Parameters:
H0 (float) β Enthalpy of material in the pressure of 1atm in pure state. The number should be in terms of joul or kilojoul. It must have the same unit as entropy.
T (float) β Temperature of material. The temperature should be in terms of Kelvin.
S0 (float) β Entropy of material. The number should be in terms of joul or kilojoul. It must have the same unit as enthalpy.
- Returns:
G β This function give us the amount of Gibs free energy of the material at the pressure of 1atm. The terms of this function is joul or kilojoul.
- Return type:
float
- PyGamLab.Functions.Gravitational_Force(G, FT)[source]
- Parameters:
G (float) β The gravitational force is a force that attracts any two objects with mass.
FT (float) β The force of gravity varies with latitude and increases from about 9.780 m/s2 at the Equator to about 9.832 m/s2 at the poles.
- Returns:
F β The force of gravity is also called as Newtonβs law of gravitation. Mathematically, F = GMmr2. where F = force of gravity, G = gravitational constant, M = mass of one object, m = mass of other object, r = distance between two objects.
- Return type:
float
- PyGamLab.Functions.Gravitational_Force_Formula(g, m_mars, m_sun, r_mars_sun)[source]
- Parameters:
g (float) β The gravitational force is a force that attracts any two objects with mass.
m_mars (float) β Marsβ mass is 6.42 x 1023 kilograms, about 10 times less than Earth. This affects the force of gravity. Gravity on Mars is 38 percent of Earthβs gravity, so a 100-pound person on Earth would weigh 38 pounds on Mars
m_sun (float) β The sun has a mass of 1.9891x1030 kg = 4.384x1030 lb = 2.192x1027 tons, or a mass 333,000 times that of the Earth. The radius of the Sun is 696,265,000 meters = 696,265 km = 432,639 mi or a radius 109 times that of the Earth.
r_mars_sun (float) β Mars is about 128 million miles (206 million km) from the sun, and at its farthest distance (aphelion) Mars is about 154 million miles (249 million km) from the sun.
- Returns:
F2 β The force of gravity is also called as Newtonβs law of gravitation. Mathematically, F = GMmr2. where F = force of gravity, G = gravitational constant, M = mass of one object, m = mass of other object, r = distance between two objects.
- Return type:
float
- PyGamLab.Functions.Hadamard_Product(matrix1, matrix2)[source]
Calculates the Hadamard product (element-wise product) of two matrices.
- Parameters:
matrix1 (numpy.ndarray) β The first matrix.
matrix2 (numpy.ndarray) β The second matrix. Note: The dimensions of matrix1 and matrix2 must be the same for element-wise multiplication.
- Returns:
The Hadamard product of the two matrices.
- Return type:
numpy.ndarray
- PyGamLab.Functions.Half_Inhibitory_Concentration(A1, A2, A3)[source]
This function determines the drugβs efficacy in biological process inhibition
- A1int
absorbance of the experimental wells
- A2int
absorbance of the control wells
- A3int
absorbance of the blank wells
- Returns
- float
Half _Inhibitory_Concentration
- PyGamLab.Functions.Hall_Petch(d_grain, sigma0, k)[source]
calculate yield strengh with grain size in Hall Petch k(float) = MPaΒ·βm Hall Petch constant d_grain = size of grain according to meter
- PyGamLab.Functions.Hall_Petch_Relationship(grain_size, yield_strength_boundary, k_hp)[source]
Calculates the yield strength of a polycrystalline material based on its grain size using the Hall-Petch relationship. This fundamental concept in materials science explains how reducing grain size generally increases the strength of a material by increasing the number of grain boundaries that impede dislocation motion.
- Parameters:
grain_size (float) β The average grain size of the polycrystalline material (typically in micrometers or millimeters).
yield_strength_boundary (float) β The yield strength of a single crystal of the material (or a material with infinitely large grains), representing the intrinsic strength (in MPa or equivalent units).
k_hp (float) β The Hall-Petch coefficient, a material-specific constant that reflects the strength of grain boundaries in impeding dislocation motion (in MPa * sqrt(length unit)).
- Returns:
The yield strength of the polycrystalline material (in the same units as yield_strength_boundary).
- Return type:
float
- PyGamLab.Functions.Hardness_vickers(F, d)[source]
- Parameters:
F (float) β Applied force in terms of kilogram.
d (float) β Medium diameter of indentor effect in terms of milimeter.
- Returns:
HV β This function give us the amount of hardness of material that evaluated by vickers hardness tester. The terms of this is Kg/mm2.
- Return type:
Vickers hardness
- PyGamLab.Functions.Heat_Capacity(m, c, T1, T2)[source]
This function caclulate the amount of heat capacity of a mass :type m: :param m: mass. :type m: Float :type c: :param c: specific heat coefficient. :type c: float :type T1: :param T1: primary temperature. :type T1: float :type T2: :param T2: secondary temperature. :type T2: float
- PyGamLab.Functions.Heat_Exchanger_Transfer(U, Th1, Th2, Tc1, Tc2, C, dot_m)[source]
- Parameters:
U (float) β Overall heat transfer coefficient.
Th1 (float) β Hot fluid inlet temperature.
Th2 (float) β Hot fluid outlet temperature.
Tc1 (float) β Cold fluid inlet temperature.
Tc2 (float) β Cold fluid outlet temperature.
C (float) β Special heat.
dot_m (float) β Debbie Jeremy.
Returns(delta_T_LMTD,Q,A)ΒΆ
None.
- PyGamLab.Functions.Heat_Transfer(thermal_conductivity, area, temperature_difference, thickness)[source]
Calculates the rate of heat transfer through a material by conduction using Fourierβs Law.
- Parameters:
thermal_conductivity (float) β The thermal conductivity of the material (e.g., in W/(mΒ·K)).
area (float) β The cross-sectional area through which heat is transferred (e.g., in m^2).
temperature_difference (float) β The temperature difference across the thickness of the material (e.g., in Kelvin).
thickness (float) β The thickness of the material through which heat is transferred (e.g., in meters).
- Returns:
The rate of heat transfer (in Watts).
- Return type:
float
- PyGamLab.Functions.Heat_Transfer_Rate(Thermal_conductivity, area, tempreture_difference)[source]
This function is used to calculate heat transfer rate by using thermal conductivity, area of transformation, and tempreture of to sides of transformation. In this formula, heat transfer rate is in Btu/(hr*square ft*F), area is in square ft, and tempreture difference is in F.
- PyGamLab.Functions.HeatΩTransferΩCoefficient(k, A, t1, t2, d)[source]
- Parameters:
k (int)
A (int)
t1 (int)
t2 (int)
Q (int)
Q β It indicates the rate of heat transfer.
k β Heat transfer coefficient
A β is the heat transfer coefficient.
t1 β The area of ββthe surface from which heat is transferred.
t2 β Initial temperature
d (int) β Secondary temperature
- PyGamLab.Functions.Hooke(strain, young_modulus)[source]
Calculates stress using Hookeβs Law for elastic materials under uniaxial loading.
- Parameters:
strain (float) β The dimensionless strain (change in length divided by original length).
young_modulus (float) β The Youngβs modulus (elastic modulus) of the material (in Pascals or equivalent units).
- Returns:
The stress experienced by the material (in Pascals or equivalent units).
- Return type:
float
- PyGamLab.Functions.Hookes_Law(spring_constant, displacement)[source]
Calculates the force exerted by a spring according to Hookeβs Law.
- Parameters:
spring_constant (float) β The spring constant (in Newtons per meter).
displacement (float) β The displacement of the spring from its equilibrium position (in meters).
- Returns:
The force exerted by the spring (in Newtons).
- Return type:
float
- PyGamLab.Functions.Ideal_Diode_Equation(current, saturation_current, thermal_voltage)[source]
Calculates a value based on the Ideal Diode Equation (Shockley diode equation). Note: The provided formula returns the difference, not a direct calculation of the voltage across the diode.
- Parameters:
current (float) β The current flowing through the diode (in Amperes).
saturation_current (float) β The reverse saturation current of the diode (in Amperes).
thermal_voltage (float) β The thermal voltage (Vt = kT/q), typically around 26 mV at room temperature (in Volts).
- Returns:
The result of the expression: current - (saturation_current * (math.exp(current / thermal_voltage) - 1)). The standard form of the Ideal Diode Equation is: current = saturation_current * (exp(voltage / thermal_voltage) - 1). To solve for the voltage across the diode, rearrange this standard equation.
- Return type:
float
- PyGamLab.Functions.Ideal_Gas_Law(pressure, volume, temperature)[source]
Calculates a value based on the Ideal Gas Law. Note: The provided formula returns the difference, not a direct calculation of the number of moles.
- Parameters:
pressure (float) β The pressure of the gas (in Pascals).
volume (float) β The volume of the gas (in cubic meters).
temperature (float) β The temperature of the gas (in Kelvin).
- Returns:
The result of the expression: (pressure * volume) - (gas_constant * temperature). According to the Ideal Gas Law: pressure * volume = number_of_moles * gas_constant * temperature. To solve for a specific variable (like the number of moles), rearrange this equation.
- Return type:
float
- PyGamLab.Functions.Ideal_Gas_low_with_unit(R='(L.atm) / (K.mol)', V=1, n=1, T=0)[source]
It calculate the Pressure of ideal gas.
Parameters:ΒΆ
- Pfloat
Pressure
- Vfloat
The amount of Volume
n : float
The amount of substance
- Tfloat
Temperature
- Rfloat
ideal gas constant
- PyGamLab.Functions.Incompressible_Fluids_Pressure(d, h)[source]
Calculates the pressure at a certain depth in an incompressible fluid.
- Parameters:
d (float) β The density of the incompressible fluid (in kg/m^3).
h (float) β The depth below the surface of the fluid (in meters).
- Returns:
The absolute pressure (P) at the specified depth in Pascals (Pa).
- Return type:
float
- PyGamLab.Functions.Indeterminate_degree_of_truss(m, j)[source]
This function calculates the degree of indeterminacy of the truss by taking βmβ number of truss members and βjβ number of nodes.
- Parameters:
m (int) β Number of members truss.
j (int) β Number truss node members.
- Returns:
n β The indeterminate degree of truss.
if n=0 : The truss is determinate. if n>0 : The truss is statically unstable. if n<0 : The truss is indeterminate.
- Return type:
float
- PyGamLab.Functions.Insertion_Sort(non_sorted_list)[source]
Sorts a list of elements in-place using the Insertion Sort algorithm.
- Parameters:
non_sorted_list (list) β The list of elements to be sorted.
- Returns:
The sorted list (the original list is modified in-place).
- Return type:
list
- PyGamLab.Functions.Kinetic_Energy(mass, velocity)[source]
Calculates the kinetic energy of an object.
- Parameters:
mass (float) β The mass of the object (in kilograms).
velocity (float) β The velocity of the object (in meters per second).
- Returns:
The kinetic energy of the object (in Joules).
- Return type:
float
- PyGamLab.Functions.Latice_Parameter(structure, r)[source]
this function calculates Latice parameter based on crystal structure.
ParametrsΒΆ
1. structure : str structure includes crystal structures such as FCC, BCC, SC, HCP, and DC.
FCC: face centered cubic BCC: body centered cubic SC: simple cubic HCP: hexagonal close pack DC: diamond cubic
2. r: float β> (nm) r represents atomic radius.
Returns β> latice parameter (a)
- PyGamLab.Functions.Lattice_Parameter(r, structure)[source]
- Parameters:
r (float) β r is atomic radius of material. It is in terms of angestrom.
structure (str) β Structure of material is face center cubic or body center cubic.
- Returns:
a β a is lattice parameter of material in unit cell. It is in terms of angestrom.
- Return type:
float
- PyGamLab.Functions.Lennard_Jones_Potential(r, sigma, epsilon)[source]
Calculates the Lennard-Jones potential energy between two non-bonding atoms or molecules as a function of the distance βrβ between them. This potential models the balance between short-range repulsive forces (Pauli repulsion) and long-range attractive forces (van der Waals forces).
- Parameters:
r (float) β The distance between the two atoms or molecules (in Angstroms or other length units).
sigma (float) β The distance at which the potential energy is zero (related to the size of the particles).
epsilon (float) β The depth of the potential well, representing the strength of the attraction.
- Returns:
The Lennard-Jones potential energy (in energy units like Joules or electronvolts, depending on the units of epsilon).
- Return type:
float
- PyGamLab.Functions.Lorentz_Force(charge, velocity, magnetic_field)[source]
Calculates the magnetic force component of the Lorentz force acting on a moving charged particle.
- Parameters:
charge (float) β The electric charge of the particle (in Coulombs).
velocity (numpy.ndarray) β A 3D vector representing the velocity of the particle (in meters per second).
magnetic_field (numpy.ndarray) β A 3D vector representing the magnetic field (in Teslas).
- Returns:
A 3D vector representing the magnetic force acting on the particle (in Newtons).
- Return type:
numpy.ndarray
- PyGamLab.Functions.Lorentz_Lorenz_Constant(n, ro)[source]
n(float)= refrective index ro(float)=density g/cm3 or kg/m3
Retuen:
R=(float) constant related to light properties of materials(polymers, plstics,β¦)
- PyGamLab.Functions.Mandaliof_Properties(E)[source]
- Parameters:
E (string) β The chemical symbol of the Element
- Return type:
Nothing
- PyGamLab.Functions.Mass_Energy_Equivalence(mass)[source]
Calculates the energy equivalent of a given mass using Einsteinβs mass-energy equivalence principle (E=mc^2).
- Parameters:
mass (float) β The mass (in kilograms).
- Returns:
The equivalent energy (in Joules).
- Return type:
float
- PyGamLab.Functions.Mass_Of_Rubber_In_Internal_Mixer(filler_percentage, type_of_rotors, V)[source]
Estimates the mass of rubber in an internal mixer based on filler percentage, rotor type, and mixer volume.
- Parameters:
filler_percentage (float) β The percentage of filler in the rubber compound.
type_of_rotors (str) β The type of rotors in the internal mixer (βtangentialβ or βintermixβ). Case-sensitive.
V (float) β The volume of the internal mixer. The unit of volume will determine the unit of the returned mass (assuming a consistent density factor).
- Returns:
The estimated mass of rubber in the internal mixer. The unit will depend on the unit of V.
- Return type:
float
- PyGamLab.Functions.Mass_Transfer_Intensity(result_1, size_of_the_surface)[source]
Calculates the Mass Transfer Intensity (MTI).
- Parameters:
result_1 (float) β A mass transfer related result (the units of this parameter will determine the units of MTI).
size_of_the_surface (float) β The size (area) of the surface where mass transfer occurs (in square meters, m^2).
- Returns:
The Mass Transfer Intensity (MTI_αΌ ). The units will be the units of result_1 multiplied by square meters.
- Return type:
float
- PyGamLab.Functions.Maxwells_Equations(electric_field, magnetic_field, charge_density, current_density)[source]
Represents a simplified form of two of Maxwellβs equations: Gaussβs law for electricity and AmpΓ¨re-Maxwellβs law. Note: This function assumes that the div() and curl() methods are defined for the input field objects and returns a tuple representing the differences from zero as stated by the laws in a vacuum (no free charges or currents). For the full equations in media, permittivity and permeability would need to be considered.
- Parameters:
electric_field (object) β An object representing the electric field, assumed to have a div() method.
magnetic_field (object) β An object representing the magnetic field, assumed to have a curl() method.
charge_density (float) β The electric charge density (in Coulombs per cubic meter).
current_density (object) β An object representing the current density, assumed to be involved in AmpΓ¨re-Maxwellβs law.
- Returns:
A tuple containing two values: - The result of the divergence of the electric field minus the charge density (related to Gaussβs law). - The result of the curl of the magnetic field minus the current density (related to AmpΓ¨re-Maxwellβs law, neglecting the displacement current term for simplicity as per the input).
- Return type:
tuple
- PyGamLab.Functions.Mc_Cabe(F, Zf, Xd, Xw, R, alpha, q)[source]
This function is used for Mc-Cabe calculation in Distillation Towers F : Feed Rate Zf : volatile composition in Feed Xd : volatile composition in Distillate Xw : volatile composition in Waste R : Reflux alpha : Volatility coefficient q : the quantity of liquid in feed Returns the number of tray
- PyGamLab.Functions.Miner_Rule_Fatigue(n, N)[source]
- Parameters:
n (list) β number of cycles at stress level
N (list) β number of cycles to failure at stress level
- Returns:
sigma
- Return type:
float
- PyGamLab.Functions.Mtt_Test(C1, C2)[source]
This function measures the metabolic activity of the cell
- C1int
viable cells
- C2int
total cells
Returns float
Mtt_Test
- PyGamLab.Functions.Nanoparticle_Aspect_Ratio(lenght=1, width=1, height=1)[source]
Calculating the Nanoparticle_Aspect_Ratio
- Parameters:
lenght (int) β lenght of a nanoparticle DESCRIPTION. The default is 1. unit(nm)
width (int) β width of a nanoparticle DESCRIPTION. The default is 1. unit(nm)
height (int) β height of a nanoparticle DESCRIPTION. The default is 1. unit(nm)
- Returns:
Nanoparticle_Aspect_Ratio β the ratio of maximum dimention of a nanoparticle to minimum dimention of it.
- Return type:
float
- PyGamLab.Functions.Nanoparticle_Surface_Area(Shape, Diameter=0, a=0)[source]
Calculating the surface area of nanoparticle by determinig the shape
- Parameters:
Shape (str)
(sphere
tetrahedron) (cube or)
Diameter (int)
0. (DESCRIPTION. The default is)
nanoparticles) ((it is needed for cubic or tetragonal)
unit(nm)
a (int)
dimention
unit(nm)
0.
nanoparticles)
unit(nm)
- Returns:
Nanoparticle_Surface_Area (int)
unit(nm^2)
- PyGamLab.Functions.Nanoparticle_Volume(Shape, Diameter=0, a=0)[source]
Calculating the Volume of a nanoparticle by determinig the shape
- Parameters:
Shape (str)
(sphere
tetrahedron) (cube or)
Diameter (int)
0. (DESCRIPTION. The default is)
nanoparticles) ((it is needed for cubic or tetragonal)
unit(nm)
a (int)
dimention
unit(nm)
0.
nanoparticles)
unit(nm)
- Returns:
Nanoparticle_Volume (int)
unit(nm^3)
- PyGamLab.Functions.Ohms_Law(voltage, current, resistance)[source]
Calculates a value based on Ohmβs law. Note: The provided formula returns the difference, not a direct calculation of a single variable.
- Parameters:
voltage (float) β The voltage across the conductor (in Volts).
current (float) β The current flowing through the conductor (in Amperes).
resistance (float) β The resistance of the conductor (in Ohms).
- Returns:
The result of the expression: voltage - (current * resistance). According to Ohmβs law: voltage = current * resistance. To solve for a specific variable, rearrange this equation.
- Return type:
float
- PyGamLab.Functions.PengRobinson(T=None, P=None, Tc=None, Pc=None, w=None, MW=None, Phases=None)[source]
PengRobinson.m : calculates the compressibility factor,fugacity coefficient and density of a pure compound with the Peng Robinson equation of state (PR EOS)
- Parameters:
T (float) β Temperature [=] K
P (float) β Presure [=] Pa
Tc (float) β Critical temperature [=] K
Pc (float) β Critical presure [=] Pa
w (float) β Accentic factor
MW (float) β Molar weigth [=] kg/mol.
Phases (int) β if Phases == 1, then calculates liquid fugacity; if Phases == 0 then calculates vapor fugacity
- Returns:
Z (flout) β Compressibility factor
fhi (float) β Fugacity coefficient
density (float) β Density
- PyGamLab.Functions.Photoelectric_Effect(kinetic_energy, photon_energy, work_function)[source]
Calculates a value related to the photoelectric effect. Note: The provided formula returns the difference, not a direct calculation of a single variable.
- Parameters:
kinetic_energy (float) β The kinetic energy of the emitted electron (in Joules or eV).
photon_energy (float) β The energy of the incident photon (in Joules or eV).
work_function (float) β The minimum energy required to remove an electron from the surface of the material (in Joules or eV).
- Returns:
The result of the expression: kinetic_energy - (photon_energy - work_function). According to the photoelectric effect equation: kinetic_energy_max = photon_energy - work_function. To solve for a specific variable, rearrange this equation.
- Return type:
float
- PyGamLab.Functions.Planks_Fix(y, R, r)[source]
This formula is used to calculate the wall pressure of bleeding in the veins This function receives the variables y, r, R and returns the variable p p:It indicates the pressure of the bleeding wall. y:Surface coefficient is surface tension R:is the inner radius of the vessel. r:is the thickness of the vessel wall.
- PyGamLab.Functions.Poisson(transverse_strain, axial_strain)[source]
Calculates Poissonβs ratio of a material under axial stress.
- Parameters:
transverse_strain (float) β The strain in the direction perpendicular to the applied force (dimensionless).
axial_strain (float) β The strain in the direction of the applied force (dimensionless).
- Returns:
Poissonβs ratio (v), a dimensionless material property.
- Return type:
float
- PyGamLab.Functions.Polygonal_Diameters(n)[source]
- Parameters:
n (int) β tedad azlae chand zelei(az 2 ta bishtar).
zelei (Returns tedad ghotrhaye chand)
-------
- PyGamLab.Functions.Power_Factor(i, v)[source]
- Parameters:
i (int)
P (v and returns the variable)
i β It is an electric current that passes through a circuit
v (int) β It is an electric current that passes through a circuit
p (int) β It indicates the power used or produced.
- PyGamLab.Functions.Predict_Phase_From_Gibbs(g1, g2, temp)[source]
Predict which phase is thermodynamically favored at a given temperature.
- Parameters:
g1 (callable) β Gibbs free energy function for phase 1: G(T) in J/mol
g2 (callable) β Gibbs free energy function for phase 2: G(T) in J/mol
temp (float) β Temperature in Kelvin.
- Returns:
Name of the stable phase (βPhase 1β, βPhase 2β, or βBothβ).
- Return type:
str
- PyGamLab.Functions.Principal_Stress(Sx, Sy, Sz, Txy, Tyz, Txz)[source]
make sure stress value is less than 1000 :type Sx: :param Sx: Normal stress along x :type Sx: (int or float) :type Sy: :param Sy: Normal stress along y :type Sy: (int or float) :type Sz: :param Sz: Normal stress along z :type Sz: (int or float) :type Txy: :param Txy: Shear stress along xy :type Txy: (int or float) :type Tyz: :param Tyz: Shear stress along yz :type Tyz: (int or float) :type Txz: :param Txz: Shear stress along xz :type Txz: (int or float)
- Returns:
S_P β Principal stresses
- Return type:
[S1,S2,S3]
- PyGamLab.Functions.Print_Time(Print_speed, Volume, Printer_efficiency)[source]
volume(float)= usually Cm3
print_speed(float)= and is speed of print usually cm3 per hour)
Printer_efficience(float)= and between 0 -1)
Retuen:
Print_time=(float) the time of print in hour
- PyGamLab.Functions.Pythagorean(side1, side2)[source]
It should be an orthogonal triangle and this function gives you hypotenuse
- Parameters:
side1 (int) β side of βorthogonal triangleβ.
side2 (int) β side of βorthogonal triangleβ.
- Returns:
hypotenuse β hypotenuse of βorthogonal triangleβ.
- Return type:
int
- PyGamLab.Functions.Pythagorean_Theorem(a, b)[source]
Calculates the length of the hypotenuse of a right-angled triangle using the Pythagorean theorem.
- Parameters:
a (float) β The length of one of the shorter sides of the triangle.
b (float) β The length of the other shorter side of the triangle.
- Returns:
The length of the hypotenuse.
- Return type:
float
- PyGamLab.Functions.Quadratic_Equation(a, b, c)[source]
This function find βxβ in equation ax^2 + bx + c = 0
- aint
known number.
- bint
known number.
- cint
known number.
- The Quadratic Equation mostly have two answers!
- x1 ,x2int
the unknown.
- PyGamLab.Functions.Quantum_Harmonic_Oscillator_Energy(n, hbar, omega)[source]
Calculates the energy levels of a quantum harmonic oscillator, a fundamental model in quantum mechanics that describes systems undergoing oscillatory motion, such as vibrations of atoms in a molecule or lattice.
- Parameters:
n (int) β The quantum number of the energy level (n = 0, 1, 2, β¦). n=0 is the ground state, and higher values represent excited states.
hbar (float) β The reduced Planck constant (h / 2Ο).
omega (float) β The angular frequency of the oscillator (in radians per second).
- Returns:
The energy of the n-th quantum energy level of the harmonic oscillator (in Joules or electronvolts, depending on the units of hbar and omega).
- Return type:
float
- PyGamLab.Functions.Rayleigh_Scattering(intensity, wavelength, particle_size)[source]
Calculates a value related to the intensity of Rayleigh scattering. Note: The provided formula returns the difference, not the scattered intensity.
- Parameters:
intensity (float) β The initial intensity of the incident light.
wavelength (float) β The wavelength of the incident light.
particle_size (float) β The size of the scattering particles.
- Returns:
The result of the expression: intensity - (particle_size / wavelength)**4. The intensity of Rayleigh scattering is actually proportional to (1/wavelength)^4 and the size of the particle. The provided formula doesnβt directly represent the scattered intensity.
- Return type:
float
- PyGamLab.Functions.Rectangle_Area(length, width)[source]
This function calculate the area of square too!
- Parameters:
length (int) β length of rectangle.
width (int) β width of rectangle.
- Returns:
rectangle_area β area of rectangle.
- Return type:
int
- PyGamLab.Functions.Rectangle_Perimeter(length, width)[source]
This function calculate the perimeter of square too!
- Parameters:
length (int) β length of rectangle.
width (int) β width of rectangle.
- Returns:
rectangle_perimeter
- Return type:
int
- PyGamLab.Functions.Rejection(CF, CP)[source]
Calculates the rejection rate (%) of a membrane based on pollutant concentrations.
- Parameters:
CF (float) β The pollutant concentration in the feed solution (g/l).
CP (float) β The pollutant concentration in the permeate solution (g/l).
- Returns:
The membrane rejection rate in percent (%).
- Return type:
float
- PyGamLab.Functions.Reynolds_Number_Pipe(d, u, vis, D_H)[source]
Calculates the Reynolds number for flow in a pipe.
- Parameters:
d (float) β The density of the fluid (e.g., in kg/m^3).
u (float) β The average velocity of the fluid (e.g., in m/s).
vis (float) β The dynamic viscosity of the fluid (e.g., in PaΒ·s).
D_H (float) β The hydraulic diameter of the pipe (e.g., in meters).
- Returns:
The Reynolds number (Re), a dimensionless quantity.
- Return type:
float
- PyGamLab.Functions.Rolling_Parameters_Calculator(roller_radius, flow_stress, sample_width, wanted_thickness_reduction, coefficient_of_friction=None)[source]
- Parameters:
roller_radius (float) β roller radius in term of meter.
flow_stress (float) β flow stress of your sample in term of Pascal.
sample_width (float) β sample width in meter.
wanted_thickness_reduction (float) β wanted thickness reduciton (delta h) in terms of meter.
coefficient_of_friction (floea, optional) β
coefficient of friction between the roller and your sample. notice :
if you give nothing for friction of coefficeint, function assumed that this coefficient is 0.2 and didnt include the role of friction in the rolling force formula. (* 1.2) but if you enter a value for this, function include the role of friction in the process and multiplies the rolling force by 1.2
- Returns:
delta_h_max (float) β the maximum thickness reduction that can be reached in terms of meter.
h_min (float) β minimum thickness that can be reached in terms of meters.
rolling_force (float) β the required force for rolling in terms of Newton.
### important : this function give all output in scientific notation.
- PyGamLab.Functions.Root_Degree2(a, b, c)[source]
Calculates the real roots of a quadratic equation of the form ax^2 + bx + c = 0.
- Parameters:
a (float) β The coefficient of the x^2 term.
b (float) β The coefficient of the x term.
c (float) β The constant term.
- Returns:
A tuple containing two real roots (may be equal if delta == 0), or None if no real roots exist.
- Return type:
tuple or None
- PyGamLab.Functions.Rydberg_Formula(wavelength, rydberg_constant, principal_quantum_number)[source]
Calculates a value related to the Rydberg formula for the wavelengths of spectral lines of hydrogen-like atoms. Note: The provided formula returns the difference, not the inverse of the wavelength.
- Parameters:
wavelength (float) β The wavelength of the emitted photon.
rydberg_constant (float) β The Rydberg constant for the atom.
principal_quantum_number (float) β The principal quantum number of the energy level.
- Returns:
The result of the expression: (1 / wavelength) - (rydberg_constant * principal_quantum_number**2). The standard Rydberg formula is: 1/wavelength = Rydberg_constant * (1/n1^2 - 1/n2^2), where n1 and n2 are principal quantum numbers.
- Return type:
float
- PyGamLab.Functions.Sample_Size_Calculation(N, e)[source]
This function estimates the number of evaluable subjects required for achieving desired statistical significance for a given hypothesis.
- Nint
population of the study
- efloat
margin error
Returns int
Sample_Size_Calculation
- PyGamLab.Functions.Shear_Rate(Q, p, r, n)[source]
Calculates the shear rate for a power-law fluid flowing in a pipe. Note: The variable βpβ is unusual in standard shear rate formulas for pipe flow. Assuming it might be pi.
- Parameters:
Q (float) β The volumetric flow rate (e.g., in m^3/s).
p (float) β Likely intended to be pi (Ο β 3.14159).
r (float) β The radius of the pipe (e.g., in meters).
n (float) β The flow behavior index for a power-law fluid (dimensionless).
- Returns:
The shear rate (Ξ³Μ) at the pipe wall (e.g., in s^-1).
- Return type:
float
- PyGamLab.Functions.Shear_Stress(F, A)[source]
Calculates the shear stress acting on a surface.
- Parameters:
F (float) β The shear force acting parallel to the surface (e.g., in Newtons).
A (float) β The area of the surface over which the shear force acts (e.g., in square meters).
- Returns:
The shear stress (Ο) (e.g., in Pascals).
- Return type:
float
- PyGamLab.Functions.Solidification_Front_Composition(partition_coefficient, alloy_composition, solid_fraction, law_type='lever')[source]
- Parameters:
partition_coefficient (float) β a non-dimensional value that describe the scope of liquidus line.
alloy_composition (float) β initial composition of your alloy in terms of Wt % of left element in phase diagram.
solid_fraction (float) β how much of your alloy solidified.
law_type (str, optional) β you can choose two different model for solidification. lever and scheil. The default is βleverβ.
- Returns:
solid_front_massfraction (float) β solid mass fraction in solidification front in terms of Wt % of left element in phase diagram.
liquid_front_conc (float) β liquid mass fraction in solidification front in terms of Wt % of left element in phase diagram .
notice :
This function round answers to two decimals.
- PyGamLab.Functions.Solubility(a, b, c, T, T_unit, T_end)[source]
Parameters
- bfloat
Constant.
- cfloat
Constant.
- Tfloat
Temperature.
- T_unit:str
Unit of temperature.
- T_end: float
Final temperature
- Return type:
Determination solubility at different temperatures upto solubility< 1
- PyGamLab.Functions.Sphere_Area(R)[source]
- PyGamLab.Functions.Sphere_Surface_Area(radius)[source]
- Parameters:
radius (int) β radius of sphere.
- Returns:
sphere_surface_area β surface area of sphere .
- Return type:
int
- PyGamLab.Functions.Sphere_Volume(radius)[source]
- Parameters:
radius (int) β radius of sphere.
- Returns:
sphere_volume β volume of sphere.
- Return type:
int
- PyGamLab.Functions.Standard_Deviation(a)[source]
This function calculates the standard deviation of a list of numbers.
- Parameters:
a (list) β a is a list of numbers.
- Returns:
SD β SD is the standard deviation of a list of numbers.
- Return type:
float
- PyGamLab.Functions.Stress(strain, young_modulus)[source]
#The Youngβs modulus (E) is a property of the material that tells us how easily it can stretch and deform and is defined as the ratio of tensile stress (Ο=S) to tensile strain (Ξ΅=Ts)
- Parameters:
strain (tensile strain (Ξ΅))
young_modulus (Modulus of Elasticity (N/m2))
- Returns:
S
- Return type:
tensile stress (Ο)
- PyGamLab.Functions.Stress_Intensity_Factor(stress, crack_length, crack_type)[source]
Calculate the stress intensity factor (K) based on the type of crack. K = crack_type * stress * (sqrt(pi * crack_length)) :type stress: :param stress: applied stress (sigma). :type stress: float :type crack_length: :param crack_length: lenght of the crack (a). :type crack_length: float :type crack_type: :param crack_type: there are 3 types of crack βsurfaceβ, βcircularβ, βinternalβ. :type crack_type: str :param Returns: Stress intensity factor (K). :type Returns: float
- PyGamLab.Functions.TB(P, N)[source]
This function is used for bubble temp calculation in mixed solution P : pressure (mmhg) N : number of component Returns bubble temp
- PyGamLab.Functions.TD(P, N)[source]
This function is used for dew temp calculation in mixed solution P : pressure (mmhg) N : number of component Returns bubble temp
- PyGamLab.Functions.Tensile_Strength(f, a)[source]
- Parameters:
f (int) β force required to break
a (int) β cross sectional area
-------
c (int) β Tensile_Strength
- PyGamLab.Functions.Total_Solidification_Time_of_Casting(volume, surface_area, Cm, n, /)[source]
- Parameters:
volume (float) β DESCRIPTION.
surface_area (float) β DESCRIPTION.
Cm (float) β Itβs amount varies depending on the type of material
n (float) β Itβs amount varies depending on the type of material but is usually equal to 2
- Returns:
Total_Solidification_Time
- Return type:
float
- PyGamLab.Functions.Transient_Heat_Conduction_Semi_Infinite_Solid(T_s, T_i, alpha, x, t)[source]
Calculates the temperature at a depth βxβ and time βtβ in a semi-infinite solid initially at a uniform temperature βT_iβ, whose surface temperature is suddenly changed to βT_sβ. This solution is derived from the heat diffusion equation and is applicable when the solid is thick enough that the temperature change has not yet reached the opposite boundary.
- Parameters:
T_s (float) β The constant surface temperature applied at t=0.
T_i (float) β The initial uniform temperature of the solid.
alpha (float) β The thermal diffusivity of the solid material (in m^2/s).
x (float) β The depth from the surface where the temperature is to be calculated (in meters).
t (float) β The time elapsed since the surface temperature change (in seconds).
- Returns:
The temperature at depth βxβ and time βtβ (in the same units as T_s and T_i).
- Return type:
float
- PyGamLab.Functions.Trapezium_Area(Base1, Base2, Height)[source]
Parameters
- Base2int
base of trapezium
- Heightint
height of trapezium
- Returns:
Area β Area of trapezium
- Return type:
int
- PyGamLab.Functions.Trapezium_Perimeter(Base1, Base2, Side1, Side2)[source]
- Parameters:
Base1 (int) β base of trapezium.
Base2 (int) β base of trapezium.
Side1 (int) β side of trapezium.
Side2 (int) β side of trapezium.
- Returns:
Perimeter β perimeter of trapezium
- Return type:
int
- PyGamLab.Functions.Tresca_Yield_For_Biaxial_Tension(c, hardness, sigma_xx, sigma_yy, tau_xy, /)[source]
- Parameters:
c (float) β C is a coefficient that is between 0.3 and 0.4 depending on the type of material.
hardness (float) β brinell and vickers hardness.
sigma_y (float) β Uniaxial tensile yield strength of material.(Mpa)
sigma_y β Uniaxial tensile yield strength of material
sigma_xx (float)
sigma_yy (float)
tau_xy (float)
- Returns:
Tresca β DESCRIPTION.
- Return type:
TYPE
- PyGamLab.Functions.Tresca_Yield_For_Principal_Stresses(c, hardness, sigma_1, sigma_2, sigma_3, /)[source]
- Parameters:
c (float) β C is a coefficient that is between 0.3 and 0.4 depending on the type of material.
hardness (float) β brinell and vickers hardness.
sigma_y (float) β Uniaxial tensile yield strength of material.(Mpa)
sigma_1 (float) β Principal Stresses.
sigma_2 (float) β Principal Stresses.
sigma_3 (float) β Principal Stresses.
- Returns:
Tresca β Tresca Yield(Mpa)
- Return type:
float
- PyGamLab.Functions.Triangle_Area(Height, rule)[source]
This function obtains the area of ββthe triangle
- Parameters:
Height (float) β The size of the height of the triangle.
rule (float) β The size of the base of the triangle is.
- Returns:
area β The output is the area of ββthe triangle.
- Return type:
float
- PyGamLab.Functions.Triangle_Environment(first_side, second_side, third_side)[source]
This function gets the perimeter of the triangle
- Parameters:
first_side (float) β The size of the first side.
second_side (float) β The size of the second side.
third_side (float) β The size of the third side.
- Returns:
Environment β The output is the perimeter of the triangle.
- Return type:
float
- PyGamLab.Functions.Uncertainty_Principle(delta_position, delta_momentum, hbar)[source]
Calculates a value related to the Heisenberg uncertainty principle. Note: The provided formula returns the difference, not a direct evaluation of whether the principle is satisfied.
- Parameters:
delta_position (float) β The uncertainty in the position of a particle.
delta_momentum (float) β The uncertainty in the momentum of the particle.
hbar (float) β The reduced Planck constant (h / 2Ο).
- Returns:
The result of the expression: (delta_position * delta_momentum) - (hbar / 2). The Heisenberg uncertainty principle states that the product of the uncertainty in position and the uncertainty in momentum must be greater than or equal to hbar / 2: delta_position * delta_momentum >= hbar / 2. This function calculates the left-hand side minus the right-hand side. A non-negative result indicates that the principle is satisfied (within the limits of equality).
- Return type:
float
- PyGamLab.Functions.Velocity_Equation(V1, V2, a)[source]
- Parameters:
V1 (float) β sorat avaliye moteharek.
V2 (float) β sorat nahayi moteharek.
a (floar) β shetab moteharek dar harekat ba shetab sabet.
sabet (Returns mizan jabejayi dar harekat ba shetab)
-------
- PyGamLab.Functions.Vicker_Hardness_Calculation(d1, d2, p)[source]
this function is utilized for calculating Vickers hardness. in this method, pyramid shape indentor is used.
- Parameters:
d1 (1.)
indentor. (d1 represents diameter of impress of)
d2 (2.)
indentor (d2 represents diameter of impress of)
p (3.)
load (applied)
Number) (Returns --> VHN (Vickers Hardness)
- PyGamLab.Functions.Voltage_Standing_Wave_Ratio(Vmax, Vmin)[source]
- Parameters:
Vmax (float) β the highest voltage measured in transition line
Vmin (float) β the lowest voltage measured in transition line
- Returns:
Row β its the domain of reflection coefficient of transition line
- Return type:
float
- PyGamLab.Functions.Wavelength_Frequency_Relation(speed_of_light, wavelength, frequency)[source]
Calculates a value based on the relationship between the speed of light, wavelength, and frequency of an electromagnetic wave. Note: The provided formula returns the difference, not a direct calculation of one of the variables.
- Parameters:
speed_of_light (float) β The speed of light in the medium (e.g., approximately 3e8 m/s in a vacuum).
wavelength (float) β The wavelength of the electromagnetic wave (e.g., in meters).
frequency (float) β The frequency of the electromagnetic wave (e.g., in Hertz).
- Returns:
The result of the expression: speed_of_light - (wavelength * frequency). The actual relationship is: speed_of_light = wavelength * frequency. To solve for a specific variable, rearrange this equation.
- Return type:
float
- PyGamLab.Functions.Wear_Rate(V, F, S)[source]
- Parameters:
V (float) β lost volume during the wear test in terms of cubic milimeters (mm3)
F (float) β Applied force in terms of newton.
S (float) β Sliding distance in terms of meter.
- Returns:
K β This function is for claculation of wear rate if material after wear test. It is in terms of (10-6 mm3/N.m)
- Return type:
Wear rate
- PyGamLab.Functions.Welding_Deposition_Rate(Deposited_Metal_Mass, Welding_Time)[source]
- Parameters:
Deposited_Metal_Mass (flaat) β Deposited_Metal_Mass is the amount of deposited metal during welding (kg).
Welding_Time (float) β Welding_Time is the consumed time for welding (hr).
- Return type:
Deposition_Rate is the amount of deposited metal per hour during the welding operation.
- PyGamLab.Functions.Welding_Heat_Input(Efficiency, Voltage, Amperage, Speed)[source]
- Parameters:
Efficiency (float) β Efficiency is the proportion of useful inserted heat to the total inserted heat into the weldment.
Voltage (float) β Voltage is the electrical potential of the welding arc (V).
Amperage (float) β Amperage is the amount of electrical current in welding (A).
Speed (float) β Speed is the velocity of the welding tool (cm/min).
- Return type:
Heat_Input is the useful heat inserted into the weldment.
- PyGamLab.Functions.William_Landel_Ferry(T, Tg, /)[source]
The WLF equation is a procedure for shifting data for amorphous polymers obtained at elevated temperatures to a reference temperature.
- Parameters:
T (int or float) β Temperature, K or degree celsius, Tg<T<Tg+100..
Tg (int or float) β Glass Transition Temperature, K or degree celsius.
- Returns:
aT (int or float)
shift factor.
- PyGamLab.Functions.Young_Modulus(stress, strain)[source]
Calculates Youngβs modulus (elastic modulus) of a material under uniaxial tension or compression.
- Parameters:
stress (float) β The stress experienced by the material (force per unit area, e.g., in Pascals).
strain (float) β The dimensionless strain (change in length divided by original length).
- Returns:
The Youngβs modulus (E) of the material (in Pascals or equivalent units).
- Return type:
float
- PyGamLab.Functions.is_Pythagorean(a, b, c)[source]
- Parameters:
a (float) β tool zele aval.
b (float) β tool zele dovom.
c (float) β tool zele sevom.
bedan (Returns be ma mige in adad mitoonan mosalas ghaem alazviye tashkil)
nemishe" (ba "mosalas ghaemalzaviye mishe" va" mosalas ghaemalzaviye)
-------
- PyGamLab.Functions.newtons_second_law(force, mass, acceleration)[source]
Calculates a value based on Newtonβs second law of motion. Note: The provided formula returns the difference, not a direct calculation of a single variable.
- Parameters:
force (float) β The net force acting on the object (in Newtons).
mass (float) β The mass of the object (in kilograms).
acceleration (float) β The acceleration of the object (in meters per second squared).
- Returns:
The result of the expression: force - (mass * acceleration). According to Newtonβs second law: force = mass * acceleration. To solve for a specific variable, rearrange this equation.
- Return type:
float
- PyGamLab.Functions.pH_Which(pH)[source]
Determines if a solution is acidic, neutral, or basic based on its pH value and prints the result.
- Parameters:
pH (float) β The pH value of the solution.
- Returns:
This function prints the classification of the solution and does not return a value.
- Return type:
None