Tag Info

New answers tagged

2

The Kronecker product of two vectors of sizes $n$ and $m$ always gives a matrix of size $n$ by $m$. For example: a = RandomReal[{-1, 1}, 4]; b = RandomReal[{-1, 1}, 5]; Dimensions[KroneckerProduct[a, b]] In fact, the KroneckerProduct is just a rewriting of Outer[Times, a, b] and this same calculation can also be done with Table Table[a[[i]] b[[j]], ...


4

As @Ox4A4D mentioned in the comment, you could use the option VectorScale to set the length of vectors, here is an example code: myField = {Cos[2 \[Pi] t], 0}; Animate[VectorPlot[myField /. t -> TT, {x, -1, 1}, {y, -1, 1}, VectorScale -> Abs[0.05 Cos[2 Pi TT]]], {TT, 0, 1}]


2

With a slightly more interesting function, and cleaner syntax: myField[x_, y_, t_] := {Cos[2 Pi x t], Sin[2 Pi y t]}; Animate[VectorPlot[myField[x, y, t], {x, -1, 1}, {y, -1, 1}, VectorScale -> {Small, 1, None}], {t, 0, 1}] Check the documentation and play around with the arguments to VectorScale as required. EDIT: I had indeed misunderstood your ...


3

I imported your data data = Import["http://pastebin.com/download.php?i=VByC3ZEg", "Table"]; and transformed it into a vector field, deleting duplicated entries: vecdata = Partition[#, 3] & /@ DeleteDuplicates[data]; As noted in a comment, the base points all lie in the xy-plane (and the z-components of the vectors are nearly the same): ...


2

Since I'm being credited with the method (which I do appreciate), let me point out that your use of Block is being needlessly complicated with Hold and ReleaseHold. The same behavior can be had with: Block[{PauliMatrix}, Cross[s, {1, 2, 3}]] {{{-2, -3 I}, {3 I, 2}}, {{1, -3}, {-3, -1}}, {{0, 2 + I}, {2 - I, 0}}} We can make the Unevaluated method, ...


2

Directly define a cross function should be the easiest. cross3[{x_, y_, z_}, {a_, b_, c_}] := {c y - b z, -c x + a z, b x - a y} then no matter cross3[PauliMatrix[Range[3]],{1,2,3}] or cross3[{1,2,3},PauliMatrix[Range[3]]] will be OK. No ordering problem in Jens' LeviCivitaTensor method.


2

Edit: Result after many comments and questions: Graphics[Arrow[{#1, #1 + #2} & @@@ list]]


9

Assuming that we have three-dimensional real vectors : $Assumptions = (u | v | w) ∈ Vectors[3, Reals]; we can use e.g. various tensor functions (new in ver. 9) e.g. TensorReduce to reduce (simplify) a tensor expression, e.g. TensorReduce[ v.v + w.w - (v + w).(v + w) ] TensorReduce[u \[Cross] (v \[Cross] w) ] -2 v.w -w u.v + v u.w We can perform ...


4

@Szabolcs is right, use Symbolic Tensors. But in that link it may be a bit confusing to find what you want. There are good examples on 3D vector operations. Read: Vectors TensorExpand Derive and Verify Vector Identities For example, proving an identity: a\[Cross](b\[Cross](c\[Cross]d)) == b a.(c\[Cross]d) - (a.b) c\[Cross]d // TensorExpand True ...


1

If you are using Mathematica version 9, the best approach is probably to use the new symbolic tensor functionality as suggested by zentient. However for this problem it may be sufficient to explicitly specify a rule to convert expressions like Norm[-q] into Norm[q]: myform = Expand[# /. Norm[-x_ + y_.] :> Norm[x - y]] &; (F2s[q, k1]*F2s[-q, k2]) // ...



Top 50 recent answers are included