\(\renewcommand\AA{\unicode{x212B}}\)
The aim of this exercise is to implement a simple linear fitting function defined as:
The function should have 2 parameters:
A0
: intercept with the y-axis.A1
: gradient of the function.Define a class called PyLinearFunction
init
function that declares the two parameters.function1D
function that returns the y values for the given x values
as a numpy array.To test:
PyLinearFunction
.StartX
to 0.1 and EndX
to 2.0Once finished check your answer with the provided Exercise 5 Solutions