About Jonathan Shock

I'm a lecturer at the University of Cape Town in the department of Mathematics and Applied Mathematics. I teach mathematics both at undergraduate and at honours levels and my research interests lie in the intersection of applied mathematics and many other areas of science, from biology and neuroscience to fundamental particle physics and psychology.

UCT MAM1000 lecture notes part 36 – differential equations part v – first order differential equations

First order linear differential equations

We are now going to deal with another subset of first order differential equations which in some ways are easier than the previous and in other ways more complicated. These are linear first order differential equations. The general form of a first order linear differential equation is:

 

\frac{dy}{dx}+P(x)y=Q(x)

 

where P(x) and Q(x) are any functions of x.

 

Very importantly, I’m leaving off the fact that y is dependent on x in the notation, but you should remember that this is really y(x) and that is the function you are trying to solve for.

 

Sometimes you will be given an equation which is not obviously in this form but it can be transformed to this form. For instance:

 

\frac{1}{y}\frac{dy}{dx}=x^2+\frac{\sin x}{y}

 

This can easily be transformed into the canonical form for a linear first order DE. We are going to try and rewrite the left hand side of the equation in a form which will mean that we can solve the differential equation very easily.…

UCT MAM1000 lecture notes part 35- differential equations part iv – separable differential equations

Separable differential equations
In some ways these are the easiest differential equations to solve in theory, though in practice the final step (that of integrating) may be difficult or impossible. A separable differential equation is one of the form:

 

\frac{dy}{dx}=\frac{f(x)}{g(y)}

 

where f(x) and g(y) are any functions of x and y respectively. For instance:

 

\frac{dy}{dx}=x y

 

is of this form where f(x)=x and f(y)=\frac{1}{y}. The reason that these equations are simple in theory is because we can rearrange them to be:

 

g(y)dy=f(x)dx

 

ie. we have all the x stuff on one side and all the y stuff on the other and then we can integrate both sides:

 

\int g(y)dy=\int f(x)dx

 

and that’s it. As long as you can do the integrals, you can get a function y in terms of x. let’s look at some examples:

 

\frac{dy}{dx}=x y

 

gives the following integral:

 

\int\frac{1}{y}dy=\int x dx

 

and so:

 

\ln |y|+c_1=\frac{x^2}{2}+c_2

 

here we have one constant of integration from each side of the interval, but because they are just constants, we can put them into one constant and call it c:

 

\ln |y|=\frac{x^2}{2}+c

 

we can then rearrange this to give:

 

|y|=e^{\frac{x^2}{2}+c}=e^ce^{\frac{x^2}{2}}

 

We can then call e^c just a constant, and let’s call it y_0 because we can see that when x is zero, |y| is just going to be given by this constant:

 

|y|=y_0e^{\frac{x^2}{2}}

 

This has two solutions (one where y is positive, and one where it is negative), so we can choose one of them, depending on the initial condition for y.…

UCT MAM1000 lecture notes part 34 – differential equations part iii – Direction flows and Euler’s method

We haven’t yet studied any general ways to solve differential equations. In the first case of exponential growth we found an easy way to solve the equation, but for the logistic equation we just gave the solution and showed that it indeed satisfied the equation. Here we are going to look at some methods for finding not the exact solution, but approximations of the solutions. The first method is the method of Direction Fields and it will give us a good idea of what the solutions are going to look like. The second method, Euler’s method will give us an approximation to a single solution and we will be able to improve it to get arbitrarily good solutions to any differential equation (so long as there aren’t particularly nasty pathologies in the differential equation).

Direction Fields

Let’s take a differential equation:

 

\frac{dy}{dx}=x+y

 

Note that sometimes we will say explicitly that y(x) and sometimes we will leave it implicit, because the equation has a derivative of y with respect to x.…

UCT MAM1000 lecture notes part 33 – differential equations part ii – the logistic equation

Let’s try and make the previous example at least a little more realistic. Let’s suppose that the environment only supports a fixed number of rabbits, let’s call that fixed number M. This is the maximum number of rabbits that we can stably have. It turns out that there is a very very important equation which will model this sort of behaviour very well, and it shows up all over the place. This is called the logistic equation and looks like:

 

\frac{dP(t)}{dt}=kP(t)\left(1-\frac{P(t)}{M}\right)

 

Solving this equation means finding a function whose derivative and whose functional form are linked in this specific way.

We have pulled this equation out of thin air, so rather than deriving where it comes from, we will simply motivate that it seems to have the right sort of behaviour of what we want.

For very small populations (much less than the stable equilibrium population M), \frac{P(t)}{M}<<1, so the term in brackets can be safely ignored.…

By | September 1st, 2015|Courses, First year, MAM1000, Uncategorized, Undergraduate|3 Comments

UCT MAM1000 lecture notes part 32 – differential equations and rabbits moving at the speed of light

Up to now if I gave you an equation, and asked you to solve it for x you would be, in general, looking for a value of x which solved the equation. Given:

 

x^2+3x+2=0

 

You can solve this equation to find two values of x.

I could also give you an equation which linked x and y explicitly, and you could find a relationship between the two which, given a value of x would give you a value of y. You’ve been doing this now for many years. Now we’re going to add a hugely powerful tool to our mathematical arsenal. We’re going to allow our equations to include information about gradients of the function…let’s see what this means…

We’re going to take everything that you learnt about integration and turn it into a way to model and understand the world around us. This is a very powerful statement and indeed differential equations are without a doubt the most powerful mathematical tool we have to understand the behaviour of everything from fundamental particles to populations, economies, weather, flow of wealth, heat, fluids, the motion of planets, the life of stars, the flight of an aircraft, the trajectory of a meteor, the way a pendulum swings, the way a ponytail swings (see paper on this here), the way fish move, the way algae grow, the way a neuron fires, the way a fire spreads…and so much more.…

UCT MAM1000 lecture notes part x – summary

When you were a child you first learnt how to count. You learnt the relationship between a number and the quantity of objects around you. You quickly learnt to manipulate these numbers, you could add them, and you could multiply them, and you could subtract them. Subtracting them brought you to negative integers. Then you learnt how to divide them and this took you to fractions and thus the rational numbers. You could then manipulate these new numbers with the same operations.

At school you learnt about powers of numbers, and square roots of numbers, and you learnt about equations and how you could solve them to find the numbers which satisfied the equation. There were a few rules which acted like dead-ends however. You could never take the square root of a negative number. In fact any fractional power of a negative number should have filled you with trepidation (and possibly a frisson of excitement), though sometimes you saw that there were sneaky solutions to things like (-1)^\frac{1}{3}.…

Complexity from complex numbers – The beauty of the Mandelbrot set

We are about to show that you can get incredible structure from the simplest of algorithms when we use complex numbers.

The equation we are going to look at is an iterative equation:

 

z_{i+1}=z_i^2+C

 

with z_0=0. You simply get the next z_i from plugging in the previous one, squaring it and adding a number C. I’m going to give you a value for C, then you’re going to iterate this equation and see what happens. For instance, if I give you the number C=3:

 

\left(  \begin{array}{ccc}  i & z_i^2+C & \left| z_{i+1}\right| \\  1 & 0^2+3 & 3 \\  2 & 3^2+3 & 12 \\  3 & 12^2+3 & 147 \\  4 & 147^2+3 & 21612 \\  \end{array}  \right)

 

You can see that this number is just going to keep on increasing without end if we keep applying the algorithm. How about a smaller number, let’s say C=0.1:

 

\left(  \begin{array}{ccc}  i & z_i^2+C & \left| z_{i+1}\right| \\  1 & 0^2+0.1 & 0.1 \\  2 & 0.1^2+0.1 & 0.1121 \\  3 & 0.1121^2+0.1 & 0.112566 \\  4 & 0.112566^2+0.1 & 0.112671 \\  \end{array}  \right)

 

It looks like this is tending to some value. In fact it has come to a fixed point where z=z^2+0.1. There are actually two solutions to this equation but one of them is 0.112702 which is where we are tending towards.…

By | August 29th, 2015|English, Level: intermediate, Uncategorized|0 Comments

UCT MAM1000 lecture notes part 31 – complex numbers part ix

When we were playing around with partial fractions we appeared to make a bit of an assumption which was that the only forms that we had to deal with in the denominator of a fraction could always be written as a factor of either linear parts (a+b x) or quadratic parts which we could not factor into linear parts (ax^2+bx+x) where b^2-4ac<0, and of course multiple powers of these, for instance we could have terms like (a+bx)^3 in the denominator. How do we know that we can always split a polynomial up into these factors where the coefficients are real? Couldn’t it be for instance that if I gave you a cubic polynomial that all the roots were complex and so I couldn’t factor it in a way that every factor came out with real coefficients? It turns out that the answer is no, but we need a couple more ingredients to prove this.…

UCT MAM1000 lectures notes part 30 – complex numbers part viii

So, we can do basic algebra with complex numbers, take powers of them, and apply trig and exponential functions to them. There isn’t much left that we might want to do, but taking powers of them is very important and also pretty easy. Let’s say we wanted to calculate the solution to the equation:

 

z^2=-1

 

Well, we know what z is for this, because that’s what got us into this mess in the first place! We know that there are two solutions and they are \pm i. That is to say that if you multiply either of these numbers by themselves, you get -1, by definition. How about z^2=i. The first thing to do whenever you have to take the root of a complex number, or a real number (here the second root of i) is to convert that number into modulus argument form – it will be infinitely easier like that.…

A little something for the weekend…

 

From https://xkcd.com/505/

How clear is this post?
By | August 28th, 2015|Uncategorized|0 Comments