solved by Luca Imponenti
Consider the L2-ODE-CC (5) p.7b-7 with the window function f(x) p.9-8 as excitation:
and the initial conditions
1. Find such that:
with the same initial conditions as above.
Plot for for x in
2. Use the matlab command ode45 to integrate the L2-ODE-CC, and plot the numerical solution to compare with the analytical solution.
- Level 1:
One period of the window function p9.8 is described as follows
From the above intervals one can see that the period, and therefore
Applying the Euler formulas from to the Fourier coefficients are computed:
The integral from to can be omitted from this point on since it is always zero.
The coefficients give the Fourier series:
Considering the homogeneous case of our ODE:
The characteristic equation is
Therefore our homogeneous solution is of the form
Considering the case with f(x) as excitation
The solution will be of the form
Taking the derivatives
Plugging these back into the ODE:
Setting the two constants equal
This is valid for all values of n. Since the coefficients of the excitation and are zero for all even n, then the coefficients and will also be zero, so we must only find these coefficients for odd n's.
Now carrying out the sum to and comparing like terms yields the following sets of equations. Written in matrix form:
Assuming this matrix can be solved to obtain
For the remaining coefficients to be solved all sums will be used so a more general equation may be written:
Results of these calculations are shown below:
The solution to the particular case can be written for all n (assuming A=1):
The general solution is
Different coefficients will be calculated for each n. These coefficients are easily solved for by applying the given initial conditions. Below are the calculations for n=2.
Applying the first initial condition
Taking the derivative
Applying the second initial condition
Solving the two equations for two unknowns yields:
So the general solution for n=2 is:
Below is a plot showing the general solutions for n=2,4,8:
Using ode45 the following graph was generated for n=0:
and for n=1