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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Mar 30 20:41:07 2023 | |
@author: Pantelis Sopasakis | |
""" | |
import numpy as np | |
import scipy.special as sp |
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
#include <Arduino.h> | |
#include <Wire.h> | |
#include "Adafruit_BME680.h" | |
#include "WiFi.h" | |
#include "WebServer.h" | |
/* CHANGE THESE: */ | |
#define NETWORK_SSID "YOUR_WIFI_SSID_HERE" | |
#define NETWORK_PASSWD "YOUR_WIFI_PASSWORD_HERE" | |
#define DEVICE_NAME "YellowDragon" |
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
; PlatformIO Project Configuration File | |
; | |
; Build options: build flags, source filter | |
; Upload options: custom upload port, speed and extra flags | |
; Library options: dependencies, extra library storages | |
; Advanced options: extra scripting | |
; | |
; Please visit documentation for the other options and examples | |
; https://docs.platformio.org/page/projectconf.html |
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
#include <Arduino.h> | |
/** | |
* Choose the GPIO port | |
* Wiring: | |
* ESP32-GND to LED- | |
* ESP-G2 to LED+ | |
*/ | |
#define LED 2 |
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
function R = myRouth(b) | |
%% ROUTH-HURWITZ Array | |
% | |
% Examples: | |
% | |
% 1. P = s^4 + 10*s^3 + 35*s^2 + 50*s + 24 ; | |
% R = myRouth( [1 10 35 50 24] ) | |
% | |
% 2. syms a b c d s , P = s^4 + a*s^3 + b*s^2 + c*s + d ; | |
% R = myRouth( [1 a b c d] ) |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.integrate import solve_ivp | |
# constant control action: | |
u = 0.5 | |
# define the system dynamics | |
def system_dynamics(_t, z): |
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
from scipy.integrate import solve_ivp | |
import numpy as np | |
# Define the system dynamics as a function of the | |
# form f(t, z) | |
def dynamics(_t, z): | |
return np.sin(z) | |
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
import math | |
from scipy.integrate import solve_ivp | |
class Car: | |
def __init__(self, | |
length=2.5, | |
velocity=5, | |
x_pos=0, |
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
#include "pid.h" | |
pid_controller_t new_pid(real_t Kp, real_t Ki, real_t Kd) | |
{ | |
pid_controller_t ctrl; | |
ctrl.Kp = Kp; | |
ctrl.Ki = Ki; | |
ctrl.Kd = Kd; | |
ctrl.sum_errors = 0.0; | |
ctrl.previous_error = 0.0; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#ifndef casadi_real | |
#define casadi_real double | |
#endif | |
#ifndef casadi_int | |
#define casadi_int long long int | |
#endif |
NewerOlder