gaslaw
Returns the pressure, volume, weight or temperature inside a gas given the other three parameters.
Controller: CodeCogs
Contents
Interface
C++
Excel
Gaslaw
| doublegaslaw( | int | target | |
| double | pressure | ||
| double | volume | ||
| double | weight | ||
| double | gas_constant | ||
| double | temperature | )[inline] |
Example 1
#include <stdio.h> #include <codecogs/engineering/fluids/imperial/gaslaw.h> int main() { double p = Engineering::Fluids::Imperial::gaslaw (PRESSURE, 0, 1000, 850.3, 1130, 10), V = Engineering::Fluids::Imperial::gaslaw (VOLUME, 9608.39, 0, 850.3, 1130, 10), w = Engineering::Fluids::Imperial::gaslaw (WEIGHT, 9608.39, 1000, 0, 1130, 10), R = Engineering::Fluids::Imperial::gaslaw (GAS, 9608.39, 1000, 850.3, 0, 10), T = Engineering::Fluids::Imperial::gaslaw (TEMPERATURE, 9608.39, 1000, 850.3, 1130, 0); printf(" Pressure = %.2lf lb/ft^3\n", p); printf(" Volume = %.2lf ft^3\n", V); printf(" Weight = %.2lf lb\n", w); printf("Gas constant = %.2lf ft lb/slug deg.R\n", R); printf(" Temperature = %.2lf deg.R\n", T); return 0; }
Output
Pressure = 9608.39 lb/ft^3 Volume = 1000.00 ft^3 Weight = 850.30 lb Gas constant = 1130.00 ft lb/slug deg.R Temperature = 10.00 deg.R
Note
- To add table with gas constants on http://www.engineeringtoolbox.com/individual-universal-gas-constant-d_588.html
References
- The Engineering Division, Crane Co., "Flow of fluids through valves, fittings, and pipe", Chicago, 1957
Parameters
target PRESSURE, VOLUME, WEIGHT, GAS or TEMPERATURE pressure pressure inside the gas (lb/ft absolute) volume volume of gas (ft) weight weight of gas (lb) gas_constant the individual gas constant (ft lb/slug R) temperature absolute temperature of gas (R)
Returns
- The value of the desired parameter.
Authors
- Lucian Bentea (July 2006)
Source Code
This module is private, for owner's use only.
Not a member, then Register with CodeCogs. Already a Member, then Login.

