Equation Nomenclature

odumath

New member
Joined
Sep 20, 2006
Messages
42
I think my question is quite fundamental... yet, something doesn't "add up" for me.

I have the following equation:
sn = sn-1 - b sn-1 in-1 delta t

Values are:
s(0) = 1
i(0) = 1.27x10^-6
b = 1/2
delta t = 10

Currently, when I plug in these values, I come up with:

sn = (1-1) - 1/2(1-1) * 0.00000127 (1-1) * 10
sn = (0) - 1/2(0) * 0.00000127 (0) * 10
sn = 0

Given the graph I have, I think I should have come up with an answer that is in the neighborhood of e.g. ~ 0.95.

Am I missing something in my interpretation of the equation? Do I plug in the values incorrectly?

Thanks,
Tom
 
You're still not quite putting it together.

You have s<sub>n</sub> = Function(s<sub>n-1</sub>)

After the definition, you never should see s<sub>n</sub> again. You need to run the index.

Define s<sub>0</sub>

Calculate s<sub>1</sub> = Function(s<sub>0</sub>)
Calculate s<sub>2</sub> = Function(s<sub>1</sub>)
Calculate s<sub>3</sub> = Function(s<sub>2</sub>)

...and so on.

In your example, you have an additional complication. There are THREE sequential variables. It's a little trickier, but it's the same idea.

s<sub>n</sub> = Function1(s<sub>n-1</sub>,i<sub>n-1</sub>,b<sub>n-1</sub>)
i<sub>n</sub> = Function2(s<sub>n-1</sub>,i<sub>n-1</sub>,b<sub>n-1</sub>)
b<sub>n</sub> = Function3(s<sub>n-1</sub>,i<sub>n-1</sub>,b<sub>n-1</sub>)

After the definition, you never should see s<sub>n</sub>, i<sub>n</sub>, or b<sub>n</sub> again. You need to run the index.

Define s<sub>0</sub>
Define i<sub>0</sub>
Define b<sub>0</sub>

Calculate s<sub>1</sub> = Function1(s<sub>0</sub>,i<sub>0</sub>,b<sub>0</sub>)
Calculate i<sub>1</sub> = Function2(s<sub>0</sub>,i<sub>0</sub>,b<sub>0</sub>)
Calculate b<sub>1</sub> = Function3(s<sub>0</sub>,i<sub>0</sub>,b<sub>0</sub>)

Calculate s<sub>2</sub> = Function1(s<sub>1</sub>,i<sub>1</sub>,b<sub>1</sub>)
Calculate i<sub>2</sub> = Function2(s<sub>1</sub>,i<sub>1</sub>,b<sub>1</sub>)
Calculate b<sub>2</sub> = Function3(s<sub>1</sub>,i<sub>1</sub>,b<sub>1</sub>)

...and so on.

You cannot work only on s<sub>n</sub>. You must keep all three sequences going at the same time.
 
tkhunny,

ok... I got the idea about running the index. However, I was under the impression that it would be done first on the 2nd row (keep in mind that I'm trying to do this in MS-Excel).

Alright, I know understand that you shouldn't spoon-feed me on this. However, could you please be a little bit more specific on the values.

Let's say I had the following values (I slightly changed them)... could you please provide me a headstart as to what the formula would look like?

s(0) = 1
i(0) = 0.1
b = 1/2
delta t = 5

I'd really appreciate your help on this... right now though, I'm unable to solve the problem properly.

Thanks again!

Tom
 
Once you see it, you'll never forget it.

You have:

s<sub>0</sub> = 7900000
i<sub>0</sub> = 10
r<sub>0</sub> = 0

b = 1/2
k = 1/3

step size = 5

You also have:

s<sub>n</sub> = s<sub>n-1</sub>-b*s<sub>n-1</sub>*i<sub>n-1</sub>*dt
i<sub>n</sub> = i<sub>n-1</sub>+(b*s<sub>n-1</sub>*i<sub>n-1</sub>-k*i<sub>n-1</sub>)*dt
r<sub>n</sub> = r<sub>n-1</sub>+k*i<sub>n-1</sub>*dt

First Iteration
s<sub>1</sub> = s<sub>0</sub>-b*s<sub>0</sub>*i<sub>0</sub>*dt
i<sub>1</sub> = i<sub>0</sub>+(b*s<sub>0</sub>*i<sub>0</sub>-k*i<sub>0</sub>)*dt
r<sub>1</sub> = r<sub>0</sub>+k*i<sub>0</sub>*dt
Substitute Values
s<sub>1</sub> = 7900000-(1/2)*7900000*10*5 = -189600000
i<sub>1</sub> = 10+((1/2)*7900000*10-(1/3)*10)*5 = 197499993.4
r<sub>1</sub> = 0+(1/3)*10*5 = 16.6666

Second Iteration -- Really big numbers. This can't be a useful model, can it? Maybe we're trying to prove overpopulation?

You try it with the other set of initial values.
 
tkhunny,

correct me if I'm wrong, but should the 1st iteration values be like:

s1 = 7900000-(1/2)*7900000*0.00000127*5 = 7,899,975
i1 = 0.00000127+((1/2)*7900000*0.00000127-(1/3)*0.00000127)*5 = 25
r1 = 0+(1/3)*10*5 = 16.65

Tom
 
i0 = 10

You used this value only in the third equation. Generally, the sub-zeros come in a set. No fair switching off in the middle.
 
I understand... I'm not trying to switch and "trick it".

Quick follow-up:
- you indicated that it would be a useless model... I still don't understand the difference between "10" and "1.27*10^-6"

Tom
 
I still don't understand the difference between "10" and "1.27*10^-6"
You can't actually mean that. :shock:

You must start with some set of initial conditions. You cannot start with one set and switch to another later. If you would like to start OVER and try the model again, from the beginning, that is a different matter.

I do not know what it is you are doing, so I cannot say what model design or result will be useful. Maybe the fact that it blows up is what you were seeking. I just don't have that information.

Using the second set of initial values, all three populations oscillate a bit and settle down to some finite value. Maybe that's what you seek.
 
Top