-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensuring periodicity of the Green's function
This formulation avoids redundant calculations and ensures T-periodicity of the Green's function for the grid defined over the interval [-T, T] - With the previous formulation, in the highly over-damped cases, we obtained NaN expressions when evaluating the Green's function for negative values of t.
- Loading branch information
1 parent
675a4e4
commit 8cba421
Showing
2 changed files
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
function update_Jvec(O) | ||
t1 = -O.T:O.dt:O.T; % padding Green's function to ensure correct convolution | ||
O.Jvec = J(O,t1,O.T); | ||
% Computing Green's function over grid [0,T] | ||
J1 = J(O,O.t,O.T); | ||
% Padding Green's function, i.e., using values over grid [-T,T] | ||
% to ensure correct convolution (using the fact that the Green's function | ||
% is T periodic) | ||
O.Jvec = [J1(:,1:end-1) J1]; | ||
O.isupdated.J = true; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
function update_Lvec(O) | ||
t1 = -O.T:O.dt:O.T; % padding Green's function to ensure correct convolution | ||
O.Lvec = L(O,t1,O.T); | ||
% Computing Green's function over grid [0,T] | ||
L1 = L(O,O.t,O.T); | ||
% Padding Green's function, i.e., using values over grid [-T,T] | ||
% to ensure correct convolution (using the fact that Green's function | ||
% is T periodic) | ||
O.Lvec = [L1(:,1:end-1) L1]; | ||
O.isupdated.L = true; | ||
end |