Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Dr Pankaj Dumka
17 articles
Modelling Two Dimensional Heat Conduction Problem using Python
In this tutorial, we will see how to model the 2D heat conduction equation using Python. A 2D, steady-state heat conduction equation with heat generation can be written in Cartesian coordinates as follows − $$\mathrm{abla^{2} T \: + \: \frac{q_{g}}{k} \: = \: \frac{\partial^{2}T}{\partial x^{2}} \: + \: \frac{\partial^{2}T}{\partial y^{2}} \: + \: \frac{q_{g}}{k} \: = \: 0 \:\:\dotso\dotso (1)}$$ This equation must be discretized to obtain a finite difference equation. Let us consider a rectangular grid as shown below. ...
Read MoreModelling the Taylor Table Method in Python
The Taylor Table method is an efficient technique for deriving finite difference schemes for derivatives using a specific stencil. A stencil is a collection of grid points used to approximate derivatives numerically. Understanding the Taylor Table Method Consider evaluating the second derivative using Taylor series expansions. For points around $x_i$: ...
Read MoreModelling Thermodynamic Entropy in Python
Thermodynamic entropy is a fundamental property that measures the degree of randomness or disorder in a system. In Python, we can model entropy changes for various thermodynamic processes using mathematical formulations and create visualization tools. Understanding Entropy Entropy remains constant during a reversible adiabatic process. When a system exchanges dQ heat with its surroundings at temperature T, the entropy change is: ds = dQ/T ... (1) According to Clausius' inequality, the cyclic integral along any path satisfies: ∮(dQ/T) ≤ 0 ... (2) The equality holds for reversible processes, while inequality holds for irreversible cycles. ...
Read MoreModelling the Trapezoidal Rule for Numerical Integration in Python
The purpose of definite integration is to calculate the area under a curve of a function between two limits, a and b. Numerical integration (also called quadrature) approximates this area by dividing it into simple geometric shapes. ...
Read MoreModelling Stirling and Ericsson Cycles in Python
The Stirling cycle and Ericsson cycle are important thermodynamic cycles used in heat engines. Python provides excellent tools for modeling these cycles using matplotlib and pandas to visualize the pressure-volume relationships and calculate state properties. Stirling Cycle The Stirling cycle consists of four processes: two reversible isochoric (constant volume) and two reversible isothermal (constant temperature) processes. The ideal regenerative Stirling cycle has the same efficiency as the Carnot cycle in the same temperature range. ...
Read MoreModelling the Otto and Diesel Cycles in Python
The Otto cycle and Diesel cycle are fundamental thermodynamic cycles used in internal combustion engines. Python provides powerful tools for modeling these cycles using mathematical equations and visualization libraries like matplotlib and pandas. Otto Cycle An air standard cycle called the Otto Cycle is employed in spark ignition (SI) engines. It comprises of two reversible adiabatic processes and two isochoric processes (constant volume), totaling four processes. When the work interactions take place in reversible adiabatic processes, the heat addition (2-3) and rejection (4-1) occur isochorically (3-4 and 1-2). ...
Read MoreModelling the Gauss Seidel Method in Python
The Gauss-Seidel method is an iterative technique for solving systems of linear equations. Unlike the Jacobi method, Gauss-Seidel uses newly computed values within the same iteration, which speeds up convergence. Mathematical Foundation A system of linear equations can be written as: $$\mathrm{a_{1, 1}x_{1} \: + \: a_{1, 2}x_{2} \: + \: \dotso \: + \: a_{1, n}x_{n} \: = \: b_{1}}$$ $$\mathrm{a_{2, 1}x_{1} \: + \: a_{2, 2}x_{2} \: + \: \dotso \: + \: a_{2, n}x_{n} \: = \: b_{2}}$$ $$\mathrm{\vdots}$$ $$\mathrm{a_{n, 1}x_{1} \: + \: a_{n, 2}x_{2} \: + \: \dotso \: + \: a_{n, ...
Read MoreLumped Capacitance Analysis using Python
Lumped capacitance analysis is used when an object at high temperature is suddenly placed in a cooler medium. If the conductive resistance of the solid is much smaller than the convective resistance, we can treat the object as having uniform temperature throughout (a "lump"). The rate of internal energy change equals the heat transfer to the surrounding fluid. Hot Object T(t) Surrounding Fluid T∞ (constant) ...
Read MoreImplementation of Jacobi Method to Solve a System of Linear Equations in Python
The Jacobi Method is an iterative algorithm for solving systems of linear equations. It starts with initial guesses and repeatedly refines them until convergence is achieved. Mathematical Foundation Consider a system of linear equations: a₁₁x₁ + a₁₂x₂ + ... + a₁ₙxₙ = b₁ a₂₁x₁ + a₂₂x₂ + ... + a₂ₙxₙ = b₂ ... aₙ₁x₁ + aₙ₂x₂ + ... + aₙₙxₙ = bₙ The Jacobi method rearranges each equation to isolate one variable. For the i-th equation: xi = (bi - Σ(aijxj)) / aii The Jacobi Algorithm The algorithm follows these steps: ...
Read MoreModelling Steady Flow Energy Equation in Python
The Steady Flow Energy Equation (SFEE) applies conservation of energy to open systems where fluid flows continuously through a control volume. This equation is fundamental in analyzing turbomachines, nozzles, diffusers, and other fluid flow devices. Control Volume Inlet (i) p_i, V_i, h_i, z_i Exit (e) p_e, V_e, h_e, z_e Q̇ ...
Read More