MATLAB / SIMULINK

VEHICLE MODEL

7-DoF planar model with load transfer, anti-geometry, and aero maps. Configurable for any FSAE platform — RWD, FWD, or AWD with torque vectoring.

Get Module — £39 Try Demo ↓
VEHICLE PARAMS
Mass268 kg
CoG Height0.28 m
CL4.3
Cd1.5

The 7-DoF model solves for steady-state equilibrium using a Newton-Raphson solver wrapped around the Simulink model. The seven degrees of freedom:

x = [Vx, Vy, r, ω_FL, ω_FR, ω_RL, ω_RR](1)

For steady-state analysis (GGV, YMD), the solver finds β and r such that:

Mz(β, r) = 0   (yaw moment equilibrium)(2)
Ay = Vx · r   (kinematic constraint)(3)

The Newton solver uses scaled residuals [1/1000, 1] to handle O(1000) Mz vs. O(10) Ay error magnitudes, with line search damping and warm-started initial guesses.

SS7DoF_model.slx — Simulink block diagram
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
Newton solver implementation guide
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
Coordinate system conventions (ISO/SAE)
  ████████░░░░░██████████████████░░░░
    ██████████████████████░░░░░░░░██████
  ████████████░░░░██████████████████████░░░
  ██████░░░░██████████████████████░░░████
      ████████████████████████░░░░░░██████
  ██████████░░░██████████████████████░░████
    ████████████████████████░░░░░░░░░██████
  ████░░░░██████████████████████░░░██████
  ██████████████████░░░░██████████████████
    ██████████████████████░░░░░░░░██████████
Included with purchase
REF Milliken & Milliken, “RCVD” · Pacejka, “Tire and Vehicle Dynamics” · Guiggiani, “Science of Vehicle Dynamics”
MATLABnewton_solve_ss.m
LOCKED
function [beta, r, info] = newton_solve_ss(Vx, delta, veh, tyre, opts)
% Newton-Raphson solver for steady-state vehicle equilibrium
% Solves: Mz(beta, r) = 0, Ay_err = Vx*r - Ay_sim = 0
%
% Wraps Simulink model directly via sim()

TOL = opts.tol;        % 0.2 default
MAX_ITER = opts.maxiter; % 25
dx = opts.dx;          % 1e-3 (finite diff step)
W = [1/1000; 1];      % residual scaling
alpha_ls = [1.0, 0.5, 0.25, 0.1]; % line search

x = opts.x0;  % [beta; r]

for iter = 1:MAX_ITER
    [Mz, Ay] = run_simulink(Vx, delta, x(1), x(2), veh, tyre);
    Ay_target = Vx * x(2);
    F = W .* [Mz; Ay - Ay_target];
    
    if norm(F) < TOL
        info.converged = true;
        info.iter = iter;
        break
    end
    
    J = zeros(2);
    for j = 1:2
        x_pert = x; x_pert(j) = x_pert(j) + dx;
        [Mz_p, Ay_p] = run_simulink(Vx, delta, x_pert(1), x_pert(2), veh, tyre);
        F_pert = W .* [Mz_p; Ay_p - Vx*x_pert(2)];
        J(:,j) = (F_pert - F) / dx;
    end
    
    dx_step = -J \ F;
    % ... line search over alpha_ls
end

Full source code

Purchase to unlock code, docs & examples

Unlock — £39
newton_solve_ss.mNewton-Raphson steady-state solver
MATLAB
SS7DoF_model.slx7-DoF Simulink model
SIMULINK
VehParam.mCentralised parameter script
MATLAB
run_simulink.msim() wrapper with StopTime control
MATLAB
tyre_velocity.slxTyre velocity subsystem
SIMULINK
ymd_sweep.mYaw Moment Diagram generation
MATLAB
understeer_gradient.mKUS extraction from sweep
MATLAB
1
Install Simulink model
Open SS7DoF_model.slx in MATLAB R2020a+. No additional toolboxes required — Simulink base licence only.
2
Configure vehicle
Edit VehParam.m with mass, wheelbase, CoG, aero, suspension geometry. Anti-geometry and roll stiffness distribution are optional.
3
Load tyre data
Point the model to your .tir file. MF5.2 and MF6.1 supported. Use Tyre Fitting module if starting from raw data.
4
Run steady-state sweeps
Execute newton_solve_ss.m to generate equilibrium maps, YMDs, or feed into GGV/Lap Simulator modules.
FS Student
£39 / team

Full source code, documentation, and email support. Unlimited use within your FS team.

Get Started
With Setup
£119 / team

Full source + 1hr setup call + priority support. Custom vehicle config and tyre fitting included.

Contact Us

No toolboxes required. All optimisation uses custom solvers — no Optimization Toolbox, no Curve Fitting Toolbox. Works on base MATLAB R2020a+ / Python 3.8+.