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_torques3D(model,Z,vmax,Fmax,Pmax,deltav,deltaF,tit,cmap)
function plot_torques3D(model,Z,vmax,Fmax,Pmax,deltav,deltaF,tit,cmap)
%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)
mesh(Yen,Xen,ZZ);
colormap(cmap);
%hold on
grid on
view(150,-30);
axis([0 Fmax 0 vmax 0 80])
title(tit,'fontsize',14)
ylabel('Speed [km/h]','rotation',30)
xlabel('F_t [N]','rotation',-10)
zlabel('T_c [Nm]','rotation',90)

else
     errordlg('there are no models found for this assistance mode','Bad Input','modal')
end
%hold off

Contact us at files@mathworks.com