Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Computers in Physics - Assignment 1 1 Euler s Technique The slope of a function y ( x ) is described by the differential equation:
Computers in Physics Assignment
Eulers Technique
The slope of a function yx is described by the differential equation:
The function has an initial value of y
Write a Python notebook which uses Eulers Technique to determine the value of the
function at x Use an initial step size of x
Plot the numerical solution and the analytical solution on the same graph.
Notes
Include markdown cells to give a suitable description of your work.
The code required for this solution is very similar to the example covered in lecture
Identify the things you will need to change in that example.
Try working out a few iterations by hand so that you have values to use to test your
programme. Build your programme up stagebystage and be happy that each stage
is working before you move on to the next.
Your programme should list the values of x and y for each iteration.
The analytical solution is easy to find by separating variables, integrating and
applying the initial condition. The solution is
Plot the numerical solution and the analytical solution on the same graph for
x Include this graph is the version of your notebook that you submit.
Rerun your programme with x and x In a markdown cell, include
a table of x and the corresponding y values.
Reset x to and rerun all cells. The final version of your notebook should only
list the x and y values, and show the plot, for this initial step size.
Download a copy as a html file or a pdf Use the format which looks best when you
upload it using Turnitin. Submit your homework on the PH canvas page before
the deadline.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started