Permalink
Browse files

forget that external exciting force

  • Loading branch information...
moritz committed Jun 20, 2010
1 parent 6e7cb95 commit 3d30bbc0038fd5c787caeae1626d48728b17adf3
Showing with 4 additions and 4 deletions.
  1. +1 −0 lib/Math/Model.pm
  2. +3 −4 scratch.pl
View
@@ -98,6 +98,7 @@ method integrate($from = 0, $to = 10, $min-resolution = ($to - $from) / 20) {
sub record($time, @values) {
update-current-values($time, @values);
@!time.push: $time;
+ say $time;
for @.captures {
%!results{$_}.push: %!current-values{$_};;
View
@@ -12,15 +12,14 @@
variables => {
acceleration => { $:force / $:mass },
mass => { 1 },
- force => { - $:height - 0.2 * $:velocity * abs($:velocity) + $:generator },
- generator => { 0.1 * sin(2.05 * pi * $:time) },
+ force => { - $:height - 0.2 * $:velocity * abs($:velocity)},
},
initials => {
height => 1,
velocity => 0,
},
- captures => [<height>],
+ captures => <height>,
);
-$m.integrate(:from(0), :to(100), :min-resolution(1));
+$m.integrate(:from(0), :to(50), :min-resolution(1));
$m.render-svg('spring.svg');

0 comments on commit 3d30bbc

Please sign in to comment.