Hot answers tagged

8

I am writing this answer only to address the Wizard's comment of "not obvious". Recall that if you take two nonzero vectors $\mathbf v_1$ and $\mathbf v_2$ as your basis, you can then represent any other vector as a linear combination of these two ($x \mathbf v_1 + y \mathbf v_2$). In Mathematica, this is equivalent to the expression Transpose[{v1, v2}].{x, ...


5

EDIT My original post was unnecessarily complex (pun?) and I have taken the advice of Kuba. This is not really an advance but I post it for fun: v1 = {2, 1}; v2 = {-1, 1}; f[x_, y_] := {x, y}.{v1, v2}; Manipulate[ Row[{Show[Plot[{x, x^2, 5 Sin[x]}, {x, 0, 5}, PlotRange -> {0, 5}], ParametricPlot[{x, y}, {x, 0, 5}, {y, 0, 5}, MeshFunctions ...


3

Iterating @J.M.'s comment: This problem has no exact solution. With[{ matrix = {{0.8111, 0.4867, -0.3244}, {a, b, 0}, {c, d, e}} }, Print[matrix.Transpose[matrix]]; Solve[ matrix.Transpose[matrix] == IdentityMatrix[3], {a, b, c, d, e} ] ] (* {{0.999995,... *) (* {} *) That is, the first column's first entry is not $1$, so there is ...


2

Update As of Version 10 nonlinear control systems can be addressed by NonlinearStateSpaceModel. With this the answer given by @Suba Thomas can be obtained by: a1 = {{-3, 2}, {-0.25, 1}}; a2 = {{-1.9, -0.4}, {-2.24, -4.7}}; b1 = {{0.25}, {1}}; b2 = {{-2.5}, {1}}; c = {{1, 0.5}, {0, 1}}; ρ[1] = (1 - Tanh[x[1][t]])/2; ρ[2] = 1 - ρ[1]; xx = { x[1][t], ...


1

Using Smith Normal Form you can get two integer matrices with determinant 1 that would satisfy the equation $$X1.K.X2 = K_2$$ May be this is a good start you can use... resK = SmithDecomposition[K]; MatrixForm /@ resK resK2 = SmithDecomposition[K2]; MatrixForm /@ resK2 resK[[2]] == resK2[[2]] (* True *) K2 == ...


1

Perhaps this is a solution for the 2D case. lattice[basis : {Repeated[{_Real, _Real}, {2}]}, nX_Integer?Positive, nY_Integer?Positive] := Module[{box, sides}, box = Sort /@ Transpose[basis]; sides = Flatten[Abs[Differences[#]] & /@ box]; Flatten[CoordinateBoundsArray[box, sides, 0, {{0, nX - 1}, {0, nY - 1}}], 1]] With[{basis = {{1, ...


1

Not a full answer, but there are other tools available, such as Outer and TensorProduct. For example, compare AbsoluteTiming[(mat1 = Table[Etc[t] mtx, {t, 0., 20, 0.01}]);] with AbsoluteTiming[(mat2 = TensorProduct[Et[Range[0., 20, 0.01]], mtx]);] TensorProduct is over twice as fast. The answers are identical: Norm[Flatten[mat1 - mat2]] // Chop



Only top voted, non community-wiki answers of a minimum length are eligible