This file contains hidden or 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
    
  
  
    
  | library(ggplot2) | |
| # sin(k1.x - w1.t) + sin(k2.x - w2.t) = 2 * carrier * envelope | |
| # physics 8.03SC lecture from Prof Yen-Jie Lee | |
| # lecture 13 - dispersive media, carrier waves and envelope | |
| # IMPROVEMENT NEEDED - repeated ggplot call results in a strobing effect which is not present | |
| # in Prof. Lee's simulations. | |
| alpha = -0.9 # set alpha = 1 for envelope to move forward | |
| k1 = 1 | |
| w1 = k1 * sqrt(1 + alpha*k1*k1) | |
| k2 = 0.9 | 
  
    
      This file contains hidden or 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
    
  
  
    
  | % Author: Rudradeep Mukherjee. Date: 5th March, 2021, 10:30AM IST. | |
| % implementation of deep copy of a python dict in Matlab for custom purpose. | |
| % if edge case or bug detected, please let Rudradeep know. | |
| function res = deepCopyDict(pydict) | |
| res = py.dict(pyargs()); | |
| keys = pydict.keys(); | |
| for jj = 1:length(keys); | |
| key = keys{jj}; | |
| val = pydict{key}; |