% motor analysis 
%
%
clear
motordata
[nmotor,col]=size(mdata)
for ii=1:nmotor
	
	ii
	disp(' ')
	disp('Start new motor')
	titstr=mname(ii,:);
	disp(titstr)
	Kv=mdata(ii,1)      %RPM/volt
	Kt=mdata(ii,2)      % inch-ounce per ampere
	R= mdata(ii,3)      % Ohms
	Io=mdata(ii,4)      % amperes
	Vin=mdata(ii,6)     % volt
	HP=mdata(ii,7)      % Nominal Horsepower
	Iin=Io:30;
	[Pout,Poutfpps,PoutHp,Pin,Tout,Toutfp,RPM,eta]=motor(Vin,Iin,Kv,Kt,R,Io);
	figure(ii); clf
	titstr=[titstr,' w/rubber3 overplots'];
	motorplot(Iin,Pout,Tout,RPM,eta,titstr)
	[PoutMax,PoutfppsMax,PoutHpMax,PinMax,ToutMax,ToutfpMax,RPMMax,etaMax]=...
	motoranalysis(Pout,Poutfpps,PoutHp,Pin,Tout,Toutfp,RPM,eta,titstr)
	
	[Kv,Kt,R,Io]=rubber(HP)
	[Pout,Poutfpps,PoutHp,Pin,Tout,Toutfp,RPM,eta]=motor(Vin,Iin,Kv,Kt,R,Io);
	motorplot2(Iin,Pout,Tout,RPM,eta,titstr)
	pause
end
%
%
