No BSD License  

Highlights from
GUI for the performance analysis of pedelecs

image thumbnail
from GUI for the performance analysis of pedelecs by Jan Cappelle
Modeling the behaviour of electric bicycles

plot_SA3D(model,Z,mtot,vmax,Tmax,Pmax,deltav,deltaT,tit,cmap)
function plot_SA3D(model,Z,mtot,vmax,Tmax,Pmax,deltav,deltaT,tit,cmap)
%PLOT_SA3D
%plot_SA3D(model,Z,mtot,vmax,Tmax,Pmax,deltav,deltaT,tit,cmap)
%this function plots the 3D Slope ability as a function of speed and
%torque for a given model, Z , total mass, maximum values for speed, torque and power
%should be given, and also speedstep and torquestep, a title and a colormap
%are inputs.

if not(isnumeric(model))
% nieuwe punten
% we maken een schone grid van nieuwe punten
vgrid = 0:deltav:vmax;
Tgrid = 0:deltaT:Tmax;

for k=1:length(vgrid)
hulp(((k-1)*(length(Tgrid))+1):k*length(Tgrid),:)=[vgrid(k).*ones(length(Tgrid),1) Tgrid'];
end
Xnew = hulp;
Ynew = simlssvm(model,Xnew);

%voor een mooi figuurtje 
%halen we de slechte punten eruit
Plim=Pmax;
Tlim=Tmax;
for i=1:length(Xnew)
    if or(Xnew(i,1)/3.6*Xnew(i,2)/Z>Plim,Ynew(i)>120)
            Ynew(i)=NaN;
    end
        if Xnew(i,2)>Tlim
            Ynew(i)=NaN;
        end
end

%omzetten in percent van de helling die men kan oprijden...
g=9.81;
for i=1:length(Ynew)
    SA(i)=tan(asin(Ynew(i)/(mtot*g)))*100;
end

   
%Herconstrueren van een grid!
[Xen Yen]=meshgrid(vgrid,Tgrid);

for k=1:length(vgrid)
        SAS(:,k)=SA(((k-1)*length(Tgrid))+1:k*length(Tgrid));
end  



%figuren met mesh
set(text,'fontsize',12)
mesh(Yen,Xen,SAS);
colormap(cmap);
%hold on
grid on
view(150,-30);
axis([0 Tmax 0 vmax 0 20])
title(tit,'fontsize',14)
ylabel('Speed [km/h]','rotation',30)
zlabel('Slope [%]','rotation',90)
xlabel('T_c [Nm]','rotation',-10)
%hold off
else
     errordlg('there are no models found for this assistance mode','Bad Input','modal')
end

Contact us at files@mathworks.com