# README – Quadratic_Loc_def.m

## What the script does

The script evaluates a wheel-soil interaction model for a cylindrical flexible wheel on soft lunar regolith. For each configuration, it:

- computes contact geometry through an iterative vertical equilibrium,
- builds quadratic approximations of normal and shear stress distributions,
- integrates the stresses to obtain forces and moments,
- computes motion resistances, traction, drawbar pull, drive torque, and drive power,
- estimates wheel thickness and mass,
- stores the results in a MATLAB table,
- computes a simple figure of merit based on drawbar pull, power, and mass,
- appends the results to a `.mat` archive and exports Excel tables.

## Main inputs

The main inputs are defined directly in the script:

- soil parameters (`lunar_soil`),
- wheel and rover parameters (`rover`),
- terrain slope angle,
- selected configuration index for optional diagnostic plots.

## Main outputs

The script produces:

- `TAB`: full results table,
- `TAB_sorted_metric`: table sorted by figure of merit,
- `TAB_quad_flessibile.mat`: cumulative archive in `Tabella_trend`,
- `tabella_quadratic_locB.xlsx` : an excel file.


## External functions

This script calls external functions :

- `Ww_fun`
- `Fz_soil_subcircle`
- `coeff_quad_fun`
- `Force_quad_fun`
- `Resistence_fun`
- `setup_axes_3d_zoom`


## Comparison model

The quadratic model is saved in the File Comparison model,
 togheter with the uniform model in order to be analysed.
