Items tagged with vector vector Tagged Items Feed

I experienced strange operation of "union" for sets of vectors.

Mt1:=Matrix(2, 4, [[ 0,1, 0, 0], [ 0,  0,  1, 1]]); Ms := Vector[column](4, [8,4,2,1]); St1 := {}:

St1:= `union`(St1, {Mt1 . Ms});

I am surprised, because each execution of union adds new and the same vector <4 | 3> to set St1:

1

But after copying any set in the clipboard and pasting the set St1 has only one instance of vector <4 | 3>:

2

What does it mean?

Hi all,

 

I'm trying to initialize a 4-vector and promote it as a tensor in Maple 16 using the Physics package. My attempt so far has been unsuccessful :) 

This 4-vector needs to be a function of the coordinates X. What I'm trying to do is to allocate terms by terms my tensor as indicated in my attempt below. Everything looks fine (the query is telling me F2 is a tensor) but when I'm trying to compute contravariant quantities, I can't obtain an answer for a given coordinate (here F2[~n](X) is not equal du v_1(X))... Finally, the last line, computing the sum over all the indexes is not giving me an answer... 

 

restart; with(Physics):
Setup(mathematicalnotation=true):
Setup(coordinatesystems = cartesian):
Define();
g_[]:

F2[1]:=(x,y,z,t)->v_1(X);F2[2]:=(x,y,z,t)->v_2(X);F2[3]:=(x,y,z,t)->v_3(X);F2[4]:=(x,y,z,t)->1;

Define(F2[mu](X));

Define(F2,query);

F2[1](X);F2[2](X);

F2[~1](X);F2[~2](X);

F2[~nu].F2[nu]

 

Surely, something is wrong in my way of defining a spacetime tensor. What would be the solution to obtain a decent contravariant F2?

 

Another more or less related question would be to know how to compute a taylor expansion of a function itself i.e. 1/(1+f(X))~ 1-f(X) since f<<1? Would there be a built-in fonction to do such a thing?

 

Many thanks!

 

Vincent

Dear all,

I woul line integrate e gradient moltiply to a vector. I will try to explain better.

I have define this function:

phi(xi,eta)=(2*xi-1)*(xi-1)*(2*eta-1)*(eta-1)

and I have a vector a

v=(0,1)

I would like to applu a dot product between the gradient of phi an the vector and integrate the results. 

I have already try in many way but without succeed. Someone could please help me?

Thanks 

I have a nonlinear system with 4 equations and 4 unknowns. I am using fsolve. I know that there are multiple solutions for each variable but am only getting one. I need the others. what do I do??

This is my code:

R__1 := Matrix([[1, 0] , [0, 1] ]);

R__2 := Matrix([[1/2, sqrt(3)/2] , [-sqrt(3)/2, 1/2] ]);

R__3 := Matrix([[-1/2, sqrt(3)/2] , [-sqrt(3)/2, -1/2] ]);

R__4 := Matrix([[-1, 0] , [0, -1] ]);

R__5 := Matrix([[-1/2, -sqrt(3)/2] , [sqrt(3)/2, -1/2] ]);

 

d__1 := Vector( [ 0, 5.4] );

d__2 := Vector( [ 6.4, 4.539] );

d__3 := Vector( [ 11, 4.078] );

d__4 := Vector( [ 15.5, 2.079] );

d__5 := Vector( [ 19, 1.039] );

 

a := Vector( [ a__x, a__y] );

 

A__1:=R__1.a+d__1;

A__2:=R__2.a+d__2;

A__3:=R__3.a+d__3;

A__4:=R__4.a+d__4;

A__5:=R__5.a+d__5;

 

OO:=Vector([O__x,O__y]);

 

DA1:=A__2.A__2-A__1.A__1-2*(A__2-A__1).OO;

DA2:=A__3.A__3-A__1.A__1-2*(A__3-A__1).OO;

DA3:=A__4.A__4-A__1.A__1-2*(A__4-A__1).OO;

DA4:=A__5.A__5-A__1.A__1-2*(A__5-A__1).OO;

 

fsolve({DA1,DA2,DA3,DA4},{a__x,a__y,O__x,O__y});

Thanks for any tips you may be able to offer

 

Hi,

I have coded up a vector that is of my interest. The code runs witout any problem and gives me exactly what I want.

newtest.mw

All I want to know, is that if there are more efficient way to do so?

Any tricks, or better use of a particular function that I wasn't aware?

The only tiny bit of unsatisfactory is that, the (1-w) term is at the first term of the addition, is that possible to move it to the last term? Which is more conventional to read.

 

Thanks,

 

casper

Hi all,

Assume that we have a vector, namely v:=[1,-2,3,-4] and we want to construct special matrix namely Z, from Vector v as follow:

first row is 1, secnond row is -2,..., the end row is -4 namely
Matrix([[1,1,1,1],[-2,-2,-2,-2],[3,3,3,3],[-4,-4,-4,-4]]);

in the other word every row of matrix is 4 times corresponding componet in vector.(for example v is (1*4))

how can we do this?

best wishes

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

Hi,

How are you. Nice to meet you once again.

I need your help  to give an answer to  this question:

I have two vector v1:=[1,2,3,4,5,6,7,8]; and v2=[9,10,11,12,13,14,15,16];

I would like to construct a matrix whone first colunm is v1 and last colunm is v2 and all the rest is ZERO.

Many thinks.

 

 

 

This is an application of vector position to better understand the vector speed and acceleration is a well defined vector space. Fully developed with embedded components for proper use.

 

    Vector_Posición.mw                   (in spanish)

 

L. Araujo C.

Physics Pure

Computer Science

Hi all

Assume that we have following vectors:

> V1 := [1/9, -5/9, 7/9, 1/9, -5/9, 7/9, 1/9, -5/9, 7/9];

>  V2:=t*V1;

and we want to compute the integral of V2, namely:

>  Int(seq(V2[i],i=1..9),t=0..1);
>

            [       5 t  7 t         5 t  7 t         5 t  7 t]
      V2 := [t/9, - ---, ---, t/9, - ---, ---, t/9, - ---, ---]
            [        9    9           9    9           9    9 ]

Error, (in print/Int) invalid input: IntegrationTools:-GetOptions expects its 1st argument, v, to be of type Integral, but received Int(1/9*t,-5/9*t,7/9*t,1/9*t,-5/9*t,7/9*t,1/9*t,-5/9*t,7/9*t,t = 0 .. 1)

 how we integrate from V2? why answer is wrong in my code?

thanks a lot

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

In using the Maple 17 VectorCalculus package I was suprised to find that the Norm of a free vector is not the same as the Norm of a "corresponding" RootedVector, i.e.the same vector with a different root. Am I missing something ? Thanks for an explanation.

 

restart;
with(VectorCalculus):

P:=<1,2,3>; # free vector
PP:=RootedVector(root=[-1,2,-3],P)

Norm(P);
Norm(PP);

I am sure that with this vector file with embedded components will learn how it works the vector operations. The code is free and can be modified to be improved. Forward engineers.

 

Vectores_con_Components_Embedded.mw     (in spanish)      

 

Lenin Araujo Castillo

I'm used to Mathcad, and I am very new to Maple. Something I cannot figure out right now is how to define multiple elments of a matrix using a function.


Input Data

Define system dimensions as n:=2;

i:=1..n;

j:=1..n;

lambda:=Matrix(n);

Lambda:=Matrix(n);

upsilon:=vector(n); 

Minor side note: I originaly had upsilon defined using the syntax "Vector[row](ncomp)", but this was giving me an 'exponentiation' operation error, so I changed it to what it is now (basically a list/array, which I guess has different type definitions that no longer cause the error?).

lambda[1,2]:=471.0433;

lambda[2,1]:=883.7530;

upsilon[1]:=58.69;

upsilon[2]:=18.07;

The Problem I'm Having

Now I just want to define Lambda using a function to define all elements (like I would in Mathcad).

Lambda[i,j]:= (upsilon[j]/upsilon[i]) * exp (-lambda[i,j]/2853);

which gives me an extremely long error message:

Error, invalid input: exp expects its 1st argument, x, to be of type algebraic, but received Matrix(2, 2, {(1, 1) = -0.3504976272e-3, (1, 2) = -.16509955895845776, (2, 1) = -.30975332953088164, (2, 2) = -0.3504976272e-3}, datatype = float[8]

As far as I can tell (keep in mind that this is my very first Maple project) that it doesn't like lambda as a matrix? But shouldn't it just evaluate to the element? and why is (2,2) and (1,1) giving values, because it should intialize to zero, so exp(0) = 1 in these cases??

I tried to simplify further by just trying

Lambda[i,j]:=(upsilon[j]/upsilon[i]);

but then it just gives me 1, and when I look into Lambda all the elements are now 1 when only the diagnol elements should be 1 (the rest some fractional amount)??

I am at a complete loss. I thought about doing something like For i = 1 to n etc. but then it just looks like coding, which defeats the purpose of trying to make a calculation sheet documenting the procedure...

Any help and/or insights into what I am doing wrong here would be most welcomed :)

P.S. I've just noticed that there is an upload option :/ Wilson_Equation.mw.

 

Hi all.

Assume that we have:

Where Q is known matrix. how can we produce this vector by maple?

Thanks a lot
Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

Hi all.

Assume that we have:

where

and assume we  want to construct a special Vector as

and from the above vector construct following matrix

how can we do it?

Best wishes

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

Hi everyone,

I have a question regarding the derivation of tensors/matrices.
Let's assume for simplicity, that I have a vector (6x1) s and a matrix A (6x6)defining Transpose(s)*Inverse(A)*s. From this function I want to calculate the derivative w.r.t. s. My approach would be

restartwith(Physics):
with(LinearAlgebra):
Define(s,A)

Diff(
Transpose(s)*Inverse(A)*s, s)

As a result I get

though I'd rather expect something like Inverse(A)*s + Transpose(s)*Inverse(A)

Now as I'm pretty new to Maple, I can imagine that my approach is wrong, but I don't know any better and can't seem to get any information out of the help documents.

Thanks in advance for any of your suggestions!

1 2 3 4 5 6 7 Last Page 1 of 13