# find the hypotenuse and the smallest angle in a right angled triangle
x = 3;
y = 4;
z = sqrt (x^2 + y^2);
theta = (180/pi)*atan(y/x);
# This will display values of x, y, and z on the Output Area when you click Calculate or press the Enter key.
# Note that variables such as p1, T2, x5, h10, etc., will be interpreted as state properties and, hence,
# cannot be used as a user defined variables. Multiple statement can be typed in in a single line separated by
# semi-colon(;)
p/><# Energy and entropy analysis of a turbine operating at steady state.
# It is assumed that States 1 (inlet), 2 (isentropic exit), 3 (actual exit) states are already calculated.
WdotT_s = mdot1*(h1-h2);
WdotT_a = mdot1*(h1-h3);
turbEff = 100* WdotT_a/Wdot_a;
Sdotgen = mdot1*(s3-s1);
# Even though the Device Panel (as in the Java based TESTcalcs) is not yet available, this example shows that a device analysis is quite
# possible in the I/O panel.
# In the Input Area, we specify a pressure ratio and use it in a state calculation
pRatio = 10;
# Now, in State-2 for p2, we can enter = p1*pressureRatio; (assuming p1 is known).
States {
State-1: H2O
Given: {p1 = 1000.0 kPa; T1 = 500.00 deg-C; Vel1 = 0.0000 m/s; z1 = 0.0000 m; m1 = 2.0000 kg; }
State-2: H2O
{T2 = 50.000 deg-C; s2 = "=s1" kJ/kg.K; Vel2 = 0.0000 m/s; z2 = 0.0000 m; m2 = "=m1" kg; }
};
# A detailed solution report is also displayed in the I/O Panel. Also, calculated properties of all states are displayed in a table in the Graphics Panel.
# You can copy and save the TEST-code in your computer for regenerating the solution later as described below.