Skip to content

Instantly share code, notes, and snippets.

View BayMinimum's full-sized avatar

Sangbum Kim BayMinimum

View GitHub Profile
@BayMinimum
BayMinimum / recitation.ipynb
Created September 23, 2019 07:41
recitation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BayMinimum
BayMinimum / sho.py
Created November 17, 2018 06:50
Simple Harmonic Oscillator
# Output graph of a simple harmonic oscillator
import numpy as np
import matplotlib.pyplot as plot
def x(A, omega_0, phi_0, t):
return A * np.cos(omega_0*t + phi_0)
x_0, v_0 = 5.0, 15.0
m, c = 0.5, 0.8
@BayMinimum
BayMinimum / dho_weak.py
Last active November 17, 2018 06:41
Damped Harmonic Oscillator
# Output graph of a weakly damped harmonic oscillator
import numpy as np
import matplotlib.pyplot as plot
def x(A_0, gamma, omega_d, phi_0, t):
return A_0 * np.exp(-gamma*t) * np.cos(omega_d*t + phi_0)
def exp(A_0, gamma, t):
return A_0 * np.exp(-gamma*t)
function foo(param, callback){
setTimeout(()=>{
var res = some_blocking_function()
callback(res)
}, 0)
}
function foo2(param, callback){
if(param_is_wrong) callback("Wrong Parameter", -1)
else{