function Vcalibrated=AS1Baron58(Vindicated,flap)
% function Vcalibrated=AS1Baron58(Vindicated,flap)
% Correct indicated airspeed for instrument error and static position error.
% Data is extracted from Pilots Operating Handbook Baron 58, page 5-16 (Normal System).
% It is assumed that the Beechcraft Baron 58 has zero instrument correction.
% Therefore 
%             Vinstrumentcorrected (Vic) = Vindicated (Vi)
% Given below are the position error corrections to get Vcalibrated. 
% They are a function of Vindicated and flap position.
%             Vcalibrated=f(Vindicated,flap)
%                   flap=0   for no flap
%                   flap=0.5 for half flap
%                   flap=1   for full flap
% Vindicated and Vcal are a row vectors.
% Half flap data is linearly interpolated between no flap and full flap data.
% Units are KNOTS.

CASnoflap=Vindicated;  % There is no position error in airspeed for no flap.
CASfullflap= 0.95029*Vindicated +   4.0465;
Vcalibrated=(1-flap).*CASnoflap+flap.*CASfullflap;
