Post Reply 
Differential Equations
03-27-2017, 08:57 AM (This post was last modified: 03-27-2017 09:56 AM by Dieter.)
Post: #11
RE: Differential Equations
(03-27-2017 03:49 AM)bshoring Wrote:  I have played around with the program by Fernando del Rey at the bottom of Valentin's article "Long Live the HP-25 ! I have plugged into it the formula for calculating Simple Interest on the basis of a 365-day year with the formula:
(n/365)*PV*i = INT (simple interest)
where PV (present value)=5,000 and i=.05 and n is provided by the program and is subject to change.

...

Now when I run the 4th order Differential Equations program and store initial values of 0 in R1 and R2 and a step size of 1 in R0, I get the following results at steps 1 through 5:
1. .342466 (50% of 1 day's interest)
2. 1.369863 (100% of 2 day's interest)
3. 3.082192 (150% of 3 day's interest)
4. 5.479452 (200% of 4 day's interest)
5. 8.561644 (250% of 5 day's interest)

So I can see that at each step there is some relationship to the actual interest. But what I don't yet get is, "What are these numbers trying to tell me?"

I think I now have an idea of what's going on here, even without knowing the program you mention. To me it sounds like this:

The program you got does not solve 4th order differential equations (which would be quite a job to do with the limited properties of the HP25). Maybe it uses a 4th order method like this one on this website. But it actually does something completely different: it solves simple first order differential equations. Such equations are defined by

y' = f(x,y)

I assume you know what a derivative is. So here the derivative of a function is defined by its argument and its original function value y(x).

Programs that solve such differential equations try to calculate y for a number of different x. In other words: you tell the program what the derivative y' is, and the program approximates the original function y for different x. Based on a known pair (x,y) that you enter as initial values.

In your case you now have a function of n, where y is the interest rate:

y(n) = n * PV * i / 365

Now remember: the program wants you to enter the function y'(n), using x and y as its arguments. But you entered something different into the program. You obviously entered the original interest function y(n), not y'(n, y) as expected by the program. So the program now works with

y'(n) = n * PV * i / 365

i.e. with y'(n) = n times a constant PV*i/365 = n * 0,684932

Now – it's just simple calculus – if y'(n) = n * const, then y(n) = n²/2 * const. *) And this is what you get:

Code:
 y' = n * PV*i/365
    = n * daily_interest
    = n * 0,684932

Integrate wrt n to get

 y  = n²/2 * daily_interest
    = n² * daily_interest/2
    = n² * 0,342466

n    n²*0,5*daily_interest
------------------------------------------------
1    0,5 * daily_interest = 0,5 * 1-day-interest
2     2  * daily_interest =  1  * 2-day-interest
3    4,5 * daily_interest = 1,5 * 3-day-interest
4     8  * daily_interest =  2  * 4-day-interest
5   12,5 * daily_interest = 2,5 * 5-day-interest
 

And that's exactly what you get. If n runs from 1 to 5 the program returns y = n²/2*0,684932.
Or, if you want to relate this to the n-day-interest = n*0,684932, simply divide by the latter to get n/2 times the n-day-interest.
So for n=3 the program returns 3/2 = 150% of the 3-day-interest.

Now, "what are these numbers trying to tell me?". I cannot tell since the original equation does not make much sense: you entered y'(n) instead of y(n).

Dieter
__________
*) Actually the solution is n²/2*const + C. But you said that if x=0 then y=0 as well, so C is 0 and can be omitted.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Differential Equations - bshoring - 03-25-2017, 02:13 AM
RE: Differential Equations - ttw - 03-25-2017, 03:29 AM
RE: Differential Equations - Han - 03-25-2017, 04:45 AM
RE: Differential Equations - peacecalc - 03-25-2017, 02:01 PM
RE: Differential Equations - TomC - 03-26-2017, 04:36 PM
RE: Differential Equations - bshoring - 03-27-2017, 03:49 AM
RE: Differential Equations - Dieter - 03-27-2017, 08:22 AM
RE: Differential Equations - Dieter - 03-27-2017, 10:08 AM
RE: Differential Equations - Dieter - 03-27-2017 08:57 AM
RE: Differential Equations - Han - 03-27-2017, 06:46 AM
RE: Differential Equations - Ángel Martin - 03-27-2017, 08:47 AM
RE: Differential Equations - Dieter - 03-27-2017, 09:58 AM
RE: Differential Equations - ttw - 03-27-2017, 07:27 PM
RE: Differential Equations - Han - 03-27-2017, 08:55 PM
RE: Differential Equations - Thomas Okken - 03-27-2017, 11:46 PM
RE: Differential Equations - bshoring - 03-27-2017, 11:14 PM



User(s) browsing this thread: 1 Guest(s)