Posts

Showing posts from June, 2026

Ideal Gas Laws : Coded using Python

Real gases behave in a complex way under different conditions of state variables namely Pressure, Volume and Temperature.  Chemists have first developed laws of has behavior using ideal conditions.   After the ideal laws, different scientists like Van Der Waal developed equations to incorporate the electrical forces between atoms and also space occupied by atoms. In this code, we used both these laws to calculate the pressure exerted by Argon gas due to given weight, volume and temperature.  First part of this code was to pull out unit conversions from scipy library constants to calculate value of gas constant R in different formats.  After this, we wrote three functions to calculate gas pressure by ideal gas law and using van der Waal equations. The required a,b values of different gases were stored in a dictionary and extracted when needed by using .get function. We also wrote a function, which tells us whether the calculated pressures are more or less as comp...