# Numerical PDE boundary problem methodology

1. Apr 21, 2012

### jacobrhcp

Hi,

I'm currently working on a thesis in Economics. I have stumbled upon a system of differential equations that needs to be solved. I am stuck, and have trouble getting the right help from my advisor who is also not very acquainted with numerical methods. For the past couple of days I have been searching the net for a way to solve my problem, but since all else failed, I am here.

This is the system:

$\dot{K}=F(K,R)-G(S)R-C-\delta K$
$\dot{S}=-R$
$\dot{C}=\sigma C(F_{K}(K,R)-\delta-\rho)$
$\dot{R}=\frac{(\alpha K^{\alpha-1} R^{\beta}-\delta)(\beta K^{\alpha} R^{\beta-1}-\delta-\rho)-\alpha\beta K^{\alpha-1} R^{\beta-1} \dot{K}}{\beta (\beta-1)K^{\alpha} R^{\beta-2}}$

with boundary terms K(0)=K0, S(0)=S0, K(T)=K1, C(T)=C1, that determine the entire system. F and G are continuous function (F cobb douglas and G=constant/S, for instance)

If all the constraints would have been at t=0, i.e. K(0), S(0), C(0) and R(0) had been known, then I could use Euler linearization:

$y'(t)\approx \frac{y(t+h)-y(t)}{h}, y(t+h)\approx y(t)+h*y'(t)$

And hence if I know the values of my variables at t=0, then I can find out by iteratively caluting the dotted variables at times t what the value of my variables will be at later times t+h.

But now the boundary constraints are given at time t and I need to transform my system somehow, in order to find the solution paths. Since my system is not linear I don't know how to write it in the form y'=Ay+b and then decompose A into MDM^-1, where D is diagonal. If I could do that, that would already help, but I don't know how to linearize.

Does someone know a good method to solve this system? Thanks a thousand.

Jacob

2. Apr 22, 2012

### AlephZero

One way to do this is treat as an optimization problem to find thw two unknown conditions at t = 0.

Define a function $f(c,r) = (k-K_t)^2 + (s-S_t)^2$, where k and s are the values of K(t) and S(t) when you integrate the differential equation with initiial values K(0) = $k_0$, S(0) = $s_0$, C(0) = c, and R(0) = r.

Then find the values of c and s that minimize f, which is the same as solving the euqation f(c,r) = 0.

Since you don't know much about the mathematical behaviour of the function f, and you only have two unknown variables, my first choice would be the simplex (aka Nelder Read) method. http://en.wikipedia.org/wiki/Nelderâ€“Mead_method (note: this has nothing to do with the Simplex method in Linear Programming).

Presumably you know enough about the problem to guess some reasonable starting values for c and r. The basic idea is that you pick three different pairs of (c,r) values that form a triangle when plotted on a plane. You start by doing three integrations to find the corrsponding values of f. Each iteration of the Nelder Mead algorithm gives you another pair of (c, r) values to try, and then throws away one of the four points in the (c, r) plane, so the triangle moves around the plane and shrinks in size as it homes in on the minimum of the function.

In general this type of problem can have multiple solutions, and the function f may have several local minima as well as the global mimumum where f = 0 (whch is what you are searching for), so don't expect to find "the answer" the first time you try!

3. Apr 22, 2012

### jacobrhcp

I could treat it as an optimization problem! That is a wonderful idea. I still wonder if there is not just some direct approximation method that would do the trick, but I think I can do this in matlab. I am going to do this!

BTW: The solution (given reasonable starting values for C and R) is shown to be unique =)

And also, if you are interested: R is oil use, S is oil stock, K is capital and C is consumption.

If anyone knows a direct approximation algorithm, I'm still very interested, but this helps a lot.