<aside>
ðŸ“Œ Below is the report I wrote for the final project of the numerical methods class I took fall of my Sophomore year. The project was to use numerical methods in MATLAB to model and solve a real-world physics problem

</aside>

Name: Jesse Gilbert

Due: December 21, 2021

Class: Numerical Methods (ES-55)

Final Project

## Description

This program simulates a skier skiing down a slope with varied terrain and stops when the skier reaches the end. The program uses ODEs to solve for the skierâ€™s position and velocity over time, taking into account factors such as air resistance, friction with the snow, and the varied downward force the skier experiences with different hill curvatures.

An animation is generated to show the skier as they go down the hill. The ski slope is made up of a straight line that has a slope of -1 and a user-defined height, and then a parabola with a user-defined shape.

## Inputs

- Factor of area of skier (2 doubles the area, .5 halves the area) (default=1)
- Factor of coefficient of kinetic friction of snow (2 doubles it simulating slushing conditions for example, .5 halves the it simulating icy conditions for example) (default=1)
- Two attributes of the ski hill
- the starting height of the hill (default=5)
- a shape factor of the parabolic bottom part of the hill (default=1)

## Outputs

The program does the following:

- Accepts input on four variables from the user
- Evaluates the shape of the ski hill given certain pre-programmed and user-entered parameters
- Calculates the first and second derivatives of the elevation of the ski hill (using
**diff**). A graph of the hillâ€™s shape and first two derivatives are displayed
- Waits for the user to continue...
- Uses
**ode45** to calculate the skierâ€™s position and velocity over time (using equations shown in Appendix III)
- Uses
**spline** twice to interpolate the first and second derivatives of the hillâ€™s elevation at specific points

- Animates results
- Uses
**spline** to interpolate the skierâ€™s position at equally spaced time intervals

- Waits for the user to continue...
- Plots the skierâ€™s position and velocity over time

## Numerical Methods

- ODEs (using
**ode45**, with events)
- Twice differentiation of ski slope (using
**diff)**
- Interpolation (using
**spline**)
- Of derivatives of ski slope within ode45 evaluation
- Of position of skier for animation