Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to solve a time-dependent linear system with a singular system matrix, $A$, thus an infinite number of solutions, ${\bf x}$(t), exist that satisfy the linear system. The solution I am looking for is one that minimizes the maximum value of the functions x(t). The problem can therefore be phrased as minimizing the square of L2-norm of the maximum of x(t) subject to the Ax=b equality constraints:

$$ \text{Minimize}~~\vert~\text{Max}[{\bf x}(t),t]~\vert_2^2 $$ $$ \text{such that}~~{\bf Ax}(t)={\bf b}(t) $$

I can solve this system at one point in time ($t=t_0$), but am looking for a solution ${\bf x}(t)$.

My current code is:

(*provide base values*)
n1 = 1;
n2 = 1;
n3 = 1;
i1 = Cos[ω*t];
i2 = Cos[ω*t - (2 π/3)];
i3 = Cos[ω*t - (-2 π/3)];

(* Clear base values and use symbolic representations *)
nbase = {n1, n2, n3};
ibase = {i1, i2, i3};
Clear[i1, i2, i3, n1, n2, n3];

(*values used to form 'A' and 'b' *)
coilList =
  {
   {1, 19, i1, n1},
   {2, 20, i1, n1},
   {3, 21, i1, n1},
   {4, 22, i1, n1},
   {5, 23, i1, n1},
   {6, 24, i1, n1},

   {7, 25, -i3, n3},
   {8, 26, -i3, n3},
   {9, 27, -i3, n3},
   {10, 28, -i3, n3},
   {11, 29, -i3, n3},
   {12, 30, -i3, n3},

   {13, 31, i2, n2},
   {14, 32, i2, n2},
   {15, 33, i2, n2},
   {16, 34, i2, n2},
   {17, 35, i2, n2},
   {18, 36, i2, n2}
   };

qs = 36;

(*create b vector*)
bVec = ConstantArray[0, {qs, 1}];
For[j = 1, j <= Dimensions[coilList][[1]], j++,
 bVec[[coilList[[j, 1]], 1]] += coilList[[j, 3]]*coilList[[j, 4]];
 bVec[[coilList[[j, 2]], 1]] += -coilList[[j, 3]]*coilList[[j, 4]];
 ]

(*form A matrix*)
aMat = DiagonalMatrix[Table[-1, {j, 1, qs - 1}], -1];
For[j = 1, j <= qs, j++,
  aMat[[j, j]] = 1;
  ];
aMat[[1, qs]] = -1;

(* create symbolic unknown vector*)
xVec = Table[Symbol["x" <> ToString[j]], {j, 1, qs, 1}];

(* introduce Ax=b as a list of equality constraints *)
constraints = Table[Sum[aMat[[j, k]]*xVec[[k]], {k, 1, Length[xVec]}]
    == bVec[[j, 1]], {j, 1, Length[bVec], 1}];

(* find unconstrainted solution by minimizing the squared 2-norm of \
the slot MMFs *)
Block[{i1 = ibase[[1]], i2 = ibase[[2]],i3 = ibase[[3]], 
       n1 = nbase[[1]], n2 = nbase[[2]], n3 = nbase[[3]]},
 solMin = FindMinimum[
    {Norm[Table[MaxValue[xVec[[j]], t], {j, 1, Length[xVec]}], 2]^2, 
     And @@ Thread[constraints]}, xVec];
 ]
xSol = xVec /. solMin[[2]];

Any help would be Greatly appreciated!

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.