Skip to content

Instantly share code, notes, and snippets.

@nmayorov
nmayorov / könig_vs_kasdin.ipynb
Created Oct 20, 2019
Colored noise generators comparison
View könig_vs_kasdin.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / colored_noise.py
Created Jun 30, 2019
Algorithm for colored noise generation
View colored_noise.py
"""Generate colored noise."""
from __future__ import absolute_import, division, print_function
import numpy as np
from scipy.fftpack import rfft, irfft
from scipy.signal import fftconvolve
from scipy._lib._util import check_random_state
def _generate_fir_coefficients(exponent, n_samples):
h = np.empty(n_samples)
@nmayorov
nmayorov / bvp_benchmark.ipynb
Last active Mar 2, 2022
BVP benchmarks with boundary condition tolerance check
View bvp_benchmark.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View test_rotation_spline.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / canonical_constraint.py
Created Feb 1, 2018
Canonical constraint implementation for scipy.optimize
View canonical_constraint.py
class CanonicalConstraint(object):
def __init__(self, n_eq, n_ineq, fun, jac, hess, keep_feasible):
self.n_eq = n_eq
self.n_ineq = n_ineq
self.fun = fun
self.jac = jac
self.hess = hess
self.keep_feasible = keep_feasible
@classmethod
@nmayorov
nmayorov / test_errors.ipynb
Created Jan 21, 2018
Interpolation errors of ODE solvers
View test_errors.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / mc_simulation.ipynb
Last active Nov 15, 2017
LC phase transition Monte-Carlo simulation
View mc_simulation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / elec.py
Last active Aug 15, 2018
"ELEC" nonlinear optimization problem definition
View elec.py
import numpy as np
from scipy.linalg import block_diag
class ProblemELEC:
def __init__(self, n_electrons, random_state=0):
self.n_electrons = n_electrons
self.rng = np.random.RandomState(random_state)
def x0(self):
@nmayorov
nmayorov / compare_cython_with_solve_ivp.ipynb
Created Dec 1, 2016
Comparison of Python and Cython ODE integration
View compare_cython_with_solve_ivp.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / profile_cython.ipynb
Created Nov 16, 2016
Profile with Cython complied function in ODE solvers
View profile_cython.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.