# ocularbear8/meen357-mars-rover architecture

> Architecture diagram of the GitHub repository ocularbear8/meen357-mars-rover, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ocularbear8/meen357-mars-rover
- Repository: https://github.com/ocularbear8/meen357-mars-rover

## Overview

This repository models rover mobility and produces plots of motor/gearbox behavior and maximum speed under terrain conditions. The main workflow loads rover and planet parameters, evaluates the force balance, solves for the zero-net-force speed, and plots the result. Separate scripts cover rolling resistance, slope, and their combined effect; motor and speed-reducer plots form a supporting capability. Source excerpts show the analysis scripts and shared calculations, but no README or additional runtime wiring was provided.

Main entry points: [`Phase 1/subfunctions.py`](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py) (Force model), [`Phase 1/analysis_terrain_slope.py`](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_terrain_slope.py) (Slope analysis), [`Phase 1/analysis_rolling_resistance.py`](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_rolling_resistance.py) (Resistance analysis), [`Phase 1/analysis_combined_terrain.py`](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_combined_terrain.py) (Combined terrain analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Model inputs"]
  node_parameters["Rover parameters<br/>[global_dicts.py]"]
end

subgraph group_physics["Rover physics"]
  node_force_model["Force model<br/>[subfunctions.py]"]
  node_drive_force["Drive force<br/>[subfunctions.py]"]
  node_gravity_force["Gravity force<br/>[subfunctions.py]"]
  node_rolling_force["Rolling force<br/>[subfunctions.py]"]
  node_motor_torque["Motor torque<br/>[subfunctions.py]"]
  node_gear_ratio["Gear ratio<br/>[subfunctions.py]"]
end

subgraph group_analysis["Performance analysis"]
  node_slope_analysis["Slope analysis"]
  node_rolling_analysis["Resistance analysis"]
  node_combined_analysis["Combined terrain analysis"]
  node_motor_graphs["Motor characteristics<br/>[graphs_motor.py]"]
  node_reducer_graphs["Reducer characteristics<br/>[graphs_sr.py]"]
end

node_engineer(("Engineer"))
node_root_solver["Scalar root solver"]
node_plotting["Plot display"]

node_engineer -->|"runs analysis"| node_slope_analysis
node_engineer -->|"runs analysis"| node_rolling_analysis
node_engineer -->|"runs analysis"| node_combined_analysis
node_engineer -->|"runs plots"| node_motor_graphs
node_engineer -->|"runs plots"| node_reducer_graphs
node_slope_analysis -->|"loads parameters"| node_parameters
node_rolling_analysis -->|"loads parameters"| node_parameters
node_combined_analysis -->|"loads parameters"| node_parameters
node_motor_graphs -->|"loads parameters"| node_parameters
node_reducer_graphs -->|"loads parameters"| node_parameters
node_slope_analysis -->|"evaluates force"| node_force_model
node_rolling_analysis -->|"evaluates force"| node_force_model
node_combined_analysis -->|"evaluates force"| node_force_model
node_slope_analysis -->|"solves speed"| node_root_solver
node_rolling_analysis -->|"solves speed"| node_root_solver
node_combined_analysis -->|"solves speed"| node_root_solver
node_force_model -->|"sums forces"| node_drive_force
node_force_model -->|"sums forces"| node_gravity_force
node_force_model -->|"sums forces"| node_rolling_force
node_drive_force -->|"uses torque"| node_motor_torque
node_drive_force -->|"uses ratio"| node_gear_ratio
node_rolling_force -->|"uses ratio"| node_gear_ratio
node_motor_graphs -->|"computes torque"| node_motor_torque
node_reducer_graphs -->|"computes torque"| node_motor_torque
node_reducer_graphs -->|"computes ratio"| node_gear_ratio
node_slope_analysis -->|"plots speed"| node_plotting
node_rolling_analysis -->|"plots speed"| node_plotting
node_combined_analysis -->|"plots surface"| node_plotting
node_motor_graphs -->|"plots curves"| node_plotting
node_reducer_graphs -->|"plots curves"| node_plotting

click node_parameters "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/global_dicts.py"
click node_force_model "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py"
click node_drive_force "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py"
click node_gravity_force "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py"
click node_rolling_force "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py"
click node_motor_torque "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py"
click node_gear_ratio "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py"
click node_slope_analysis "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_terrain_slope.py"
click node_rolling_analysis "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_rolling_resistance.py"
click node_combined_analysis "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_combined_terrain.py"
click node_motor_graphs "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/graphs_motor.py"
click node_reducer_graphs "https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/graphs_sr.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_parameters toneBlue
class node_force_model,node_drive_force,node_gravity_force,node_rolling_force,node_motor_torque,node_gear_ratio toneAmber
class node_slope_analysis,node_rolling_analysis,node_combined_analysis,node_motor_graphs,node_reducer_graphs toneMint
class node_engineer,node_root_solver,node_plotting toneIndigo
```

## Components

### Model inputs

- [Rover parameters](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/global_dicts.py): `Phase 1/global_dicts.py`

### Rover physics

- [Force model](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py): `Phase 1/subfunctions.py`
- [Drive force](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py): `Phase 1/subfunctions.py`
- [Gravity force](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py): `Phase 1/subfunctions.py`
- [Rolling force](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py): `Phase 1/subfunctions.py`
- [Motor torque](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py): `Phase 1/subfunctions.py`
- [Gear ratio](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/subfunctions.py): `Phase 1/subfunctions.py`

### Performance analysis

- [Slope analysis](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_terrain_slope.py): `Phase 1/analysis_terrain_slope.py`
- [Resistance analysis](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_rolling_resistance.py): `Phase 1/analysis_rolling_resistance.py`
- [Combined terrain analysis](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/analysis_combined_terrain.py): `Phase 1/analysis_combined_terrain.py`
- [Motor characteristics](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/graphs_motor.py): `Phase 1/graphs_motor.py`
- [Reducer characteristics](https://github.com/ocularbear8/meen357-mars-rover/blob/main/Phase%201/graphs_sr.py): `Phase 1/graphs_sr.py`

### Other components

- **Engineer**
- **Scalar root solver**
- **Plot display**

## Connections

- Engineer → Slope analysis: runs analysis
- Engineer → Resistance analysis: runs analysis
- Engineer → Combined terrain analysis: runs analysis
- Engineer → Motor characteristics: runs plots
- Engineer → Reducer characteristics: runs plots
- Slope analysis → Rover parameters: loads parameters
- Resistance analysis → Rover parameters: loads parameters
- Combined terrain analysis → Rover parameters: loads parameters
- Motor characteristics → Rover parameters: loads parameters
- Reducer characteristics → Rover parameters: loads parameters
- Slope analysis → Force model: evaluates force
- Resistance analysis → Force model: evaluates force
- Combined terrain analysis → Force model: evaluates force
- Slope analysis → Scalar root solver: solves speed
- Resistance analysis → Scalar root solver: solves speed
- Combined terrain analysis → Scalar root solver: solves speed
- Force model → Drive force: sums forces
- Force model → Gravity force: sums forces
- Force model → Rolling force: sums forces
- Drive force → Motor torque: uses torque
- Drive force → Gear ratio: uses ratio
- Rolling force → Gear ratio: uses ratio
- Motor characteristics → Motor torque: computes torque
- Reducer characteristics → Motor torque: computes torque
- Reducer characteristics → Gear ratio: computes ratio
- Slope analysis → Plot display: plots speed
- Resistance analysis → Plot display: plots speed
- Combined terrain analysis → Plot display: plots surface
- Motor characteristics → Plot display: plots curves
- Reducer characteristics → Plot display: plots curves
