Skip to content
Snippets Groups Projects
Commit 0db05df5 authored by Sander Mathijs van Veen's avatar Sander Mathijs van Veen
Browse files

Plot script reads from STDIN and specified file.

parent 550db093
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ int f_lottka_volt(double t, double *y, double *dy, void *params) {
// x' = -a * x + c * d * x * y
dy[0] = - PARAM(0) * y[0] + PARAM(2) * PARAM(3) * y[0] * y[1];
// y' = b * y - d * x * y
dy[1] = - PARAM(1) * y[1] - PARAM(3) * y[0] * y[1];
dy[1] = PARAM(1) * y[1] - PARAM(3) * y[0] * y[1];
return 0;
}
......
#!/usr/bin/env python
from sys import argv, exit
from sys import argv, exit, stdin
from pylab import figure, clf, plot, show, savefig
if len(argv) < 2:
print 'Usage: %s DATA_FILE [ TARGET_FILE ]' % argv[0]
exit()
f = open(argv[1], 'r')
try:
f = open(argv[1], 'r')
except IndexError:
f = stdin
lines = f.readlines()
f.close()
x = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment