# Wheel–Terrain Model Comparison and Visualization

## Overview

This code contains MATLAB scripts and functions for comparing the performance of four wheel–terrain interaction models and visualizing their outputs under different operating conditions.

The models compared are:

1. **Rigid quadratic model**
2. **Elastic quadratic model**
3. **Rigid constant model**
4. **Elastic constant model**

The analysis focuses on how key output variables change when varying one parameter at a time, while keeping the others fixed.

The main output variables analyzed are:

- **Drawbar pull [N]**
- **Total Motion resistance [N]**
- **Drive power [W]**
- **Maximum sinkage [m]**

In addition, contour plots are generated to study the combined effect of two varying parameters on the same output.

---

## Project Contents

The shared code includes:

- A script for **comparing the four models** with scatter plots and trend lines
- A script for generating **contour plots**
- A MATLAB function called **`scatterCompare4Models`**
- A helper function called **`filterTable`**

---

## Required Input Data

The scripts load the following MATLAB data files:

- `TAB_quad_rigida`
- `TAB_quad_flessibile`
- `TAB_semplice1`

These files are expected to contain MATLAB tables with model simulation results.

### Expected variables in the tables

The tables should include at least the following columns:

- `Diameter [m]`
- `Width [m]`
- `Number of wheel`
- `Slip ratio`
- `Velocity [m/s]`
- `Vehicle weight [kg]`
- `Type of wheel`
- `Deflection of the wheel [m]`
- `Drawbar pull [N]`
- `Total Motion resistance [N]`
- `Drive power [W]`
- `Maximum sinkage [m]`

`TAB_semplice1` must also contain the column:

- `Type of wheel`

with values such as:

- `rigid`
- `elastic`

This table is split into two subsets:

- `TAB_semplice_rigid`
- `TAB_semplice_elastic`

