or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Miniproject 6
Initial due date: Sunday, April 9 at 11:59pm ET
Overview
This miniproject introduces a version of Euler's Method as a numerical solution technique for systems.
Prerequisites: You will need to be comfortable with using Euler's method for single differential equations. You'll also benefit from some familiarity with spreadsheets or Python in order to automate the calculations.
Background
This tutorial gives you the background you need for this assignment. Please read it and make sure you understand the concepts and the example: https://github.com/RobertTalbert/linalg-diffeq/blob/main/assignments/Euler's_Method_for_Systems.ipynb
Assignment
\[\begin{align*} \frac{dx}{dt} &= -y \\ \frac{dy}{dt} &= x \end{align*}\]
You can show (but don't do it in your writeup) that \(\mathbf{x}(t) = \begin{bmatrix} \cos(t) \\ \sin(t) \end{bmatrix}\) is a solution to this system. Its initial position is \(\mathbf{x}(0) = [1,0]^T\) and returns to this position when \(t = 2\pi\). In fact if you plot this in the phase plane, you'll see that the trajectory is a circle centered at the origin with radius 1.
(a) Use Euler's Method with a step size of \(0.5\) to approximate this solution from \(t = 0\) to \(t = 20\). This requires 39 different sets of calculations. Show just the first of these by hand, then use a computer or a spreadsheet to do the rest. (Not a calculator!) See the end of this assignment for instructions on how to submit your calculations.
(b) Calculate the percent error in each of the calculations you made, compared with the theoretical solution \([\cos(t), \sin(t)]\) to see how far off your approximations are. Remember percent error is calculated by \(\left| \dfrac{v_A - v_E}{v_E}\right| \cdot 100\%\) where \(v_A\) is the approximate or observed value, and \(v_E\) is the exact or expected value. Write 1-2 complete sentences summarizing what you see and then 1-2 more to explain why you think you are getting these results.
© and (d): Repeat parts (a) and (b) except using a step size of \(0.1\). This is now 199 calculations; again show the first one and then do the rest on a computer or spreadsheet. Don't forget the 2-4 sentences to write.
(e) The points on the actual solution curve are all a distance of 1 from the origin. Is this true of the approximate solutions? Are they too far away from the origin, or too close? What will happen for other step sizes – that is, will other approximate solutions using different step sizes be too far or too close to the origin? Write 2-4 sentences explaining what you think and why.
\[\begin{align*} \frac{dx}{dt} &= y + y^2 \\ \frac{dy}{dt} &= -x + \frac{y}{5} - xy + \frac{6y^2}{5} \end{align*}\]
given the initial condition \(x(0) = 1, y(0) = 1\). Show one set of calculations, then do the rest in a computer or spreadsheet.
Submission and Grading
Formatting and special items for grading
Miniproject 6 involves a significant amount of numerical calculations. The writeup you produce will be different from other Miniprojects, so read the following guidelines carefully.
You may do your calculations for Euler's Method in one of two ways:
import
statements, for example you may not import SciPy or NumPy; and you must include an explanation for what your code is doing and why it works with each code cell you use. If you import an external library like SymPy or NumPy, or if you give code with no explanation or an insufficient or irrelevant explanation, your work will be marked Incomplete and returned without comment.These problems typically also ask for written explanation and sometimes mathematical work that is not a spreadsheet or Python computation. If you are using a spreadsheet, you are allowed to use a document other than a Jupyter notebook (for example a Word document) to write these up. Then be sure to insert the link to your Google Sheet inside the document.
If you are writing Python code, just put your written and math work in the Colab notebook with your code, like you usually do.
Please note, no other spreadsheets (Excel, Numbers, etc.) are allowed. It has to be a Google Sheet. And, do not use a hand calculator! This would force you to perform roughly 300 different sets hand calculations separately if you did. Use Google Sheets or Python, nothing else.
I do not typically look over student work to give feedback before it's submitted, but if you want to show me your work prior to submission to make sure it is formatted correctly, that's fine this time.
Otherwise: Please review the section on Miniprojects in the document Standards For Student Work in MTH 302 before attempting to write up your submission. Note that all Miniprojects:
Your work here is being evaluated partially on whether your math and code are correct; but just as much on whether your reasoning is correct and clearly expressed. Make sure to pay close attention to both.
And please review the requirements above for including your code.
How to submit
You will submit your work on Blackboard in the Miniproject 6 folder under Assignments > Miniprojects. Then upload either your document of written and math work and the link to your Google Sheet; or a link to the Jupyter notebook you made.