Boiling Curve Planning
Boiling Curve Planning
Steps:
1. Initiate variables for all points
2. Ask the user for input of a temperature
3. If the input is outside the bounds (userTermperature < x1 OR userTemperature > x5):
a. Display an error message
4. If the input is inside the bounds (userTermperature < x1 OR userTemperature > x5):
#Note: The correct formula for the formula is yInitial * (userTemperate / xInitial) ^ (log(yAfter /
yInitial) / log(xAfter / xInitial)). I didn’t know we were using a different linear interpolation
formula.
a. If the input is within the bounds (x1 <= userTemperature < x2):
i. surfaceHeatFlux = y1 + ((userTemperature - x1) * (y2 - y1) / (x2 - x1))
b. If the input is within the bounds (x2 <= userTemperature < x3):
i. surfaceHeatFlux = y2 + ((userTemperature - x2) * (y3 - y2) / (x3 - x2))
c. If the input is within the bounds (x3 <= userTemperature < x4):
i. surfaceHeatFlux = y3 + ((userTemperature - x3) * (y4 - y3) / (x4 - x3))
d. If the input is within the bounds (x4 <= userTemperature <= x5):
i. surfaceHeatFlux = y4 + ((userTemperature - x4) * (y5 - y4) / (x5 - x4))
e. Once surfaceHeatFlux is calculated, display it to the user
Test Cases:
50 331798
100 42835
3 3347
420 231940
70 122826
1000 1084664
666 526509
777 692543
1.3 1000
30 1500000
120 25000
1200 1500000
-100 DNE
0 DNE
10000 DNE
Green = typical
Yellow = edge
Red = corner