Project

General

Profile

Model used for the non-static magnetic field experiments

model nonStaticB
        Real x, y, vx, vy, B;

        parameter Real c  = 299.792458;
        parameter Real m  = 0.510998910;
        parameter Real v0 = 0.999*c;
        parameter Real B0 = 0.001;
        parameter Real q = 1.;
        parameter Real gamma2 = 22.36627204213;
        // Note: the original version was bugged in this calculation.
        // The wiki page with the experimentation is no longer valid until updated.
        parameter Real R = (m/(c*c)) * gamma2 * v0 / B0;

        initial algorithm
                x := 0;
                y := 0;
                vx := v0;
                vy := 0;
                B := B0;
        equation
                der(vx) = q*B*c*c * vy / (m*gamma2);
                der(vy) = -q*B*c*c * vx / (m*gamma2);
                der(x) = vx;
                der(y) = vy;
                B = B0 * sqrt(x^2 + (y+R)^2)/R;
        annotation(

        experiment(
                MMO_Description="nonStaticB model",
                MMO_Solver=QSS3,
                MMO_Period={0.002},
                MMO_SymDiff=false,
                MMO_Output={x,y,vx,vy,B},
                MMO_OutputType=CI_Sampled,
                StartTime= 0.0,
                StopTime= 3339,
                Tolerance={1e-7},
                AbsTolerance={1e-10}
        ));
end nonStaticB;
  • For further details about the experimentation click here.