Mathematica Asked by Carlo on February 7, 2021
$Assumptions = {q [Element] Vectors[{15}, Reals]};
$Assumptions = {p1[q] [Element] Vectors[{3}, Reals]};
So I have been using this code in order to define an abstract vector of dimension [15] but when I check its dimension Mathematica returns 0;
Same for the second command but instead it returns 1.
Could anyone help me with that? What am I doing wrong?
My purpose is to create check the formula:
Grad[Norm[p1[l],p2[l]],l]
given l=vector[15];
p1[l] and p2[l] are vectors dependent on l and dimensions 3.
Any suggestions on how to do so using abstracr vectors?
From the documentation:
$Assumptions is the default setting for the Assumptions option used in such functions as Simplify, Refine, and Integrate.
These assumptions only work for selected functions. Not for Dimensions or Length.
Answered by SHuisman on February 7, 2021
Check the definition of Norm, [reference.wolfram.com/language/ref/Norm.html]. In university math the usage is different from that in Mathematica. Norm in Mathematica is a function for one vector and listable. The second argument sets the Norm for example Abs, euclidian and other and higher.
To use Grad it is necessary to follow the documentation of Grad
. This is based on {x,y,z}. This is derived or a wrapper of the D
. This wrapping extends the usage of D
to coordinate systems. So D
is possible the solution for You.
l = Vectors[15]
$Assumptions = {p1[l] [Element] Vectors[{3}, Reals]}
$Assumptions = {p2[l] [Element] Vectors[{3}, Reals]}
D[Norm[p1[l].p2[l]],l]
(p1[Vectors[15, Complexes]].Derivative[1][p2][
Vectors[15, Complexes]] +
Derivative[1][p1][Vectors[15, Complexes]].p2[
Vectors[15, Complexes]]) Derivative[1][Norm][
p1[Vectors[15, Complexes]].p2[Vectors[15, Complexes]]]
Whether this is what You are looking for depends on You. I replace the comma with the ., Dot
-built-in.
This makes use of the patterns:
D[f,{array}] effectively threads D over each element of array.
D[f,{array,n}] is equivalent to D[f,{array},{array},[Ellipsis]], where {array} is repeated n times.
D[f,{Subscript[array, 1]},{Subscript[array, 2]},[Ellipsis]] is normally equivalent to First[Outer[D,{f},Subscript[array, 1],Subscript[array, 2],[Ellipsis]]]. »
So study the documentation of the D
- built-in.
Answered by Steffen Jaeschke on February 7, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP