% Delivered to the Government in Accordance with Contract FA8650-10-C-7080
% 
%  (c) 2011 United Technologies Corp.
% Developed with the sponsorship of the Defense Advanced Research Projects Agency (DARPA).
%  
% Permission is hereby granted, free of charge, to any person obtaining a copy of this data, including any software or models in source or binary form, as well as any drawings, specifications, and documentation (collectively "the Data"), to deal in the Data without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Data, and to permit persons to whom the Data is furnished to do so, subject to the following conditions:
%  
% The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Data.
%  
% THE DATA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, SPONSORS, DEVELOPERS, CONTRIBUTORS, OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DATA OR THE USE OR OTHER DEALINGS IN THE DATA.
% 


% Yu Long created the cost model of PLC toy problem. 2011-March-18
% The cost value and material conduction coeff are all faked for the demo
% purpose. 

function [cost, Heatconduction_coeff] = RLC_MfgCost_Equations(Length,TR_R,TC_C)

% Cost
if ( TR_R >= 680 )
    costunit =7.0 ; % for assumed wire material A, cost per meter is 10$
    costboard = 7;% for assumed board material AA, cost per meter is 100$
else if  TR_R >= 600
        costunit=4.0; % for assumed wire material B, cost per meter is 5$
        costboard = 4;% for assumed board material BB, cost per meter is 50$
    else if  TR_R >= 550
        costunit=2.0; % for assumed wire material C, cost per meter is 2$
        costboard = 2;% for assumed board material CC, cost per meter is 20$
    else 
            costunit =1.0; % for assumed wire material D, cost per meter is 1$
            costboard = 1;  % for assumed board material DD, cost per meter is 10$
        end
    end
end

cost = Length * costunit + costboard *1  + 0.2;  % assume $10 is the baseline cost for RLC components, and other labors without wire linkage and board.

%Heatconduction_coeff changed. 
if TR_R >680
    Heatconduction_coeff =.2 ; % for assumed board material AA, heat conduction coeff is .2
else if TR_R >= 600
        Heatconduction_coeff =.3; % for assumed material BB, heat conduction coeff is .3
    else if TR_R >=550
            Heatconduction_coeff =.4; % for assumed material CC, heat conduction coeff is 0.4
        else
            Heatconduction_coeff = 0.35; % for assumed material DD, heat conduction coeff is 0.35
        end
    end
end

% end of the function. 
