All problems
Wind Power Curve
Problem
Evaluate a wind turbine power curve. Below cut_in or above cut_out the power is 0.0; at or above rated_speed it is rated_power; in between it follows the cube of the normalized wind speed: rated_power * ((speed - cut_in) / (rated_speed - cut_in))^3.
Return the power for the given speed.
Hint
The cubic region captures the physics of available wind power.
Test cases
case 1
in: [3,3,12,25,2]
expected: 0
case 2
in: [12,3,12,25,2]
expected: 2
case 3
in: [26,3,12,25,2]
expected: 0
case 4
in: [7.5,3,12,25,2]
expected: 0.25
Starter codePython
def wind_power_curve(speed, cut_in, rated_speed, cut_out, rated_power):
# Your code here
pass4 test cases · run your code against them in the editor