Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Problem with difference equation
Posted:
Jun 27, 2010 4:52 AM


Hi folks, I have to use difference equation to find second derivative of sin function. This is the function g1*sin(2*pi*t/T). I use approximation with central finite difference of second order with secondorder accuracy. It's it fpp(x) = ( f(x+h) 2f(x) + f(xh) ) / h^2.... When i wrote simple program to prove that this approximation works, and it is:
clear, clc % params of sin function t = 0:0.01:1; Ts = 0.01; g1 = 0.6; T = 0.2; % the second order differential of sin function tpp = 4 * g1 * pi^2 * sin(2 * pi * t / T) / T^2; % the second order difference of sin function tdd = (sin(2 * pi * (t+Ts) / T)  2*sin(2 * pi * t / T) + sin(2 * pi * (tTs) / T)) /Ts^2; % plot the result plot(t, t1dpp, 'b', t, t1dd, 'r')
Then I plotted the result the sins are different  with differential equation the Amp it (600; 600) and with difference it's (1000; 1000). I'm new to difference equation i try to do my best, but i can't managed with this problem. Can someone help me ? I need the approximation to be same as the second derivative of sin function. Thanks !



