Items tagged with vector

Feed

A very big data was imported by me through

data := Import("http://fs3.fex.net/get/245716150875/11071260/data.txt");
"3.0994584798345
22.889020258043
....

26.082759642081
42.911810680717
6.4578968130322"



I need to convert it to Vector/Array. Now its type is "string":

whattype(data);
                             string

Here is my unsuccessful attempt:

convert(data,Vector);
Error, invalid input: `convert/Vector` expects its 1st argument, V, to be of type {Array, Matrix, Vector, array, sequential}, but received 3.0994584798345
22.889020258043
....

data.mw

Hello,

I have a list of equations. I would like to display this list in column.
Problem : as each term of my list is an equation, i can not transform my list in a vector.
How can I do to display a list of equations in column ?

Thank you for your help.

Maple provides efficient vectorization and automatic parallelization for many common operators. For example

x -> 2*~x*~cos~(x*~x)

But in my application it is common to want to create rather long vectorized operators starting from some complicated symbolic computations. Doing conversions by hand from symbolic expressions to element-wise operations is laborious and error prone.

As a very simple example consider that it is possible to obtain (almost) the same result as above by writing the following as a vectorized operation

D(x->sin(x^2))~

But there are at least two problems with this. First of all it is not nearly as efficient as the first operator and second, perhaps not unrelated, is that the datatype returned when applying this operator to a Vector/rtable of hardware floats (e.g. datatype=float[8]) becomes something  more general.

My question is how can I convert a complicated symbolic expression into an efficient numeric element-wise vector operation?

I have tried several different approaches but so far without success. In the case above for example it seemed natural to expect that the following derivative

D(x->sin~(x^~2))

would produce a vectorized result, but this is not the case. In another attempt I was unable to see how to perform substitions into an expression, e.g. like this

unapply(subs(`*`=`*`~, cos=cos~, diff(sin(x),x)), x)

I would be glad to receive suggestions and/or references to relevant documentation. 

 

I found the following: 

Question:matrix multiplication element by element

Does this not apply to vectors?  If not what syntax is required?  I cannot seem to execute this simple operation which I can easily do in MATLAB.  If you have such a capability why is it not clearly documented in the HELP pages?

I want to plot the eigenvalues of a 4x4 matrix. I know how to determine the eigenvalues, but how do i plot them? Because i saw that plot only works with real numbers. The result is a column vector. 

Hi.

Lets say im given 2 surfaces like this:

S1: z=x^2+y^2 and S2: z=-2x

To find all the points on this surface i set z=z and obtain the equation, but lets say I was given an arbutary vectorfield and was required to find the outward flux I would need and parametric equation for the surface which is now a solid enclosed by 2 surfaces.

 

Of course I could apply the divergence theoreme and integrate the divergens over the entire volume using tripple integral. This I suppose this requires a bit more work compared to using the vector calculus package.

 

Would anyone give me an hint on ho to acheive this? Im also looking to plot the object crated by the bounderies of the divergenc theorem bounderies

Int(Int(Int(4*z, z = x^2+y^2 .. -2*x), y = -sqrt(-x^2-2*x) .. sqrt(-x^2-2*x)), x = -2 .. 0)

I having a hard time with defining a vector, in order to store in it some data, then plot it and export it to a file, I copied all what's in the help instructures but it doesn't work everytime, please it's urgent for my PhD thesis !

Hej all,

I have a problem. When i have a 9-1 vector "DD" how can i get maple to solve DD^2 my equation is A=(pi/4)*DD^2 should be simple.

 

Also when i have two vectors one is 9-1 and the other is 5-1 i want to divide the 5-1 / 9-1 but i want all possible soluitons? not just 5 results but 45 results.(the zip fuction only gives me 5 results)

 

Pls help 

 

Kind regards

How do I convert an equation into a vectorial form in Maple?

Say you hav f_1(v)=-1/2*C*p*v*V

where V=[vx, vy] and v=|V|.

 

v=46m/s^2, A=18m^2, p=1,1

 

I attempted to use convolution in AudioTools to convolve 2 vectors with arbitrary values, but could not since the operation is expecting numeric values.  Can this be done?    Is there not a convolution operastor in the LinearAlgebra package?  See attached:

convolutionWithAu[1].mw

Dear all,

 

I am trying to plot in the same graph two sets of data points given by vectors. Please see the example below. Any help will be highly appreciated. Thanks!

 

question.mw

Dear readers,

For a question for my students I want them to calculate tge resulting vector from two vectors. The student had to answer by giving the length and angle of the resulting vector.

For the question the vector angle is always larger as 180 derges, the student should for example give a result of 270 degrees.

Currently I'm using the following code:

$F1=100;#range(200,500,20);
$F2=100;#range(100,200,10);
$A1=45;#range(10,80,5);
$A2=45;#range(10,80,5);
$A1r=180+$A1;
$A2r=360-$A2;
$F1x=maple("cos(($A1r)*Pi/180)*$F1");
$F1y=maple("sin(($A1r)*Pi/180)*$F1");
$F2x=maple("cos(($A2r)*Pi/180)*$F2");
$F2y=maple("sin(($A2r)*Pi/180)*$F2");
$V1=maple("Vector(2,[($F1x),($F1y)])");
$V2=maple("Vector(2,[($F2x),($F2y)])");
$V3=maple("($V1)+($V2)");
$F3=maple("LinearAlgebra[Norm]($V3)");
$V0x=maple("Vector(2,[1,0])");
$A3=maple("LinearAlgebra[VectorAngle](($V0x),($V3))");
$A4=maple("evalf((($A3)*180/(Pi)))");

As you can see maple will always give an angle smaller than 180 degrees since the angle between two vectors is always 180 degrees or smaller.

Can anyone tell me how I should code this problem such that the rest for A4 will be 270 degrees rather than 90 degrees, as is given from the current way of coding.

Thank you in advance.

I have the following problem consisting of multiple seteps.

I have a vector equation consisting of n equations with n parameters (a[n]). Usually the n <= 15. As example data I will use the case n=4.

equations := Vector[column]([ a[1], a[2], a[3],a[4]])-Vector[column]([ b[1], b[2], b[3],b[4]])=0;

The first thing I want to create is a matrix with a format 2^n x n (here: rows=16 by columns=4). The matrix only consists of ones and zeros which contains all possible combinations of ones and zeros. E.G. for n=4

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

Question 1: How do I create such a matrix for the general case? I have absolutely no idea how to achieve this with Matple

The next thing I want to do is to use the rows as substitution equations for the a[i] values, only if the value of the subsMatrix is 0. E.G. in the first case I want to set a[1]=a[2]=a[3]=a[4]=0, then a[2]=a[3]=a[4]=0, then a[1]=a[3]=a[4]=0, and so forth and save the equation as a new equation

I tried the following:

rows:=RowDimension(subsMatrix);

columns:=ColumnDimension(subsMatrix);

for i from 1 by 1 while  i<=rows do

                 subsEquations[i]:=equations

                 for j from  1 by 1 while  j<=columns do

                     if subsMatrix[i,j] =0 then

                          subsEquations[i]:= subs(a[j]=subsMatrix[i,j],subsEquations[i]) 

                     else      

                          #do nothing if the value in the subsMatrix[i,j]=1

                     end if

                 end do:    

end do:

Question 2: What is my error? Maple says the loop is indeterminate. But I don't see why it is not working.

 


I would be thankful if someone could help me out. I am open to other kind of strategies to this problem :).

I am quite a new user of Maple 2016.

I intend to plot complex numbers as vectors (Phasors), with diferent relationsships between them. I would like to use parameters and modify them e.g with a slider. I can't find how to do it. 

 

For example:

V1=1*cos(delta)+j*sin(delta)

Ve=0.5*cos(alfa)+0.5*j*sin(alfa)

V2=Ve+V1

V2=1+j0

V12=V1-V2

I=V12/(Zcos(beta)+jZsin(beta))

I would like to be able to see those vectors, employing alfa and beta as parameters (e.g between -pi and pi)

 

Any ideas on how to plot that? Maybe Maple is not the right tool to do it. Is there any specific to plot interactive phasors?

Thanks

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