====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:spring-2014:iam950:hw1 [2014/02/27 09:36] gibson |
gibson:teaching:spring-2014:iam950:hw1 [2014/02/27 09:39] (current) gibson |
||
---|---|---|---|
Line 114: | Line 114: | ||
subtlety. | subtlety. | ||
- | Based on the above, here's a short example of how to differentiate in Fourier space on | + | Based on the above, here's a short example of how to do Fourier differentiation in Matlab on |
a [0,L] periodic domain. This should be plenty to get you started for the time-stepping codes. | a [0,L] periodic domain. This should be plenty to get you started for the time-stepping codes. | ||
Line 134: | Line 134: | ||
alpha = 2*pi*k/L; | alpha = 2*pi*k/L; | ||
D = i*alpha; | D = i*alpha; | ||
- | dudxt_fft = real(ifft(D.*fft(u)); | + | dudx_fft = real(ifft(D.*fft(u))); |
% Plot everybody | % Plot everybody | ||
Line 141: | Line 141: | ||
xlabel('x') | xlabel('x') | ||
</code> | </code> | ||
- | |||