classdef computeBatterySizing < handle
    %
    
    properties 
        
        totalCrankingInrushCurrent;
        totalCrankingCurrent;        
        totalAccesoriesCurrent;
        totalKeyOffLoad;
        batteryCCA;
        batteryCapacity;
        puekertcoefficient;
        
                
    end
    
    methods
        
        function obj = computeBatterySizing(obj)
            
            obj.totalCrankingInrushCurrent = 0;
            obj.totalCrankingCurrent = 0;            
            obj.totalAccesoriesCurrent = 0;
            obj.totalKeyOffLoad = 0;
            obj.batteryCCA = 0;
            obj.batteryCapacity = 0;
            obj.puekertcoefficient = 1.2;
           
        end
        
        function obj = displayResults(obj)
            
            
            tempNumdaysToDischarge = (((obj.batteryCapacity/obj.puekertcoefficient)*0.3)/(obj.totalKeyOffLoad*1e-3))/24;
            disp(['Total KeyOffLoad: ',num2str(obj.totalKeyOffLoad),' mA']);
            disp(['Number of days required for KeyOffLoad to discharge 30% of battery: ',num2str(tempNumdaysToDischarge),'.']);
            disp(['Total CrankingInRush current: ',num2str(obj.totalCrankingInrushCurrent),' A']);
            disp(['Total Cranking current: ',num2str(obj.totalCrankingCurrent),' A']);
            
            if(obj.totalCrankingCurrent > obj.batteryCCA)
                
                disp('The Cold Cranking Amps of the specifed battery is not sufficient to start the car 0 F.')
                
            else
                
                disp('CCA of the specifed battery is sufficient to start the car at 0 F.')
                
            end
            
        end        
        
    end
    
end

