From a humor website: there is a Facebook account called “customer service” who trolls customers making complaints. Though that isn’t a topic here, it is interesting to see Newton’s Cooling Law get mentioned:

## July 13, 2015

## November 22, 2014

### One upside to a topologist teaching numerical analysis…

Yes, I was glad when we hired people with applied mathematics expertise; though I am enjoying teaching numerical analysis, it is killing me. My training is in pure mathematics (in particular, topology) and so class preparation is very intense for me.

But I so love being able to show the students the very real benefits that come from the theory.

Here is but one example: right now, I am talking about numerical solutions to “stiff” differential equations; basically, a differential equation is “stiff” if the magnitude of the differential equation is several orders of magnitude larger than the magnitude of the solution.

A typical example is the differential equation , for . Example: . Note that the solution decays very quickly to zero though the differential equation is 20 times larger.

One uses such an equation to test a method to see if it works well for stiff differential equations. One such method is the Euler method: which becomes . There is a way of assigning a method to a polynomial; in this case the polynomial is and if the roots of this polynomial have modulus less than 1, then the method will converge. Well here, the root is and calculating: which implies that . This is a good reference.

So for we find that has to be less than . And so I ran Euler’s method for the initial problem on and showed that the solution diverged wildly for using 9 intervals, oscillated back and forth (with equal magnitudes) for using 10 intervals, and slowly converged for using 11 intervals. It is just plain fun to see the theory in action.

## October 1, 2014

### Osgood’s uniqueness theorem for differential equations

I am teaching a numerical analysis class this semester and we just started the section on differential equations. I want them to understand when we can expect to have a solution and when a solution satisfying a given initial condition is going to be unique.

We had gone over the “existence” theorem, which basically says: given and initial condition where where is some rectangle in the plane, if is a continuous function over , then we are guaranteed to have at least one solution to the differential equation which is guaranteed to be valid so long as stays in .

I might post a proof of this theorem later; however an outline of how a proof goes will be useful here. With no loss of generality, assume that and the rectangle has the lines as vertical boundaries. Let , the line of slope . Now partition the interval into and create a polygonal path as follows: use slope at , slope at and so on to the right; reverse this process going left. The idea: we are using Euler’s differential equation approximation method to obtain an initial piecewise approximation. Then do this again for step size

In this way, we obtain an infinite family of continuous approximation curves. Because is continuous over , it is also bounded, hence the curves have slopes whose magnitude are bounded by some . Hence this family is equicontinuous (for any given one can use in continuity arguments, no matter which curve in the family we are talking about. Of course, these curves are uniformly bounded, hence by the Arzela-Ascoli Theorem (not difficult) we can extract a subsequence of these curves which converges to a limit function.

Seeing that this limit function satisfies the differential equation isn’t that hard; if one chooses close enough, one shows that where then the differential equation has exactly one solution where which is valid so long as the graph remains in .

Here is the proof: where . This is clear but perhaps a strange step.

But now suppose that there are two solutions, say and where . So set and note the following: and . A Mean Value Theorem argument applied to means that we can assume that we can select our so that on that interval (since ).

So, on this selected interval about we have (we can remove the absolute value signs.).

Now we set up the differential equation: which has a unique solution whose graph is always positive; . Note that the graphs of meet at . But where .

But since on that interval.

So, no such point can exist.

Note that we used the fact that the solution to is always positive. Though this is an easy differential equation to solve, note the key fact that if we tried to separate the variables, we’d calculate and find that this is an improper integral which diverges to positive hence its primitive cannot change sign nor reach zero. So, if we had where is an infinite improper integral and , we would get exactly the same result for exactly the same reason.

Hence we can recover Osgood’s Uniqueness Theorem which states:

If is continuous on and for all we have a where where is a positive function and diverges to at then the differential equation has exactly one solution where which is valid so long as the graph remains in .

## September 23, 2014

### Ok, what do you see here? (why we don’t blindly trust software)

I had Dfield8 from MATLAB propose solutions to meeting the following initial conditions:

.

Now, of course, one of these solutions is non-unique. But, of all of the solutions drawn: do you trust ANY of them? Why or why not?

Note: you really don’t have to do much calculus to see what is wrong with at least one of these. But, if you must know, the general solution is given by (and, of course, the equilibrium solution ). But that really doesn’t provide more information that the differential equation does.

By the way, here are some “correct” plots of the solutions, (up to uniqueness)

## July 30, 2014

### Differential equations mentioned in National Review

[…]One part insecure hipsterism, one part unwarranted condescension, the two defining characteristics of self-professed nerds are (a) the belief that

one can discover all of the secrets of human experience through differential equationsand (b) the unlovely tendency to presume themselves to be smarter than everybody else in the world. Prominent examples include […]

(emphasis mine).

Oh noes! I love differential equations! ðŸ™‚

Yeah, I am just having fun with the quote; I couldn’t resist mentioning an article in the popular press that mentions differential equations. I am not sure that I’ll teach the chapter on “all the secrets of human experience” in my upcoming differential equations class though.

## December 20, 2013

### Teaching the basics of numerical methods for solving differential equations

This semester we had about a week to spend on numerical methods. My goal was to give them the basics of how a numerical method works: given one selects a step size and then one rides the slope of the tangent line: and repeat the process. This is the basic Euler method; one can do an averaging process to get a better slope (Runge-Kutta) and one, if one desires, can use previous points in a multi-step process (e. g. Adams-Bashforth, etc.). Ultimately, it is starting at a point and using the slope at that point to get a piece wise linear approximation to a solution curve.

But the results of such a process confused students. Example: if one used a spreadsheet to do the approximation process (e. g. Euler or Runge-Kutta order 4), one has an output something like this:

So, there is confusion. They know how to get from one row to the other and what commands to type. But….”where is the solution?” they ask.

One has to emphasize what is obvious to us: the columns, is the approximate solution…a piece wise approximation of one anyway. What we have is a set where these ordered pairs are points in the approximate solution to the differential equation that runs through those points. One cannot assume that the students understand this, even when they can do the algorithm.

**An Exam Question**

As a bonus question, I gave the following graph:

I then said: “I was testing out an Euler method routine on the differential equation and I got the following output.

A) Is this solution mathematically possible?

B) If there is an error, is this an error induced by the Euler method or by an improper step size, or is a coding error more likely?

Many students got part A correct: some noted that is an equilibrium solution and that this differential equation meets the “existence and uniqueness” criteria everywhere; hence the graph of the proposed solution intersecting the equilibrium solution is impossible.

Others noted that the slope of a solution at would be zero; others noted that the slopes above were negative and this proposed solution leveled out. Others noted that is an attractor hence any solution near would have to stay near there.

But no one got part B; one even went as far to say that someone with a Ph. D. in math would never make such an elementary coding error (LOL!!!!!)

But the key here: the slopes ARE negative above and a correct Euler method (regardless of step size…ok, within reason) would drive the curve down.

So this WAS the result of a coding error.

What went wrong: I was running both RK-order 4 and Euler (for teaching purposes) and I stored the RK slope with one variable and calculated the “new Y” using the RK slope (obtained from the RK approximation) for the Euler method. Hence when the curve “jumped over” the , the new slope it picked up was a near zero slope from the RK approximation for the same value of (which was near, but below the equilibrium.

My problem is that the two variables in the code differed by a single number (my bad). I was able to fix the problem very quickly though.

**An aside**

On another part of the test, I told them to solve and gave them the phrase: “hint: THINK first; this is NOT a hard calculation”. A few students got it, but mostly the A students. There was ONE D student who got it right!

## December 18, 2013

### Have you ever had a student like this one?

I am grading differential equations final exams. I have the usual mix…for the most part.

But I have 3 students who are very, very good. And as far as one of these: let’s just say that when he/she writes an answer down that differs from the one I produced for the key…I double check my own work.

And once in a while….I am quietly embarrassed. ðŸ™‚

Note: but even this student is confused about numerical methods to solve differential equations; I’ll have to address that (with a post) over break.

## November 25, 2013

### A fact about Laplace Transforms that no one cares about….

Consider:

Now take the Laplace transform of the right hand side: .

This is equal to: for which is, of course, which is exactly what you would expect.

This technique works for but gives nonsense for .

Update: note that we can get a power series for which, on a term by term basis, transforms to which only converges at .

## November 12, 2013

### Why I teach multiple methods for the inverse Laplace Transform.

I’ll demonstrate with a couple of examples:

If we use the Laplace transform, we obtain: which leads to . Now we’ve covered how to do this without convolutions. But the convolution integral is much easier: write which means that .

Note: if the integral went too fast for you and you don’t want to use a calculator, use and the integral becomes

Now if we had instead:

The Laplace transform of the equation becomes and hence . One could use the convolution method but partial fractions works easily: one can use the calculator (“algebra” plus “expand”) or:

. Get a common denominator and match numerators:

. One can use several methods to resolve this: here we will use to see which means that and . Now use so obtain which means that so so

So, sometimes the convolution leads us to the answer quicker than other techniques and sometimes other techniques are easier.

Of course, the convolution method has utility beyond the Laplace transform setting.

## November 6, 2013

### Inverse Laplace transform example: 1/(s^2 +b^2)^2

I talked about one way to solve by using Laplace transforms WITHOUT using convolutions; I happen to think that using convolutions is the easiest way here.

Here is another non-convolution method: Take the Laplace transform of both sides to get .

Now most tables have

What we have is not in one of these forms. BUT, note the following algebra ~~trick~~ technique:

when .

Now and and one can proceed from there.