Guest_imported
New member
- Jan 1, 1970
- 0
First of all, I'm an absolute beginner, so don't assume something is too obvious to say
Basically, I'm trying to write a program to evaluate, up to a given value of n, the recurrence relation:
y_n+1 = y_n-1 + 2*h*function(x_n,y_n)
Where _ denotes a subscript.
Ie. The current term is related to the previous term, and also the one before that.
(Here h is just a small constant, function() is a known function, and x_n+1 = x_n + h).
All the examples I have seen along these lines have been relating the current term with just the previous one (i=i+1 etc). How do I tell the program to use the one before that as well?
I hope this is just somthing simple that I don't know about, but I've been trying to work it out for a long time now and I'm completely stumped. I have to get past this in order to progress with my project, so any help at all would be very much appreciated.
Many thanks.
Basically, I'm trying to write a program to evaluate, up to a given value of n, the recurrence relation:
y_n+1 = y_n-1 + 2*h*function(x_n,y_n)
Where _ denotes a subscript.
Ie. The current term is related to the previous term, and also the one before that.
(Here h is just a small constant, function() is a known function, and x_n+1 = x_n + h).
All the examples I have seen along these lines have been relating the current term with just the previous one (i=i+1 etc). How do I tell the program to use the one before that as well?
I hope this is just somthing simple that I don't know about, but I've been trying to work it out for a long time now and I'm completely stumped. I have to get past this in order to progress with my project, so any help at all would be very much appreciated.
Many thanks.