diff --git a/Magnetodynamics/electromagnet.pro b/Magnetodynamics/electromagnet.pro
index b259a4664504225bf3ef577c7755e28ae59255f4..dd2a5b41047f99ba8f6640684098a7add5e62014 100644
--- a/Magnetodynamics/electromagnet.pro
+++ b/Magnetodynamics/electromagnet.pro
@@ -54,26 +54,33 @@ Group {
 
 Function {
   DefineConstant[
-    Current = {0.01, Name "Model parameters/Current"},
-    frequency = {50, Visible !TimeDomain,
-      Name "Model parameters/Frequency" }
+    Current = {0.01, Name "Model parameters/Max. current [A]"},
     murCore = {100, Visible !NonLinearCore,
       Name "Model parameters/Mur core"}
+    // by default, a linear ramp from 0 to 1 until 10 ms, then a constant value
+    // of 1; any desired function can be specified
+    timeFunction = {"($Time < TimeFinal / 2) ? (2 / TimeFinal * $Time) : 1",
+      Choices{"($Time < TimeFinal / 2) ? (2 / TimeFinal * $Time) : 1",
+        "Sin[2*Pi*frequency*$Time]", "Sin[2*Pi*10*$Time]"},
+      Name "Model parameters/04Time function", Visible TimeDomain}
+
+    // overwrite parameters from the "Lib_Magnetodynamics2D_av_Cir.pro"
+    // template:
+    Freq = {50, Visible !TimeDomain,
+      Name "Model parameters/04Frequency [Hz]" }
+    DeltaTime = {1e-3,
+      Name "Model parameters/05Time step [s]", Visible TimeDomain}
+    TimeFinal = {20e-3,
+      Name "Model parameters/06Final simulation time [s]", Visible TimeDomain}
   ];
 
+  Parse[StrCat["myModulation[] = ", timeFunction, ";"]];
+
+  // Fix parameters from the "Lib_Magnetodynamics2D_av_Cir.pro" template:
   If(TimeDomain)
-    // Fix parameters from the "Lib_Magnetodynamics2D_av_Cir.pro" template:
     Flag_FrequencyDomain = 0;
-    TimeInit = 0; // start simulation at time = 0s
-    TimeFinal = 20e-3; // stop simulation at time = 20 ms
-    DeltaTime = 1e-3; // use time steps equal to 1 ms
-    // Define the time modulation of the current source, i.e. a linear ramp from
-    // 0 to 1 until 10 ms, then a constant value of 1:
-    myModulation[] = ($Time < TimeFinal / 2) ? (2 / TimeFinal * $Time) : 1;
   Else
-    // Fix parameters from the "Lib_Magnetodynamics2D_av_Cir.pro" template:
     Flag_FrequencyDomain = 1;
-    Freq = frequency;
   EndIf
 
   mu0 = 4.e-7 * Pi;
@@ -156,6 +163,8 @@ PostOperation {
       Print[ az, OnElementsOf Vol_Mag, File "az.pos" ];
       Print[ b, OnElementsOf Vol_Mag, File "b.pos" ];
       Print[ j, OnElementsOf Vol_Mag, File "j.pos" ];
+      Print[ I, OnRegion Ind, File "I.txt", Format TimeTable,
+        SendToServer "Output/Imposed current" ];
     }
   }
   { Name sta; NameOfPostProcessing Magnetostatics2D_a;
@@ -166,3 +175,10 @@ PostOperation {
     }
   }
 }
+
+// Choose resolution, computation and post-operation in interactive mode
+DefineConstant [
+  R_ = {"Magnetodynamics2D_av", Name "GetDP/1ResolutionChoices", Visible 0},
+  C_ = {"-solve -pos -bin", Name "GetDP/9ComputeCommand", Visible 0},
+  P_ = {"dyn", Name "GetDP/2PostOperationChoices", Visible 0}
+];