From 31fe9d1fbcbe6215d3e055e7f58b85d5aa658264 Mon Sep 17 00:00:00 2001 From: Andrew Ning Date: Thu, 12 Sep 2024 22:31:28 -0600 Subject: [PATCH] fix --- atom.xml | 2 +- feed.xml | 2 +- me275/schedule/hw2/index.html | 15 +++++---------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/atom.xml b/atom.xml index dd615e0b..c19b3b2e 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ FLOW Lab - 2024-09-12T22:30:03-06:00 + 2024-09-12T22:31:23-06:00 http://flow.byu.edu Andrew Ning diff --git a/feed.xml b/feed.xml index 841b9d9b..ad3ac7a6 100644 --- a/feed.xml +++ b/feed.xml @@ -1 +1 @@ -Jekyll2024-09-12T22:30:03-06:00http://flow.byu.edu/feed.xmlFLOW LabFlight, Optimization, and Wind LaboratoryAndrew NingOptimization Book Available2021-10-15T00:00:00-06:002021-10-15T00:00:00-06:00http://flow.byu.edu/posts/opt-book]]>Andrew NingBEM Paper2021-07-30T00:00:00-06:002021-07-30T00:00:00-06:00http://flow.byu.edu/posts/bem-paper]]>Andrew NingEduardo Research Update2021-03-01T00:00:00-07:002021-03-01T00:00:00-07:00http://flow.byu.edu/posts/eduardo-latest]]>Eduardo AlvarezReformulated VPM2021-02-01T00:00:00-07:002021-02-01T00:00:00-07:00http://flow.byu.edu/posts/reformulated-vpm]]>Eduardo AlvarezOptimization Book Announcement2021-01-20T00:00:00-07:002021-01-20T00:00:00-07:00http://flow.byu.edu/posts/optimization-book]]>Andrew NingPJ Defense2020-09-30T00:00:00-06:002020-09-30T00:00:00-06:00http://flow.byu.edu/posts/pj-defense]]>Andrew NingVPM Paper2020-08-30T00:00:00-06:002020-08-30T00:00:00-06:00http://flow.byu.edu/posts/vpm-paper]]>Eduardo AlvarezAirborne Wind with Vortex Particle Method2020-08-16T00:00:00-06:002020-08-16T00:00:00-06:00http://flow.byu.edu/posts/wind-harvesting]]>Judd Mehr and Eduardo AlvarezEduardo’s Past Three Years2020-08-10T00:00:00-06:002020-08-10T00:00:00-06:00http://flow.byu.edu/posts/eduardo-three-years]]>Eduardo AlvarezFLOWUnsteady in Google Drive2020-08-02T00:00:00-06:002020-08-02T00:00:00-06:00http://flow.byu.edu/posts/google-drive-vpm]]>Eduardo Alvarez \ No newline at end of file +Jekyll2024-09-12T22:31:23-06:00http://flow.byu.edu/feed.xmlFLOW LabFlight, Optimization, and Wind LaboratoryAndrew NingOptimization Book Available2021-10-15T00:00:00-06:002021-10-15T00:00:00-06:00http://flow.byu.edu/posts/opt-book]]>Andrew NingBEM Paper2021-07-30T00:00:00-06:002021-07-30T00:00:00-06:00http://flow.byu.edu/posts/bem-paper]]>Andrew NingEduardo Research Update2021-03-01T00:00:00-07:002021-03-01T00:00:00-07:00http://flow.byu.edu/posts/eduardo-latest]]>Eduardo AlvarezReformulated VPM2021-02-01T00:00:00-07:002021-02-01T00:00:00-07:00http://flow.byu.edu/posts/reformulated-vpm]]>Eduardo AlvarezOptimization Book Announcement2021-01-20T00:00:00-07:002021-01-20T00:00:00-07:00http://flow.byu.edu/posts/optimization-book]]>Andrew NingPJ Defense2020-09-30T00:00:00-06:002020-09-30T00:00:00-06:00http://flow.byu.edu/posts/pj-defense]]>Andrew NingVPM Paper2020-08-30T00:00:00-06:002020-08-30T00:00:00-06:00http://flow.byu.edu/posts/vpm-paper]]>Eduardo AlvarezAirborne Wind with Vortex Particle Method2020-08-16T00:00:00-06:002020-08-16T00:00:00-06:00http://flow.byu.edu/posts/wind-harvesting]]>Judd Mehr and Eduardo AlvarezEduardo’s Past Three Years2020-08-10T00:00:00-06:002020-08-10T00:00:00-06:00http://flow.byu.edu/posts/eduardo-three-years]]>Eduardo AlvarezFLOWUnsteady in Google Drive2020-08-02T00:00:00-06:002020-08-02T00:00:00-06:00http://flow.byu.edu/posts/google-drive-vpm]]>Eduardo Alvarez \ No newline at end of file diff --git a/me275/schedule/hw2/index.html b/me275/schedule/hw2/index.html index adf0a9cc..86c0b740 100644 --- a/me275/schedule/hw2/index.html +++ b/me275/schedule/hw2/index.html @@ -113,20 +113,15 @@

HW 2

\[\pi = 4 \sum_{k = 0}^\infty \frac{(-1)^k}{2k + 1}\]

Because we cannot use an infinite number of terms, the resulting error is called truncation error (note that this is different than roundoff error as it would still exist even if we were able to use exact precision numbers with no rounding). Create a Python script that uses a loop to estimate \(\pi\) using the above formula for \(n = 0, 1, 2, \ldots, 20\) terms. For each value of \(n\), compute the relative percent error. Plot the truncation percent error on the y-axis.

- - - - +

The value \(s_i\) is the current estimate for the square root of \(x\) and \(s_{i+1}\) is an updated estimate (from which we can repeat the process again and again). Side note: this method where we update the new estimate from an explicit function of the current estimate (\(s_{i+1} = f(s_i)\)) is called fixed-point iteration.

-
    +

    To implement this algorithm, it is perhaps easiest to start with a for loop for some fixed number of iterations. We won’t know how many iterations are needed to converge beforehand, but we can experiment. If that seems to be working well, then replace the for loop with a better version: a while loop that stops once the relative error drops below \(10^{-6}\). In computing the relative error we don’t actually know the exact answer to compare to, which is a common scenario, so we use the new estimate as the “true answer” and compare to the prior value. –>

    +
  1. The equations for projectile motion in two-dimensions (neglecting air resistance) are: