FUNCTION
work
Computes the work done by a thermal machine. Computes the work done by a thermal machine.
You're viewing an older version of this page (#5688). View the current version.
Interface
#include <codecogs/engineering/thermodynamics/work.h>
using namespace Engineering::Thermodynamics;
According to Thermodynamics second law, a thermal machine works in cycles receiving and losing heat and receiving or doing work. (Act as a machine or refrigerator)
Example 1
The work done by a machine receiving 10J of heat and losing 4J to ambient, with cycle in clockwise direction
printf("%.0f",work(10,4,1));Output: 6
Parameters
Returns
Input for cycle must be -1 or 1 (counter-clockwise and clockwise), if a value different from those is inputted, the function will return 0.
Interactive Calculator
Computing…
Set a range above first to export a graph.