exercise_plot1;
v_var = [1:1:20]; % array of different velocities in km/h
dist_travelled_km = [];
for v=1:length(v_var)
A = FSA(h_rider, m_rider) + A_segway;
vel = v_kmh2msec(v_var(v));
m = m_segway + m_rider;
Torque = (d_wheel / 2) * F_total(A, vel, c_D, m, alpha);
P_mech_effective = Torque * v_msd2rad(v_kmh2msec(v_var(v)), d_wheel);
P_ideal_batteries = P_mech_effective * (1 / eff_overall);
t_travelled = E_batteries_total ./ P_ideal_batteries;
dist_travelled = t_travelled * v_kmh2msec(v_var(v));
dist_travelled_km(v,:) = dist_travelled / 1000; % v in rows; m in columns
end
mesh(m_rider, v_var, dist_travelled_km), xlabel('Weight of person in kg'), ylabel('Velocity in km/h'), zlabel('Distance travelled in km');