The Finite Difference Approximation and the Euler Method

Module 4 consisted of two parts.

 

In Mod. 4 Part I, we mainly focused on the finite difference approximation.  In problem 1, I used the Euler’s method nested with the Verhulst equation and a numerical integrator.  We want an analytical method for two reasons.  First, it tells us whether our math is right on the numerical method.  Second, the analytical method tells us our error which is dependent on the time step used.  In Euler’s method, “[steps,2]” was used because for every time step we wanted a row and for every row we want two columns.  My work and the output of both functions is shown below.

This is the code for part 1, question 1.

This is the code for part 1, question 1.

This is the output.

This is the output.

In Module 4 Part II, we had to make a 2 box climate model.  One box represented the temperature of the atmosphere while one box represented the surface temperature.  We used the RK4 code created previously.  See below.

Mod 4 Part II

Mod 4 Part II

In the second cell, we actually constructed the climate model.  There were several equations and values involved in this process.  We knew that the output of this part should be two flat lines that are stable (i.e. no change occurring).   After looking at all inputs and outputs and correctly modeling them, the resulting code is shown below.  Sure enough, we see two flat lines showing the climate model is in a steady state.

Mod 4 Part II Climate Model Screen Shot 2015-11-25 at 2.02.39 PM

This is the steady state climate model.

This is the steady state climate model.

In order to change this steady state, we can manipulate the CO2 and solar input terms.  The first graph shows what happened when I increased the CO2 and solar input values by 50, each.

increased CO2 and solar input

increased CO2 and solar input

The next graph shows what happened when I decreased the CO2 and solar input values by 50 each.

CO2 and solar input decreased by 50

CO2 and solar input decreased by 50

 

As you can see, the steady state is no longer maintained when these values are changed.