Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Clear["Global`*"]
- Dim = 3;
- n = {2,2};
- d = Length[n];
- T = Table[t[l], {l, 1, d}];
- Tmax = 10;
- X0 = RandomReal[{-1,1}, Append[n, Dim]];
- Colors = RandomReal[{0,1}, Append[n, 3]];
- M = Table[0, d];
- For[l=1, l<=d, l++,
- col = Table[0, n[[l]]];
- col[[1]] = 1;
- col[[n[[l]]]] = -1;
- row = Table[0, n[[l]]];
- row[[1]] = 1;
- row[[2]] = -1;
- M[[l]] = ToeplitzMatrix[col, row]
- ];
- IndicesToContract = Table[{2*m,2*d+m}, {m, 1, d}];
- X = TensorContract[Apply[TensorProduct, Append[Map[MatrixExp,
- MapThread[Times, {-M, T}]], X0]], IndicesToContract];
- plots = Table[0, 0];
- ParameterSpace = Table[t[l], 0, Tmax}, {l, 1, d}];
- idx = Table[1, d];
- dim = d;
- ready = True;
- While[ready,
- x = Extract[X, idx];
- AppendTo[plots, Region[ParametricRegion[x, ParameterSpace]]];
- ready = False;
- While[!ready,
- If[dim > 0,
- If[idx[[dim]] + 1 <= n[[dim]],
- idx[[dim]]++;
- dim = d;
- ready = True,
- idx[[dim]] = 1;
- dim--
- ],
- Break[]
- ]
- ]
- ];
- ParameterSpace
- ParametricRegion[x, ParameterSpace]
- ParametricRegion[{ ... }, {}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement