Skip to content

Instantly share code, notes, and snippets.

\documentclass[11pt]{article}
\input{embedvideo.tex}
\usepackage{sectsty}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[caption=false]{subfig}
@ag-ds-bubble
ag-ds-bubble / dfs_weighted.py
Created October 31, 2020 18:28
DFS - Weighted
import networkx as nx
import matplotlib.pyplot as plt
import pandas as pd
class Node:
def __init__(self, name):
self.name = name
def getName(self):
return self.name
@ag-ds-bubble
ag-ds-bubble / buffons_experiment.py
Last active October 3, 2020 11:06
Buffon's Experiment
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
class BuffonsNeedle:
def __init__(self, interline_length = 10, nlines = 10):
# Buffon Needle Experiment
@ag-ds-bubble
ag-ds-bubble / pendulum_deriv.py
Created May 15, 2020 16:45
IVP Derivation Equation - Pendulum
def get_pendulum_deriv(t, params, g, l, a):
_theta = params[0]
_omega = params[1]
d_theta = _omega
d_omega = -(g/l)*np.sin(_theta) - (a*d_theta)
return d_theta, d_omega
@ag-ds-bubble
ag-ds-bubble / plane_deriv.py
Created May 15, 2020 16:40
IVP Derivation Equations - Plane
def get_deriv(t, state, g, mu, ad):
_pos_x = state[0]
_pos_y = state[1]
_vel = state[2]
d_pos_x = _vel
d_pos_y = 0
d_vel = - mu*g*t - ad*_vel if _vel > 0 else 0.0# Infinitesmly Small Acceleration
@ag-ds-bubble
ag-ds-bubble / plane_deriv.py
Created May 15, 2020 16:40
IVP Derivation Equations - Plane
def get_deriv(t, state, g, mu, ad):
_pos_x = state[0]
_pos_y = state[1]
_vel = state[2]
d_pos_x = _vel
d_pos_y = 0
d_vel = - mu*g*t - ad*_vel if _vel > 0 else 0.0# Infinitesmly Small Acceleration
@ag-ds-bubble
ag-ds-bubble / plane_deriv.py
Created May 15, 2020 16:40
IVP Derivation Equations - Plane
def get_deriv(t, state, g, mu, ad):
_pos_x = state[0]
_pos_y = state[1]
_vel = state[2]
d_pos_x = _vel
d_pos_y = 0
d_vel = - mu*g*t - ad*_vel if _vel > 0 else 0.0# Infinitesmly Small Acceleration
@ag-ds-bubble
ag-ds-bubble / plane_deriv.py
Created May 15, 2020 16:40
IVP Derivation Equations - Plane
def get_deriv(t, state, g, mu, ad):
_pos_x = state[0]
_pos_y = state[1]
_vel = state[2]
d_pos_x = _vel
d_pos_y = 0
d_vel = - mu*g*t - ad*_vel if _vel > 0 else 0.0# Infinitesmly Small Acceleration
@ag-ds-bubble
ag-ds-bubble / plane_deriv.py
Created May 15, 2020 16:40
IVP Derivation Equations - Plane
def get_deriv(t, state, g, mu, ad):
_pos_x = state[0]
_pos_y = state[1]
_vel = state[2]
d_pos_x = _vel
d_pos_y = 0
d_vel = - mu*g*t - ad*_vel if _vel > 0 else 0.0# Infinitesmly Small Acceleration
@ag-ds-bubble
ag-ds-bubble / plane_deriv.py
Created May 15, 2020 16:40
IVP Derivation Equations - Plane
def get_deriv(t, state, g, mu, ad):
_pos_x = state[0]
_pos_y = state[1]
_vel = state[2]
d_pos_x = _vel
d_pos_y = 0
d_vel = - mu*g*t - ad*_vel if _vel > 0 else 0.0# Infinitesmly Small Acceleration