This file contains 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
# Copyright [2024] Taylor Howell | |
# Linear independence constraint qualification (LICQ) | |
import numpy as np | |
# problem setup: | |
# minimize 0.5 x' P x + q' x | |
# subject to A x = b | |
# Lagrangian |
This file contains 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
# %% | |
# Copyright [2024] Taylor Howell | |
import numpy as np | |
# %% | |
# OSQP: https://web.stanford.edu/~boyd/papers/pdf/osqp.pdf | |
# problem setup: | |
# minimize 0.5 x' P x + q' x | |
# subject to l <= A x <= u |
This file contains 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
# Copyright 2024 Taylor Howell | |
from __future__ import annotations | |
import numpy as np | |
# predictive sampling | |
# https://arxiv.org/abs/2212.00541 | |
# policy class for predictive sampling |
This file contains 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
# Copyright 2023 Taylor Howell | |
import jax | |
import jax.numpy as jnp | |
import matplotlib.pyplot as plt | |
# %matplotlib inline | |
# system parameters |
This file contains 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
// Copyright 2023 Taylor Howell | |
#include <iostream> | |
#include <random> | |
#include <thread> | |
#include <vector> | |
// derivative-free random search | |
template <typename T> | |
class RandomSearch { |
This file contains 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
// Copyright [2023] Taylor Howell | |
// Laplace solver | |
#include <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
// set boundary conditions for grid | |
void set_boundaries(double* grid, int width, int height, double top, | |
double bottom, double left, double right) { |