Skip to content
Newer
Older
100644 26 lines (21 sloc) 596 Bytes
7198cd8 @moritz Scratch pad for Math::Model
authored Jun 14, 2010
1 use v6;
28e20c0 @moritz move code to a module
authored Jun 14, 2010
2 BEGIN { @*INC.push: 'lib' };
7198cd8 @moritz Scratch pad for Math::Model
authored Jun 13, 2010
3
517112c @moritz initial SVG plotting support
authored Jun 19, 2010
4 use Math::Model;
7198cd8 @moritz Scratch pad for Math::Model
authored Jun 13, 2010
5
6
b9fc1ee @moritz switch to OO interface
authored Jun 18, 2010
7 my $m = Math::Model.new(
7198cd8 @moritz Scratch pad for Math::Model
authored Jun 13, 2010
8 derivatives => {
7d0ad48 @moritz more sanity; still not there
authored Jun 19, 2010
9 velocity => 'height',
10 acceleration => 'velocity',
7198cd8 @moritz Scratch pad for Math::Model
authored Jun 13, 2010
11 },
12 variables => {
3a08e22 @moritz get topological sorting and dependant variables going
authored Jun 19, 2010
13 acceleration => { $:force / $:mass },
14 mass => { 1 },
3d30bbc @moritz forget that external exciting force
authored Jun 20, 2010
15 force => { - $:height - 0.2 * $:velocity * abs($:velocity)},
7198cd8 @moritz Scratch pad for Math::Model
authored Jun 13, 2010
16 },
28e20c0 @moritz move code to a module
authored Jun 14, 2010
17 initials => {
7d0ad48 @moritz more sanity; still not there
authored Jun 19, 2010
18 height => 1,
19 velocity => 0,
7198cd8 @moritz Scratch pad for Math::Model
authored Jun 13, 2010
20 },
3d30bbc @moritz forget that external exciting force
authored Jun 20, 2010
21 captures => <height>,
28e20c0 @moritz move code to a module
authored Jun 14, 2010
22 );
7198cd8 @moritz Scratch pad for Math::Model
authored Jun 13, 2010
23
fdd1cd4 @moritz fix up x axis selection; another example
authored Jun 20, 2010
24 $m.integrate(:from(0), :to(20), :min-resolution(1));
390702b @moritz better title
authored Jun 20, 2010
25 $m.render-svg('spring.svg', :title('Spring with damping'));
Something went wrong with that request. Please try again.