A blog post accompanies this code segement on Medium or https://medium.com/etwas/higher-order-numeric-differential-equations-python-bc23dd148a0b
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
/* | |
A2 Custom Tester Project | |
*/ | |
#include <stdbool.h> | |
#include<string.h> | |
#include <stdlib.h> | |
#include"BSTs.c" | |
double findHarmFreq(double curFreq, int semitones){ |
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
#Runge-Kutta Method Single Time Step | |
def rk4(func,t,a,b,c,dt): | |
""" | |
Peforms a single time step of the Runge-Kutta 4th Order Method. | |
The below function finds the ki value for [dx,dy,dz] and return the value to move Yn+1 | |
func is an input of functions, for the Lorenz system this is [dx,dy,dz] | |
Recall Rk4 Equations : | |
k1 = h*f(xn,yn) | |
k2 = h*f(xn+h/2,yn+k1/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
#include "MDB-c.c" // <--- This will import your code so we can | |
// use your solution to create a linked | |
// list of movie reviews for testing! | |
int main() | |
{ | |
ReviewNode *MDB_head = NULL; | |
ReviewNode *temp = NULL; | |
printf("Custom Tester Assuming you have passed all tests in A1_driver \n"); |
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
def lorenz(x0,y0,z0,start_time,time_step): | |
""" | |
Returns an array of points, which the lorenz system passes by iteratively perfoming each rk4 timestep | |
""" | |
x,y,z = [x0],[y0],[z0] # Start Points | |
count = 0 | |
t = start_time or 0 # Start Time | |
dt = time_step or 0.01 # Time Step | |
while t < 150: | |
t+= dt |
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
/***************** | |
Adafruit MQTT Library ESP8266 Example | |
Must use ESP8266 Arduino from: | |
https://github.com/esp8266/Arduino | |
Works great with Adafruit's Huzzah ESP board & Feather | |
----> https://www.adafruit.com/product/2471 |
NewerOlder