Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uva
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
uva
Commits
0db05df5
Commit
0db05df5
authored
14 years ago
by
Sander Mathijs van Veen
Browse files
Options
Downloads
Patches
Plain Diff
Plot script reads from STDIN and specified file.
parent
550db093
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modsim/ass3/harm_osc.c
+1
-1
1 addition, 1 deletion
modsim/ass3/harm_osc.c
modsim/ass3/plot.py
+5
-5
5 additions, 5 deletions
modsim/ass3/plot.py
with
6 additions
and
6 deletions
modsim/ass3/harm_osc.c
+
1
−
1
View file @
0db05df5
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
modsim/ass3/plot.py
+
5
−
5
View file @
0db05df5
#!/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
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment