Answered step by step
Verified Expert Solution
Link Copied!

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 11
Eulers Technique
The slope of a function y(x) is described by the differential equation:
=4+3
The function has an initial value of y(0)=1.
Write a Python notebook which uses Eulers Technique to determine the value of the
function at x =2. Use an initial step size of x =0.5
Plot the numerical solution and the analytical solution on the same graph.
Notes
1. Include markdown cells to give a suitable description of your work.
2. The code required for this solution is very similar to the example covered in lecture
11. Identify the things you will need to change in that example.
3. Try working out a few iterations by hand so that you have values to use to test your
programme. Build your programme up stage-by-stage and be happy that each stage
is working before you move on to the next.
4. Your programme should list the values of x and y for each iteration.
5. The analytical solution is easy to find by separating variables, integrating and
applying the initial condition. The solution is ()=22+3+1
6. Plot the numerical solution and the analytical solution on the same graph for
x =0.5. Include this graph is the version of your notebook that you submit.
7. Re-run your programme with x =0.05 and x =0.005. In a markdown cell, include
a table of x and the corresponding y(2) values.
8. Reset x to 0.5 and re-run 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.
9. 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 PH2102 canvas page before
the deadline.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

State Newton's second law of motion.

Answered: 1 week ago

Question

Give the reliability function of the structure of Exercise 8.

Answered: 1 week ago

Question

Define HRM and its relation to organizational management

Answered: 1 week ago

Question

Explain the theoretical issues surrounding the HRM debate

Answered: 1 week ago