Thank you gentlemen - problem solved.
Thanks Alex, I tried this but do not see the values.
I should have mentioned that I am using Maple version 8.
I am trying to write a script that generates the truncation error of a discretization. For example, a 4-point (equaly spaced), finite difference formula for the second derivative of y(x) is
y''(x) = (2*y1-5*y2+4*y3-y4)/(h^2) (1)
My approach has been to expand y(x) as a Taylor series and substitute into (1) evaluated at y1=y(x=0), y2=y(x=h) and y3=y(x=2h). However, whilst I obtain the correct Taylor series expansions, I cannot simplify to get the truncation error.
The code I am attempting to use is as folows:
> restart;dy :=taylor(y(x),x=0,5):
> y2:=subs(x=h, dy):
> y3:=subs(x=2*h, dy):
> y4:=subs(x=3*h, dy):
This produces the correct output but it is not simplified.
I would like to be able to simplify it to get the truncation error.
Any help appreciated.