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

contourplot_torques(model,Z,vmax,Fmax,Pmax,deltav,deltaF,tit)
function contourplot_torques(model,Z,vmax,Fmax,Pmax,deltav,deltaF,tit)
%PLOT_FORCES3D
%plot_forces3D(model,Z,vmax,Tmax,Pmax,deltav,deltaT,tit,cmap)
%this function plots the 3D traction force as a function of speed and
%torque for a given model, 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))


% make a new grid with max speed, max Torque and Speed step and Torque step
vgrid = 0:deltav:vmax;
Fgrid = 0:deltaF:Fmax;

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

%Remove point above the powerlimit and the torquelimit
for i=1:length(Xnew)
    if or(Xnew(i,1)/3.6*Xnew(i,2)>Pmax,Ynew(i)>80)
            Ynew(i)=NaN;
        end
        if Xnew(i,2)>Fmax
            Ynew(i)=NaN;
        end
    end

    
%Prepare to mesh
[Xen Yen]=meshgrid(vgrid,Fgrid);

for k=1:length(vgrid)
        ZZ(:,k)=Ynew(((k-1)*length(Fgrid))+1:k*length(Fgrid));
end  

  
set(text,'fontsize',12)
[C,h]=contour(Xen,Yen,ZZ);
clabel(C,h);
axis([0 vmax 0 Fmax]);
title(tit,'fontsize',14)
xlabel('Speed [km/h]')
ylabel('Traction Forces [N]')
else
     errordlg('there are no models found for this assistance mode','Bad Input','modal')
end

%end

Contact us at files@mathworks.com