Skip to content

Commit

Permalink
Fixed incomplete initialization of integrators
Browse files Browse the repository at this point in the history
  • Loading branch information
akloeckner committed Jun 25, 2014
1 parent 328ac20 commit db11763
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Noise/Utilities/Analysis/Corr.mo
Expand Up @@ -38,6 +38,12 @@ public
Real int_x2 "The integral of x^2";
Real int_y2 "The integral of y^2";
Real int_xy "The integral of x*y";
initial equation
int_x = 0;
int_y = 0;
int_x2 = 0;
int_y2 = 0;
int_xy = 0;
equation
der(int_x) = if t <= 0 then 0 else x;
der(int_y) = if t <= 0 then 0 else y;
Expand Down
3 changes: 2 additions & 1 deletion Noise/Utilities/Analysis/Mu.mo
Expand Up @@ -9,7 +9,8 @@ protected
Real mu_0 "Internal integrator variable";
parameter Real t_0(fixed=false) "Start time";
initial equation
t_0 = time;
t_0 = time;
mu_0 = 0;
equation
der(mu_0) = u;
mu = if time > t_0 then mu_0/(time-t_0) else u;
Expand Down

0 comments on commit db11763

Please sign in to comment.