diff --git a/site/posts/differential-exam-1.html b/site/posts/differential-exam-1.html index 7db86d6..698546c 100644 --- a/site/posts/differential-exam-1.html +++ b/site/posts/differential-exam-1.html @@ -1,5 +1,8 @@ [!] [=post-] +

+ This post is part of a series. You can read the next post here. +

Hello once more, Internet! Our little Diffy Q adventuring party has passed the first two random encounters, and Rivendell is close in sight - but a ferocious band of orcs lies in the way; our first midterm rapidly approaches. It's going to be on June 9th in the normal lecture room and normal time; don't be late! diff --git a/site/posts/differential-review-4-and-5.html b/site/posts/differential-review-4-and-5.html new file mode 100644 index 0000000..782820c --- /dev/null +++ b/site/posts/differential-review-4-and-5.html @@ -0,0 +1,171 @@ +[!] +[=post-] +

+ Hello, dear readers! This post is a bit strange, even by Deadly Boring standards; because of an exam on June 9th I was unable to write the week 4 review, + so this post covers all of week 4 and week 5 together. +

+

+ Editor's note: It has come to my attention that the math in this post is unreadably painful, even by DBM standards. Blame the course. +

+

Shifted Systems

+

+ The first topic we need to cover is shifted systems. When given a nonhomogeneous SLDE, you have a trivial solution for situations where the + `c` term is constant. The trick lies in a substitution: you find the equilibrium solution `q` of `X' = AX + C`, define `Y = X - q`, and solve + `Y' = AY`. The solution to this can then be substituted back to get `X`. This actually isn't too hard; let's do an example. Given the equation + `X' = \[\[1, 2], \[3, 4]] X + \[5, 6]`, we clearly can't solve this the normal way; to start on a solution, we need to find an equilibrium point. + This is as simple as solving the equation `\[\[1, 2], \[3, 4]]Q + \[5, 6] = \[0, 0]`. This can be algebraically rewritten as `\[\[1, 2], \[3, 4]]Q = \[-5, -6]`, + which can be solved with Gaussian elimination to get `Q = \[4, - frac 9 2]`. +

+

+ This means we have `Y = X - Q = \[x, y] - \[4, - frac 9 2] = \[x - 4, y + frac 9 2]`. We set up an equation `Y' = \[\[1, 2], \[3, 4]]Y`. We know that + `Y' = \[x', y']` (don't believe me? calculate it yourself!), so this is homogeneous and can be solved the normal way. If this confuses you, + note that this is equivalent to saying `X' = A (X - Q) = AX - AQ`, and that `AQ = \[-5, -6] = -C` as we solved above: this equation is, by the magic + of matrices, exactly equivalent to our equation in terms of `X`. +

+

+ I won't bore you with the details of finding eigenvalues and eigenvectors. They're `lambda_1 = frac {5 + sqrt(33)} 2, v_1 = \[-3 + sqrt(33), 6], lambda_2 = frac {5 - sqrt(33)} 2, + v_2 = \[-3 - sqrt(33), 6]`. I probably should have picked a nicer matrix from the start. These awful eigenvalues and eigenvectors give us the nice solution + `Y = c_1 e^{t frac {5 + sqrt(33)} 2} \[-3 + sqrt(33), 6] + c_2 e^{ frac {5 - sqrt(33)} 2 } \[-3 - sqrt(33), 6]`. Finally, we can backsubstitute `Y = X - Q`, to get + `X = c_1 e^{t frac {5 + sqrt(33)} 2} \[-3 + sqrt(33), 6] + c_2 e^{ frac {5 - sqrt(33)} 2 } \[-3 - sqrt(33), 6] + \[4, - frac 9 2]`. Not too hard! +

+

2ODEs

+

+ Second order differential equations! We've talked a bit about these already, but only in the context of transforming them into simpler first order differential equations. + If you don't remember the definition from way back in chapter 1, it's pretty simple: a second order differential equation is a differential equation in terms of the + second derivative of a function. You can also have the first derivative as a term, which complicates things immensely. There is a form for linear equations + in a second-order ODE: `y'' + P(t)y' + Q(t)y = R(t)`. +

+

+ Solving a second-order linear differential equation is actually pretty easy. All you have to do, in fact, is turn it into an SLDE! The substitution process + we've covered several times works like a charm. Once you have your SLDE, you can solve that the normal way, and resubstitute. We go now to your + regularly scheduled example. Given the IVP `u'' = 4u' - 3u, u(0) = 2, u'(0) = 5`, we can rewrite with `vec X = \[u, u']` as `X' = \[\[0, 1], \[4, -3]] X`. + The eigenvalues and eigenvectors of this are `lambda_1 = -4, v_1 = \[-1, 4]` and `lambda_2 = 1, v_2 = \[1, 1]`. These are conveniently real and different, + so we have an easy solution: `X = c_1 e^{-4t} \[-1, 4] + c_2 e^{t} \[1, 1]`. +

+

+ How can we use this to solve the second-order equation? That part is actually pretty easy. + Remember that we're looking for `u` - and `X` is conveniently defined as `\[u, u']`. Taking the dot product of `X` and `\[1, 0]` yields `u = -c_1 e^{-4t} + c_2 e^{t}`. Don't + try to merge the constants yet; we need to first solve: we have `u(0) = 2, u'(0) = 5`, so we have the equations `u(0) = 2 = -c_1 + c_2` and `u'(0) = 5 = 4c_1 + c_2` (note + how the `e^{ lambda t }` terms reduce to `1`, because `t = 0`). We can construct a matrix equation: `\[\[-1, 1], \[4, 1]] \[c_1, c_2] = \[2, 5]`. + This is very easy to solve with Gaussian elimination; the result is `\[c_1, c_2] = \[frac 3 5, frac {13} 5]`. +

+

+ Finally, we resubstitute to get `u = -frac 3 5 e^{-4t} + frac {13} 5 e^t`. Nice and easy! The exact same method applies for a wide variety of homogeneous + 2ODEs that can be transformed into a homogeneous SLDE. Any method to solve the SLDE for complex and/or repeated eigenvalues will work the same way, as long + as you can get a vector equation for `X`. Note that if the 2ODE is nonautonomous, you won't be able to apply this trick. +

+

A Hard Problem

+

+ To get acquainted with 2ODEs, let's solve HW7.3. + At least take a crack at it before reading this. This will actually be the first homework problem solved on Deadly Boring Math this semester; + I usually only do a few of the hardest ones, to avoid making DBM a general cheating tool. +

+

+ The problem is a fairly simple physical one: we have a 4lb ball on a spring, which stretches the string by half a foot. It starts from equilibrium with a downwards force of + 9 feet per second. In our coordinate plane, positive is "down" and negative is "up". Gravitational acceleration is a constant 32 feet per second squared in the "down" direction. + We also have air resistance equal to negative four times the velocity. Note that, because imperial units are horrendously stupid, `4lb` really means four pounds of weight, + not mass; because we're assuming `32` feet per second squared Earth gravity, the mass is `frac 1 8`... slug. That's really what it's called. You can't make this stuff up. +

+

+ The first thing we need to do is analyze the spring. If you remember physics 1, you'll remember that Hooke's law says `F = -xk`, where `x` is displacement and `k` is the spring constant. + If you don't remember physics 1, that's fine, neither do I. Google to the rescue. Spring force is, assuming `y=0` is equilibrium, `F = -yk`; we need to find `k`. + Because we know the spring was already displaced by `frac 1 2` feet, and the force acting on the ball is `frac 1 8 * 32 = 4` slug-feet per second squared ("pounds") opposing the displacement, + then assuming we have strong enough stomachs to slog through imperial units, we have an equation `-4 = -frac 1 2 k`. This is very easy to solve to find + `k = 8`. +

+

+ Let's formalize our initial values. We know the ball is starting at `y=0` with a velocity of `9` feet per second downwards, so we have `y(0) = 0, v(0) = 9` + where `v(t) = y'(t)`. So far so good. Also note that `a = v' = y''`. +

+

+ We have three forces acting on the system: gravity, air resistance, and the spring. We want to find the acceleration from each, so we can + write a differential equation for net acceleration. Air resistance is stated in the question as being a value in pounds, + so we need to divide by mass to get acceleration: `a_"air" = frac {-4v} {frac 1 8} = -32v`. Note the negative; this force is always opposing our current velocity. Finally, we already know + the spring force thanks to Hooke's law: dividing by mass gives us `a_"spring" = frac {-8y} {frac 1 8} = -64y`. Because the spring is counteracting gravity, + we simply ignore it; adding these together gives us + `a = a_"air" + a_"spring" = - 32v - 64y`. +

+

+ We could rewrite as a system, but that would be pointless; we already know that the answer will be in the form `y = C_1 e^{lambda_1 t} + C_2 e^{lambda_2 t}` assuming + the eigenvalues are real and different. If you aren't sure why we can say this, look closely at the solution for a 2ODE: you can always write each eigenvector as + `\[1, v]`, and we only care about the first value in each vector. Furthermore, because of the way this will be rewritten, we can immediately turn `ay'' + by' + cy = 0` into + a characteristic equation `a lambda^2 + b lambda + c = 0`. Convenient! +

+

+ Rewriting gives us `y'' + 32y' + 64y = 0`, so our characteristic equation is `lambda^2 + 32lambda + 64 = 0`. The roots are easily found to be `lambda_1 = -16 + 8 sqrt(3)` and `lambda_2 = -16 - 8 sqrt(3)`. + Substituting these into our general form yields `y = C_1 e^{-16t + 8sqrt(3)t} + C_2e^{-16t + -8sqrt(3)t}`. We can differentiate to find + `y' = C_1 (-16 + 8sqrt(3)) e^{-16t + 8sqrt(3)t} + C_2 (-16 + -8sqrt(3)) e^{-16t + -8sqrt(3)t}`. +

+

+ To find `C_1` and `C_2`, we'll just substitute the initial values into these equations: `0 = C_1 + C_2`, `9 = C_1 (-16 + 8sqrt(3)) + C_2 (-16 + -8sqrt(3))`. These solve easily + to `C_1 = frac {3sqrt(3)} 16, C_2 = -frac {3sqrt(3)} 16`, meaning we have a final solution `y = frac {3sqrt(3)} 16 (e^{-16t + 8sqrt(3)t} - e^{-16t + -8sqrt(3)t})`. + Nice! +

+

Undetermined Coefficients

+

+ Note: I skipped over oscillation as it's mostly covered by our discussion of a spring-mass system. It may be worthwhile to go through it if you're hazy on the mechanics of oscillation. + Watch the lectures! +

+

+ The method of undetermined coefficients is yet another fascinating substitution that can be used to very quickly solve a second-order linear nonhomogeneous differential equation. + The core idea is that we can occasionally guess at the form of a solution, leaving the coefficients as unknowns; substituting into the equation will yield + an equation in terms of the coefficients, which can be solved and back-substituted. This finds a particular solution, and we can complete the solution by + solving the homogeneous part to get a complementary solution. The final result is the particular solution plus the complementary solution. It sounds confusing, but it isn't too bad. +

+

+ Let's do an example. Straight from the textbook, we have `y'' - 3y' - 4y = 3e^{2t}`. Let's first find the complementary solution: this is done by simply ignoring + the right hand side and solving via the characteristic equation method. We have the characteristic equation `lambda^2 - 3lambda - 4 = 0`, the roots of which are + `lambda_1 = -1` and `lambda_2 = 4`, so our complementary solution is trivially `y = C_1e^{-1t} + C_2e^{4t}`. +

+

+ Now for the fun part. Because `3e^{2t}` is exponential, our solution form will probably be exponential: a decent guess is `y = Ae^{2t}`. Given this, we have + `y' = 2Ae^{2t}` and `y'' = 4Ae^{2t}`, which we substitute back into the original equation to get `4Ae^{2t} - 6Ae^{2t} - 4Ae^{2t} = 3e^{2t}`. This is promising! + A bit of simplification reduces this whole thing down to just `-6Ae^{2t} = 3e^{2t}`, meaning `A` must be `- frac 1 2`; this means our particular solution + is going to be `y = - frac 1 2 e^{2t}`. Summing the particular and complementary solutions gives us `y = C_1e^{-1t} + C_2e^{4t} - frac 1 2 e^{2t}`. +

+

+ This is pretty quick and easy! The same technique works for most "simple" functions that propagate through derivatives in a predictable way; for instance, + `y'' - 3y' - 4y = 2sin(t)` will probably have a particular solution in the form `y = A sin(t) + B cos(t)`. Why not `y = A sin(t)`? The reason is easiest to explain + by trying it. Let's say `y = A sin(t)`, so `y' = A cos(t)` and `y'' = -A sin(t)`. This substitutes back to `-Asin(t) + 3Acos(t) - 4Asin(t) = 2sin(t)`, which simplifies to + `3Acos(t) = (6 + 5A)sin(t)`, which can't be solved for general `t` (note that `t = frac {pi} 2, A = - frac 6 5` is a solution, but we can't extend that to + any `t`). Doing it with `y = Asin(t) + Bcos(t)` gives us `y' = A cos(t) - B sin(t)` and `y'' = -A sin(t) - B cos(t)`, which substitutes to get + `-A sin(t) - B cos(t) - 3A cos(t) + 3B sin(t) - 4A sin(t) - 4B cos(t) = 2sin(t)`. What a mess! Fortunately, most of these terms cancel or combine, and we get + a much nicer `(-5A + 3B) sin(t) (-5B - 3A)cos(t) = 2sin(t)`. This implies that `-5A + 3B = 2` and `-5B - 3A = 0`; these solve to `A = - frac 1 5` and + `B = frac 1 3`. +

+

+ Sometimes we have to deal with the product of two simple functions (for instance, `e^t` and `sin(t)` multiplied to get `e^t sin(t)`). Individually these are easy to solve, but how do we + compose an undetermined coefficient equation that will propagate correctly? In these cases, we can actually just multiply together the forms. For instance, because + for `e^t` we'd use `Ae^t` and for `sin(t)` we'd use `A sin(t) + B cos(t)`, for `e^t sin(t)` we'd use `A e^t sin(t) + B e^t cos(t)` (the undetermined coefficients merge; we only need one per term). +

+

+ In cases where you have to deal with the sum of two simple functions, use the superposition; that is, the sum of partial solutions for each term is + a full particular solution. For instance, given an equation `y'' + p(t) y' + q(t) y = g(t) + h(t)`, you solve `y'' + p(t) y' + q(t) y = g(t)` and + `y'' + p(t) y' + q(t) y = h(t)` individually to find solutions `y_g` and `y_h`, and get the particular solution by adding them: `y = y_g + y_h`. +

+

+ There are several situations where you'll end up, for some reason or another, with cancelled coefficients, leaving you with a specific solution + but no solution for general `t`. For instance, `y'' + 4y = sin(2t)`: the obvious guess, `Asin(2t)` (adding the usual `B cos(2t)` term won't change the result), + yields `-4Asin(2t) + 4Asin(2t) = sin(2t)`, which cancels to `0 = sin(2t)`. + In these cases, your best bet is to multiply by some power of `t` and hope it improves the situation. For instance, if we let `y = At sin(2t) + Bt cos(2t)`, + we end up with `y'' = 4A cos(2t) - 4Bt cos(2t) - 4At sin(2t) - 4B sin(2t)`. `y'' + 4y = sin(2t)` now has a much better expansion: + `4A cos(2t) - 4Bt cos(2t) - 4At sin(2t) - 4B sin(2t) + 4At sin(2t) + 4Bt cos(2t) = sin(2t)`, simplifying to `4A cos(2t) - 4B sin(2t) = sin(2t)`. + Obviously, `A = 0`, and `B = -frac 1 4`, so our final answer is `y = - frac t 4 cos(2t)`. +

+

+ This technique is obviously very powerful. I won't go through all of the permutations here, but it's useful to memorize the common substitutions, and + get familiar enough to rederive some less common ones. +

+

Final Notes

+

+ There's a quiz coming up soon (Tuesday). Don't forget! I'll hopefully get some review up here tomorrow. +

+

+ I think that's everything. Until tomorrow, sayonara, do svidanya, and au revoir! +

+[/] +[=author "Tyler Clarke"] +[=date "2025-6-15"] +[=subject "Calculus"] +[=title "Differential Equations Week 4 & 5"] +[#post.html] \ No newline at end of file