Plot script reads from STDIN and specified file.

parent 550db093
......@@ -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 = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment