Kamil Ondrousek
/
2D-VanDerPol
Van der Pol limit cycle - 2D nonlinear attractor
main.cpp
- Committer:
- JLS
- Date:
- 2011-02-09
- Revision:
- 0:964911ed238a
File content as of revision 0:964911ed238a:
#include "TFT_4DGL.h" TFT_4DGL lcd(p9,p10,p11); int main() { int xp,yp; int n = WHITE; float x,y,xn,yn; float dt = 0.314; float x1 = 0.01; float y1 = 0.01; x = x1; y = y1; while(1) { xn = y1; yn = (1-(x1*x1))*y1-x1; x = x+xn*dt; y = y+yn*dt; xp = (int)floor(x*50); yp = (int)floor(y*35); lcd.pixel(120+yp,160+xp,n); x1 = x; y1 = y; } }