fonseh
- 521
- 2
fonseh said:Homework Statement
Can someone explain why for the first derivative 3 point forward difference formula is 4f(x-h) - f(x-2h) ??
Homework Equations
The Attempt at a Solution
Why it's not f(x-h) - f(x-2h) ?
Is there anything wrong with the notes ?
please refer to the circled part ... it's really ##4 f(x-h)-f(x-2h)##Ray Vickson said:The formula is not ##4 f(x-h)-f(x-2h)##, and the notes make no such claim. Please try again with a correct question.
Anyway, as far as I can see the notes explain things in a perfectly clear way, using the Taylor expansion.
here's the full notesRay Vickson said:The formula is not ##4 f(x-h)-f(x-2h)##, and the notes make no such claim. Please try again with a correct question.
Anyway, as far as I can see the notes explain things in a perfectly clear way, using the Taylor expansion.
OK, but your first message said nothing about the "circled part"---that makes a difference. So, I have a question for you: have you taken the Taylor expansions for ##f(x-h)## and ##f(x-2h)## and performed the calculation of ##4f(x-h) - f(x-2h)?## Did you get a different answer from that in the notes?fonseh said:please refer to the circled part ... it's really ##4 f(x-h)-f(x-2h)##
The reason that your equation is not correct is that this is a first order accurate approximation, and the result they are trying to obtain is supposed to be accurate to terms of 2nd order in h.fonseh said:Homework Statement
Can someone explain why for the first derivative 3 point forward difference formula is 4f(x-h) - f(x-2h) ??
Homework Equations
The Attempt at a Solution
Why it's not f(x-h) - f(x-2h) ?
Is there anything wrong with the notes ?
No , i get the same as the notes , my question is why should we use 4f(x-h) ? why can't we use f(x-h) ?Ray Vickson said:OK, but your first message said nothing about the "circled part"---that makes a difference. So, I have a question for you: have you taken the Taylor expansions for ##f(x-h)## and ##f(x-2h)## and performed the calculation of ##4f(x-h) - f(x-2h)?## Did you get a different answer from that in the notes?
Can you explain further ? I still didnt get itChestermiller said:The reason that your equation is not correct is that this is a first order accurate approximation, and the result they are trying to obtain is supposed to be accurate to terms of 2nd order in h.
In my judgment, it is well explained in the visual you provided.fonseh said:Can you explain further ? I still didnt get it
Why we should use 4f(x-h) ? It's not explained in the notesChestermiller said:In my judgment, it is well explained in the visual you provided.
fonseh said:No , i get the same as the notes , my question is why should we use 4f(x-h) ? why can't we use f(x-h) ?
What they do is eliminate the term involving f'' from the two equations, and solve for f'. This results in a finite difference approximation that is accurate to terms if h2.fonseh said:Why we should use 4f(x-h) ? It's not explained in the notes
why there is a need to eliminate f'' from the equation ?Chestermiller said:What they do is eliminate the term involving f'' from the two equations, and solve for f'. This results in a finite difference approximation that is accurate to terms if h2.
I tried f(x-h) - f(x-2h) , i get -h'f(x) + (3 /2!) (f"(x) h^2) + (3/3!)(f"'(x)h^3) + ...Ray Vickson said:(a+b+c)f(x)+Bhf′(x)+Ch2f′′(x)+O(h3),(a+b+c)f(x)+Bhf′(x)+Ch2f″(x)+O(h3),(a+b+c) f(x) + B h f'(x) + C h^2 f''(x) + O(h^3),
Because otherwise you would find that the final finite difference equation would only be first order in h. Try any other linear combination of the two equations and see what you get for f'fonseh said:why there is a need to eliminate f'' from the equation ?
fonseh said:I tried f(x-h) - f(x-2h) , i get -h'f(x) + (3 /2!) (f"(x) h^2) + (3/3!)(f"'(x)h^3) + ...
I didnt get (a+b+c)f(x)+Bhf′(x)+Ch2f′′(x)+O(h3) though
Do you mean f(x) + f(x-h) - f(x-2h) ?Ray Vickson said:That is because you ignored what I wrote. I wrote ##a f(x) + b f(x-h) + c f(x-2h)##. I suggest you do the same, then tell us what you obtain.
fonseh said:Do you mean f(x) + f(x-h) - f(x-2h) ?
If so , i get f(x) -h'f(x) + (3 /2!) (f"(x) h^2) + (3/3!)(f"'(x)h^3) + ...