Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save asad-albadi/dd907cfbf2912b96c5928a9c13a67943 to your computer and use it in GitHub Desktop.
Save asad-albadi/dd907cfbf2912b96c5928a9c13a67943 to your computer and use it in GitHub Desktop.

Comprehensive Engineering Formulas and Algorithms

Mechanical Engineering

Thermodynamics

  • First Law of Thermodynamics (Energy Conservation): [ \Delta U = Q - W ]

    • Inputs: ( Q ) (Heat added to the system in J), ( W ) (Work done by the system in J)
    • Output: ( \Delta U ) (Change in internal energy in J)
    • Units: Joules (J)
    • Tags: Energy, Heat transfer
  • Second Law of Thermodynamics (Entropy): [ \Delta S \geq \frac{Q}{T} ]

    • Inputs: ( Q ) (Heat in J), ( T ) (Temperature in K)
    • Output: ( \Delta S ) (Change in entropy in J/K)
    • Units: Joules per Kelvin (J/K)
    • Tags: Entropy, Heat transfer

Fluid Mechanics

  • Bernoulli’s Equation: [ P + \frac{1}{2} \rho v^2 + \rho gh = \text{constant} ]

    • Inputs: ( P ) (Pressure in Pa), ( \rho ) (Density in kg/m³), ( v ) (Velocity in m/s), ( g ) (Gravity in m/s²), ( h ) (Height in m)
    • Output: Energy per unit volume
    • Units: Pascals (Pa), meters per second (m/s), meters (m)
    • Tags: Fluid dynamics
  • Continuity Equation: [ A_1 v_1 = A_2 v_2 ]

    • Inputs: ( A_1 ) (Area 1 in m²), ( v_1 ) (Velocity 1 in m/s), ( A_2 ) (Area 2 in m²), ( v_2 ) (Velocity 2 in m/s)
    • Output: Relationship between velocities and areas
    • Units: Square meters (m²), meters per second (m/s)
    • Tags: Fluid dynamics

Heat Transfer

  • Fourier’s Law of Conduction: [ q = -k \frac{dT}{dx} ]

    • Inputs: ( k ) (Thermal conductivity in W/(m·K)), ( \frac{dT}{dx} ) (Temperature gradient in K/m)
    • Output: ( q ) (Heat flux in W/m²)
    • Units: Watts per meter squared (W/m²)
    • Tags: Heat conduction
  • Newton’s Law of Cooling (Convection): [ Q = h A (T_s - T_\infty) ]

    • Inputs: ( h ) (Convective heat transfer coefficient in W/(m²·K)), ( A ) (Surface area in m²), ( T_s ) (Surface temperature in K), ( T_\infty ) (Fluid temperature in K)
    • Output: ( Q ) (Heat transfer rate in W)
    • Units: Watts (W)
    • Tags: Heat convection

Mechanics of Materials

  • Stress and Strain: [ \sigma = \frac{F}{A}, \quad \epsilon = \frac{\Delta L}{L} ]

    • Inputs: ( F ) (Force in N), ( A ) (Area in m²), ( \Delta L ) (Change in length in m), ( L ) (Original length in m)
    • Output: ( \sigma ) (Stress in Pa), ( \epsilon ) (Strain, dimensionless)
    • Units: Pascals (Pa), dimensionless
    • Tags: Material strength, Deformation
  • Young’s Modulus: [ E = \frac{\sigma}{\epsilon} ]

    • Inputs: ( \sigma ) (Stress in Pa), ( \epsilon ) (Strain, dimensionless)
    • Output: ( E ) (Modulus of elasticity in Pa)
    • Units: Pascals (Pa)
    • Tags: Elasticity

Dynamics and Control Systems

  • Newton’s Second Law of Motion: [ F = m a ]

    • Inputs: ( m ) (Mass in kg), ( a ) (Acceleration in m/s²)
    • Output: ( F ) (Force in N)
    • Units: Newtons (N)
    • Tags: Mechanics, Dynamics
  • Transfer Function (Laplace Transform): [ G(s) = \frac{Y(s)}{U(s)} ]

    • Inputs: ( Y(s) ) (Output in Laplace domain), ( U(s) ) (Input in Laplace domain)
    • Output: ( G(s) ) (Transfer function, dimensionless)
    • Units: Dimensionless
    • Tags: Control systems

Manufacturing Engineering

  • Machining Time Calculation: [ T = \frac{L}{f \times N} ]
    • Inputs: ( L ) (Length of cut in mm), ( f ) (Feed rate in mm/rev), ( N ) (Spindle speed in rev/min)
    • Output: ( T ) (Machining time in min)
    • Units: Minutes (min)
    • Tags: Manufacturing

Material Science and Engineering

  • Hooke’s Law: [ \sigma = E \epsilon ]
    • Inputs: ( E ) (Modulus of elasticity in Pa), ( \epsilon ) (Strain, dimensionless)
    • Output: ( \sigma ) (Stress in Pa)
    • Units: Pascals (Pa)
    • Tags: Material deformation

Mechanical Design

  • Factor of Safety: [ \text{FoS} = \frac{\text{Ultimate Strength}}{\text{Allowable Stress}} ]
    • Inputs: Ultimate strength (Pa), Allowable stress (Pa)
    • Output: Factor of Safety (dimensionless)
    • Units: Dimensionless
    • Tags: Safety, Design

Mechatronics

  • PID Control Algorithm: [ u(t) = K_p e(t) + K_i \int e(t) , dt + K_d \frac{de(t)}{dt} ]
    • Inputs: ( K_p ) (Proportional gain, dimensionless), ( K_i ) (Integral gain, dimensionless), ( K_d ) (Derivative gain, dimensionless), ( e(t) ) (Error signal)
    • Output: ( u(t) ) (Control output)
    • Units: Dimensionless
    • Tags: Control systems

Automotive Engineering

  • Engine Efficiency: [ \eta = \frac{W_{\text{out}}}{Q_{\text{in}}} ]
    • Inputs: ( W_{\text{out}} ) (Work output in J), ( Q_{\text{in}} ) (Heat input in J)
    • Output: ( \eta ) (Efficiency, dimensionless)
    • Units: Dimensionless
    • Tags: Engine performance

Aerospace Engineering

  • Lift Equation: [ L = \frac{1}{2} \rho v^2 S C_L ]
    • Inputs: ( \rho ) (Air density in kg/m³), ( v ) (Velocity in m/s), ( S ) (Wing area in m²), ( C_L ) (Lift coefficient, dimensionless)
    • Output: ( L ) (Lift in N)
    • Units: Newtons (N)
    • Tags: Aerodynamics

Biomechanical Engineering

  • Stress-Strain Relationship in Biomaterials: [ \sigma = E \epsilon ]
    • Inputs: ( E ) (Modulus of elasticity in Pa), ( \epsilon ) (Strain, dimensionless)
    • Output: ( \sigma ) (Stress in Pa)
    • Units: Pascals (Pa)
    • Tags: Biomaterials

Energy Systems

  • Carnot Efficiency: [ \eta = 1 - \frac{T_C}{T_H} ]
    • Inputs: ( T_C ) (Cold reservoir temperature in K), ( T_H ) (Hot reservoir temperature in K)
    • Output: ( \eta ) (Efficiency, dimensionless)
    • Units: Dimensionless
    • Tags: Thermodynamics, Energy

HVAC

  • Cooling Load Calculation: [ Q = m \cdot C_p \cdot \Delta T ]
    • Inputs: ( m ) (Mass flow rate in kg/s), ( C_p ) (Specific heat at constant pressure in J/(kg·K)), ( \Delta T ) (Temperature difference in K)
    • Output: ( Q ) (Cooling load in W)
    • Units: Watts (W)
    • Tags: HVAC, Thermal systems

Structural Analysis

  • Bending Stress: [ \sigma = \frac{M c}{I} ]
    • Inputs: ( M ) (Moment in Nm), ( c ) (Distance from neutral axis in m), ( I ) (Moment of inertia in m⁴)
    • Output: ( \sigma ) (Bending stress in Pa)
    • Units: Pascals (Pa)
    • Tags: Structural analysis, Material strength

Chemical Engineering

Chemical Kinetics

  • Arrhenius Equation: [ k = A e^{-\frac{E_a}{RT}} ]
    • Inputs: ( A ) (Pre-exponential factor in s⁻¹), ( E_a ) (Activation energy in J/mol), ( R ) (Gas constant in J/(mol·K)), ( T ) (Temperature in K)
    • Output: ( k ) (Rate constant in s⁻¹)
    • Units: s⁻¹
    • Tags: Reaction rates

Chemical Thermodynamics

  • Gibbs Free Energy: [ \Delta G = \Delta H - T \Delta S ]
    • Inputs: ( \Delta H ) (Enthalpy change in J), ( T ) (Temperature in K), ( \Delta S ) (Entropy change in J/K)
    • Output: ( \Delta G ) (Gibbs free energy change in J)
    • Units: Joules (J)
    • Tags: Thermodynamics, Reaction spontaneity

Mass Transfer

  • Fick's Second Law: [ \frac{\partial C}{\partial t} = D \frac{\partial^2 C}{\partial x^2} ]
    • Inputs: ( D ) (Diffusion coefficient in m²/s), ( C ) (Concentration in mol/m³), ( t ) (Time in s), ( x ) (Position in m)
    • Output: Concentration over time
    • Units: m²/s, mol/m³
    • Tags: Diffusion

Biomedical Engineering

Enzyme Kinetics

  • Michaelis-Menten Equation: [ v = \frac{V_{max} [S]}{K_m + [S]} ]
    • Inputs: ( V_{max} ) (Maximum rate in mol/s), ( [S] ) (Substrate concentration in mol/L), ( K_m ) (Michaelis constant in mol/L)
    • Output: ( v ) (Reaction rate in mol/s)
    • Units: mol/s
    • Tags: Enzyme activity

Biomechanics

  • Hill's Equation for Muscle Contraction: [ F = \frac{F_0 b}{v + b} ]
    • Inputs: ( F_0 ) (Maximum isometric force in N), ( b ) (Constant related to the properties of the muscle in s⁻¹), ( v ) (Shortening velocity in m/s)
    • Output: ( F ) (Force in N)
    • Units: Newtons (N)
    • Tags: Muscle dynamics

Civil Engineering

Structural Analysis

  • Euler's Buckling Formula: [ P_{cr} = \frac{\pi^2 E I}{(K L)^2} ]
    • Inputs: ( E ) (Modulus of elasticity in Pa), ( I ) (Moment of inertia in m⁴), ( K ) (Column effective length factor, dimensionless), ( L ) (Length of column in m)
    • Output: ( P_{cr} ) (Critical load in N)
    • Units: Newtons (N)
    • Tags: Buckling analysis

Hydrology

  • Manning's Equation: [ v = \frac{1}{n} R^{2/3} S^{1/2} ]
    • Inputs: ( n ) (Manning's roughness coefficient, dimensionless), ( R ) (Hydraulic radius in m), ( S ) (Slope of the energy grade line, dimensionless)
    • Output: ( v ) (Flow velocity in m/s)
    • Units: m/s
    • Tags: Open channel flow

Electrical Engineering

Circuit Analysis

  • Ohm's Law: [ V = IR ]

    • Inputs: ( I ) (Current in A), ( R ) (Resistance in Ω)
    • Output: ( V ) (Voltage in V)
    • Units: Volts (V)
    • Tags: Electrical circuits
  • Power Calculation: [ P = VI ]

    • Inputs: ( V ) (Voltage in V), ( I ) (Current in A)
    • Output: ( P ) (Power in W)
    • Units: Watts (W)
    • Tags: Power, Circuits

Electromagnetism

  • Faraday's Law of Induction: [ \mathcal{E} = -N \frac{d\Phi_B}{dt} ]
    • Inputs: ( N ) (Number of turns, dimensionless), ( \Phi_B ) (Magnetic flux in Wb), ( t ) (Time in s)
    • Output: ( \mathcal{E} ) (Electromotive force in V)
    • Units: Volts (V)
    • Tags: Electromagnetic induction

Environmental Engineering

Water Quality

  • BOD (Biochemical Oxygen Demand): [ BOD = \frac{D_1 - D_2}{P} ]
    • Inputs: ( D_1 ) (Initial dissolved oxygen in mg/L), ( D_2 ) (Final dissolved oxygen in mg/L), ( P ) (Volume of sample in L)
    • Output: ( BOD ) (Biochemical oxygen demand in mg/L)
    • Units: mg/L
    • Tags: Water quality

Air Quality

  • Henry's Law: [ C = k_H \cdot P ]
    • Inputs: ( k_H ) (Henry's law constant in mol/(L·atm)), ( P ) (Partial pressure of gas in atm)
    • Output: ( C ) (Concentration of gas in solution in mol/L)
    • Units: mol/L
    • Tags: Gas solubility

Industrial Engineering

Operations Research

  • EOQ (Economic Order Quantity): [ EOQ = \sqrt{\frac{2DS}{H}} ]
    • Inputs: ( D ) (Demand rate in units/year), ( S ) (Order cost in $/order), ( H ) (Holding cost in $/unit/year)
    • Output: ( EOQ ) (Economic order quantity in units)
    • Units: Units
    • Tags: Inventory management

Queuing Theory

  • Little's Law: [ L = \lambda W ]
    • Inputs: ( \lambda ) (Arrival rate in units/time), ( W ) (Average time a unit spends in the system in time)
    • Output: ( L ) (Average number of units in the system)
    • Units: Units
    • Tags: Queuing analysis

Software Engineering

Algorithm Complexity

  • Big O Notation: [ O(f(n)) ]
    • Inputs: ( f(n) ) (Function representing the complexity)
    • Output: Order of complexity
    • Units: Dimensionless
    • Tags: Algorithm efficiency

Data Structures

  • Binary Search: [ \text{Index} = \text{BinarySearch}(array, target) ]
    • Inputs: ( array ) (Sorted array), ( target ) (Element to search for)
    • Output: Index of the target element
    • Units: Index (integer)
    • Tags: Search algorithms

Telecommunication Engineering

Signal Processing

  • Fourier Transform: [ X(f) = \int_{-\infty}^{\infty} x(t) e^{-j2\pi ft} , dt ]
    • Inputs: ( x(t) ) (Time-domain signal), ( t ) (Time in s), ( f ) (Frequency in Hz)
    • Output: ( X(f) ) (Frequency-domain representation)
    • Units: Dimensionless (for the transform result, often represented in terms of magnitude and phase)
    • Tags: Signal analysis

Modulation

  • Amplitude Modulation (AM): [ s(t) = [A + m(t)] \cos(2\pi f_c t) ]
    • Inputs: ( A ) (Carrier amplitude), ( m(t) ) (Message signal), ( f_c ) (Carrier frequency in Hz), ( t ) (Time in s)
    • Output: ( s(t) ) (Modulated signal)
    • Units: Varies depending on input signals
    • Tags: Communication systems

Computer Engineering

Digital Logic

  • Boolean Algebra: [ Y = A \cdot B + \overline{C} ]
    • Inputs: ( A ) (Binary input), ( B ) (Binary input), ( C ) (Binary input)
    • Output: ( Y ) (Binary output)
    • Units: Binary (0 or 1)
    • Tags: Digital circuits

Memory Management

  • Address Translation in Paging: [ \text{Physical Address} = \text{Page Number} \times \text{Page Size} + \text{Offset} ]
    • Inputs: Page Number (integer), Page Size (integer), Offset (integer)
    • Output: Physical Address (integer)
    • Units: Address units (bytes)
    • Tags: Operating systems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment