Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code is provided Task 1. (10 pts) Consider the following equation: y' = y(sin x 1) + (0.1 cos x + 1) Its solutions have

code is provided image text in transcribed
image text in transcribed
image text in transcribed
Task 1. (10 pts) Consider the following equation: y' = y(sin x 1) + (0.1 cos x + 1) Its solutions have the following property: any solution tends to the only periodic solution as x + +0. In this task, you will use this property to find numerically the periodic solution of the equation. See Quercus on Euler's method and Sec. 2.4 "Application for programs that implement the Euler's method. You may also modify this Python program. If you follow the link, you will be able to run the program from your browser. Note that your changes will be lost on page reload, so you should save them locally. If you modify the provided program, describe the changes you make in your solution. You may also write your own program (using any language), but you should include the code in your solution. To test your program: the solution with y(0) = 0 should satisfy y(5) 0.572. (a) Use the Euler's method with the step size 0.01 to solve this equation numerically with initial condition y(0) = 0. Find an approximate value of y(10). (b) Observe that for large x, the solution is almost periodic with period 27, so that y approaches some periodic solution y. Find (an approxi- mation to y(0) where y is the only periodic solution. Hint: look at y(2), y(47), y(67) etc. (c) Choose another initial condition and repeat (b). Did you obtain the same periodic solution y? Here is a program in Python 3 that solves the initial value problem y'=y, y(0)=1 on the segment [0,1] via Euler's method with the step size 0.01, and prints all intermediate points. x=0 y=1 S = 0.01 for n in range(100): y = y + 5*y X = X + S print("{:.3f}\t{:.3f}".format(x, y)) The first two lines of the program fix initial conditions. s is a step size. "for n in range(100):" is a cycle: whatever follows will be executed 100 times. Indentation is important: the last three lines are indented, that's why they are inside the cycle. The symbols {:.3f}\t{:.3f} inside print are used to have your output rounded up to 3 decimal digits and separated by tabs (this is what \t does). You may just write print (x,y) if you do not care about rounding

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

1. Identify the sources for this conflict.

Answered: 1 week ago

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago

Question

2. What recommendations will you make to the city council?

Answered: 1 week ago