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

meshtest(model,Z,vmax,Tmax,Pmax,deltav,deltaT,tit)
function meshtest(model,Z,vmax,Tmax,Pmax,deltav,deltaT,tit)
%PLOT_FORCES
%this function plots the 3D traction force as a function of speed and
%torque for a given model

% make a new grid with max speed, max Torque and Speed step and Torque step
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);

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

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

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

%make figure
% figure(1)
% set(axes,'fontsize',12)
% set(text,'fontsize',12)
% hold on
% grid on
% plot3(Xnew(:,2),Xnew(:,1),Ynew,color)
% view(150,-30);
% axis([ 0 Tmax 0 vmax 0 150])
% title(tit)
% ylabel('Speed [km/h]','rotation',30)
% zlabel('Traction force [N]')
% xlabel('Torque [Nm]','rotation',-10)
% hold off

mesh(Yen,Xen,ZZ);
%h=figure(1)
% set(axes,'fontsize',12)
 set(text,'fontsize',12)
% 
% hold on
% grid on
% view(150,-30);
% axis([0 Tmax 0 vmax 0 150])
% title(tit)
% ylabel('Speed [km/h]','rotation',30)
% zlabel('F_t [N]','rotation',90)
% xlabel('T_c [Nm]','rotation',-10)
% hold off
% 

Contact us at files@mathworks.com