Cody

# Problem 3065. Cycling — Critical Power

Solution 597697

Submitted on 17 Mar 2015 by Gergely Patay
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% AWC = 5e4; CP = 200; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,2000,1000,667,500,333,250,167,63]; assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

ans = Columns 1 through 8 Inf Inf 2000 1000 667 500 333 250 Columns 9 through 10 167 63

2   Pass
%% AWC = 5.3e4; CP = 222; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,17667,1893,1000,679,414,298,191,68]; assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

ans = Columns 1 through 8 Inf Inf 17667 1893 1000 679 414 298 Columns 9 through 10 191 68

3   Pass
%% AWC = 4.6e4; CP = 250; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,Inf,Inf,1840,920,460,307,184,61]; assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

ans = Columns 1 through 8 Inf Inf Inf Inf 1840 920 460 307 Columns 9 through 10 184 61

4   Pass
%% AWC = 5e4; CP = 300; P = 250:50:1500; t_corr = [Inf,Inf,1000,500,333,250,200,167,143,125,111,100,91,83,77,71,67,63,59,56,53,50,48,45,43,42]; assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

ans = Columns 1 through 8 Inf Inf 1000 500 333 250 200 167 Columns 9 through 16 143 125 111 100 91 83 77 71 Columns 17 through 24 67 63 59 56 53 50 48 45 Columns 25 through 26 43 42

5   Pass
%% ind = randi(4); switch ind case 1 AWC = 5e4; CP = 200; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,2000,1000,667,500,333,250,167,63]; case 2 AWC = 5.3e4; CP = 222; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,17667,1893,1000,679,414,298,191,68]; case 3 AWC = 4.6e4; CP = 250; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,Inf,Inf,1840,920,460,307,184,61]; case 4 AWC = 5e4; CP = 300; P = 250:50:1500; t_corr = [Inf,Inf,1000,500,333,250,200,167,143,125,111,100,91,83,77,71,67,63,59,56,53,50,48,45,43,42]; end assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

ans = Columns 1 through 8 Inf Inf 2000 1000 667 500 333 250 Columns 9 through 10 167 63