clear all close all m=1; g=9.81; %Insert here the time on the track h= ; min= ; sec= ; TimeOutdoorTrack=h*3600+min*60+sec; %Ine Distance= ; velocityTrack=Distance/TimeOutdoorTrack; %TimeOutdoorTrack=Distance/velocityTrack; TimeStraight(1)=TimeOutdoorTrack; %first guess of the time on the straight, the true time will be calculated next based on VO2submax on the track Timedifference(1)=0; BW=m*g; r=36.8; % outdoor track r=36.5m + 0.3 to measure; lap=400; %length of each lap: indoor is 200m, outdoor is 400m laps=(round(Distance/100))*100/lap; %number of laps on the track if Distance==1500 %special case for 1500m, 3.5 laps TotalLengthOnCurve=809.2743; else PortionOnCurve=r*2*pi/lap; TotalLengthOnCurve=laps*lap*PortionOnCurve; end TotalLengthOnStraight=Distance-TotalLengthOnCurve; %Straight VO2 calculation v=velocityTrack; %first guess of velocity on the straight portion for i=1:10000 v=v+0.0001; VcurveOutdoor=Vcurve5(v,r); TotalTimeOnCurve=TotalLengthOnCurve/VcurveOutdoor; TotalTimeOnStraight=TotalLengthOnStraight/v; TotalTime=TotalTimeOnCurve+TotalTimeOnStraight; Timedifference(i)=TotalTime-TimeOutdoorTrack; if Timedifference(i)<0.001 break end end TimeStraightRace=Distance/v; %time in seconds on a straight race TimeDiffStraightRace=TimeStraightRace-TimeOutdoorTrack; %difference compared to oudtoor track rindoor=17.5; %using this to convert from indoor to outdoor, %indoor track r=17.2m + 0.3 to measure lapindoor=200; lapsindoor=(round(Distance/100))*100/lapindoor; %number of laps on indoor track PortionOnCurveIndoor=rindoor*2*pi/lapindoor; TotalLengthOnCurveIndoor=lapsindoor*lapindoor*PortionOnCurveIndoor; TotalLengthOnStraightIndoor=Distance-TotalLengthOnCurveIndoor; VcurveIndoor=Vcurve5(v,rindoor); %this is the velocity the same athlete can hold on a 200m curve TotalTimeOnCurveIndoor=TotalLengthOnCurveIndoor/VcurveIndoor; TotalTimeOnStraightIndoor=TotalLengthOnStraightIndoor/v; TotalTimeIndoor=TotalTimeOnCurveIndoor+TotalTimeOnStraightIndoor; %time in seconds on indoor track