10

Your question seems to miss some points in What topics can I ask about here?. This answer is for helping you to write the code by yourself and if you encounter any problem, feel free to post another question. In Mathematica use: (* comment *) syntax for commenting your code LowerTriangularize function for accessing the lower triangular part of a matrix ...


3

Try FindGeometricTransform to describe the transformation {x,y}<->{u,v}. Therefore it's necessary to know the three points A,B,C (I added Buv ). {Axy, Bxy, Cxy} = {{0.2, 0.8}, {0.1, 0.15}, {0.8, 0.25}} {Auv, Buv, Cuv} = {{0, 75}, {0, -45.378 }, {100, 0}, {0, -45.378 }} trafo = FindGeometricTransform[ {Auv, Buv, Cuv}, {Axy, Bxy, Cxy}] [[2]] Last ...


3

If you have got all your matrices in matrices then use ResourceFunction["LinearlyIndependent"] for example: LinearlyIndependent = ResourceFunction["LinearlyIndependent"]; matrices = RandomInteger[20, {16, 4, 4}]; LinearlyIndependent[Flatten /@ matrices] To extract your matrices you can do this: onebigmatrix = RandomInteger[20, {4, 64}]; ...


2

As suggested by @bill s, you can write x = Array[a, 3]; deriv = D[x . x, {x}] (* {2 a[1], 2 a[2], 2 a[3]} *) Note that the you need to put {x} rather than x (otherwise it will attempt to interpret the 2nd item in the list as the order of the derivative - see the help for D - the syntax is rather over loaded). The easiest way to substitute values is perhaps ...


2

ψ = {a, b}; ψ1 = Conjugate[ψ]; R = KroneckerProduct[ψ, ψ1] (* {{a*Conjugate[a], a*Conjugate[b]}, {b*Conjugate[a], b*Conjugate[b]}} *) R // TeXForm $$ \left( \begin{array}{cc} a a^* & a b^* \\ b a^* & b b^* \\ \end{array} \right) $$ In Mathematica, there is no concept of row vectors vs. column vectors, so there is no need to ...


2

B = ArrayFlatten[Transpose[A, {3, 1, 4, 2}]]; Ai = Transpose[ArrayReshape[Inverse[B], {n, n, n, n}], {2, 1, 4, 3}];


1

Presumably you are in an affine space; given a point {p1,p2,p3} on your line and a vector {u1,u2,u3} on the line, any point on the line has coordinates {p1,p2,p3}+x*{u1,u2,u3}, where $x$ is real. You still have to determine what distribution you want for $x$ (saying "a random point" is not enough). If you choose a normal distribution you could ...


1

ComplexExpand assumes that all variables are real except those mentioned as second argument. Try: ψ = {α Cos[B t/2] + I β Sin[B t/2] E^(-I ϕ), α I Sin[ B t/2] E^(I ϕ) + β Cos[B t/2]}; ComplexExpand[Conjugate[ψ], {α, b }] // Simplify This gives:


1

Here is a solution that uses AffineTransform and Solves for coefficients. You can specify a scale. {a, b, c, p} = {{0.2, 0.8}, {0.1, 0.15}, {0.8, 0.25}, {0.6, 0.7}}; (* Specify scale here; for example, u and v's lengths are 1/2 *) scale = 1/2; (* Define the parameters *) ClearAll[u0, ux, uy, v0, vx, vy, sol, UV]; m := {{ux, uy}, {vx, vy}}; V := {u0, v0}; UV ...


1

Assume a,b,c are given as: {a, b, c} = {{0.2, 0.8}, {0.1, 0.15}, {0.8, 0.25}}; The origin of the uv system is on a-b: orig= b+ x(a-b), where we need to determine x. This is done by using the fact that (c-orig) is perpendicular to (a-b): orig = b + x (a - b) /. Solve[(b + x (a - b) - c).(a - b) == 0, x][[1]]; With the origin, it is easy to determine unit ...


1

To clear up ambiguities, the following code finds the transformation from the points in xy space $(0,1),(1,0)$ and $(0,0)$ to the points in uv space $a,b$ and $c$ projected onto $\overline{ab}$ respectively. With[{a = {ax, ay}, b = {bx, by}, c = {cx, cy}, m = {{mx, mxy}, {myx, myy}}}, With[{v = Projection[c - b, a - b, Dot] + b}, m /. Simplify@ First@...


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