# Exercise: Fitting a Wave

In this exercise, you will find the parameters of an unknown equation by solving a system of linear equations.

## We'll cover the following

# Task

In this exercise, you will fit a wave by finding the unknown parameters of the equation

$y=a\space sin(\pi t)+b\space sin(2\pi t)+c\space sin(3\pi t)+d\space sin(4\pi t)$

using the data:

$(t_0, y_0)=(0.25, 3)$

$(t_1, y_1)=(0.5, 2)$

$(t_2, y_2)=(0.75, -3)$

$(t_3, y_3)=(1, 0)$

## Problem statement

By substituting the values given above, form a system of four linear equations and solve for the unknown parameters: $a, b, c$ and $d$

Create a plot of the wave for $t$ going from $0$ to $1$. Show the four measurements given above with dots. Add legends to your graphs as well.

A basic structure of the code is given to get you started.

Get hands-on with 1200+ tech skills courses.