Skip to content

Instantly share code, notes, and snippets.

View Alexanderallenbrown's full-sized avatar

Alexander Brown Alexanderallenbrown

View GitHub Profile
@Alexanderallenbrown
Alexanderallenbrown / index.html
Created August 11, 2017 12:04
p5.js Boolean Algebra Program Simulator w/Timers, Counters
<div id='sketch-holder'></div>
<textarea id=inputcode rows=20 cols=195>
//This demo code shows latching, rising edge detection for a 3-state program.
//To see this program work, push button X1!!
//To See some other functionality, play with inputs 4, 5, and 6!
//Block 1: Handle Inputs, Timers, Counters
V2 = X1&&!V1 //V2 is press
T0_EN = X4&&!T1; //have timer count repeatedly and reset itself
T1_EN = X4&&T0;//same
CT0_UP = X5;
@Alexanderallenbrown
Alexanderallenbrown / BicycleModel.py
Last active November 2, 2021 08:33
Bicycle Model implementation in python. linear tires, includes discrete approximation
from numpy import *
class BicycleModel:
def populate(self):
"""this function populates the bicycle model continuous and discrete (tustin) matrices"""
#terms for continuous time BM
A1 = (self.Cf + self.Cr)/(self.m*self.U)
A2 = (self.a*self.Cf-self.b*self.Cr)/(self.m*self.U)-self.U
A3 = (self.a*self.Cf-self.b*self.Cr)/(self.I*self.U)
@Alexanderallenbrown
Alexanderallenbrown / pydugoff.py
Last active January 4, 2024 11:49
simply python/numpy Dugoff tire model
from numpy import *
from matplotlib.pyplot import *
# A Dugoff Tire model implementation in python/numpy
#Alexander Brown, Ph.D.
# brownaa@lafayette.edu
class DugoffTire:
""" This python class implements the Dugoff tire model based on friction coefficients, cornering stiffnesses.
Forces are applied in same sign as slip angle, so be aware of this when you implement.
@Alexanderallenbrown
Alexanderallenbrown / test.md
Last active August 29, 2015 14:01
Markdown test
@Alexanderallenbrown
Alexanderallenbrown / sharp2001-compare-to-lqr.m
Created May 13, 2014 20:39
Sharp 2001 optimal preview controller Matlab code to compare with a standard lqr.
%Demonstration of the Robin Sharp Optimal Preview Steering Control
%Alexander Brown
%March 15, 2012
clear all
close all
clc
%Adapted from Sharp, valetsiotis, 2001