Items tagged with array array Tagged Items Feed

I want to generate all 4x4 matrices of rank-1 over the field with two elements, F_2. I don't want to use actual arrays though, I just want to use symbols representing the unit matrices. So for example Eij represents the 4x4 matrix with a 1 in row i & column j, and 0's elsewhere. 

We have 16 unit matrices: E11, E12, ..., E14, ... E41, E42, E43, E44. Then we have to look at all possible linear combinations that result in a rank-1 matrix. So for example: E11+E12,  E11+E21,  E11+E12+E13,  E33+E43, etc. The total number of rank-1 4x4 matrices over F_2 is 225. How can I find all of these quickly?

I am required to generate a list containing the square of numbers 1 through k where k is an arbitrary int,defined from 1 to n. To do this, I've currently got the following commands:

local k, mylist:=[];

for k from 1 to n do

mylist[k]=sumsquare(k);

end do;

where sumsquare() is a procedure I defined to compute the sum of the squares of 1 through a number passed as an argument

At present this gives me an out of bounds error. 

How can I initialize mylist to be of size n, like in other languages such as C++?

 

Dear all;

nice to speak with you.

complete a table randomly by positive three-digit numbers and display only the symmetrical numbers.

 

Thanks

I am trying to alter the Virtual Solar system Maple worksheet of Yi Xie in the way that I added several objects to the eight planets and Pluto (e.g. Hale-Bopp, Sedna, 2012 VP113 etc.) and would like to adjust the array such that when zooming out and the obrit and labels overlap so that it's unreadable anymore (orbits and labels) that I can switch on and off (respectively display/not display) specific parts, e.g. the inner solar system. In the original file a single array was created from 1..18 (including 9 orbital entries and 9 label entries). What I did is to create arrays for each part of the Solar system, e.g. Inner for the planets+Pluto 1..18, an array for Hale-Bopp with an orbital entry and a label entry, so [1,2], and an array with 6 entries for 3 additional objects like Sedna, Planet X and 2012 VP113. As well as the sun, which only has a single entry as there are no orbital elements necessary and one just makes a 3dplot (I did not label it, so just one entry). All arrays are converted into lists in the end and displayed. Here is the code:

 

> with(linalg);

> with(plots);

> with(plottools);

> P1 := matrix([[cos(omega[j]), -sin(omega[j]), 0], [sin(omega[j]), cos(omega[j]), 0], [0, 0, 1]]); P2 := matrix([[1, 0, 0], [0, cos(i[j]), -sin(i[j])], [0, sin(i[j]), cos(i[j])]]); P3 := matrix([[cos(Omega[j]), -sin(Omega[j]), 0], [sin(Omega[j]), cos(Omega[j]), 0], [0, 0, 1]]);

> A:=matrix([[a[j]*(cos(E[j])-e[j])],[a[j]*sqrt(1-e[j]^2)*sin(E[j])],[0]]);

> R:=multiply(P3,P2,P1);

> B:=multiply(R,A);

> a := [.38709893, .72333199, 1.00000011, 1.52366231, 5.20336301, 9.53707032, 19.19126393, 30.06896348, 39.48168677, 1/0.5454e-2, 268.2509283, 532.7838156, 300];

> e := [.20563069, 0.677323e-2, 0.1671022e-1, 0.9341233e-1, 0.4839266e-1, 0.5415060e-1, 0.4716771e-1, 0.858587e-2, .24880766, .994920, .7005635, .8570973, .1];

> i := [7.00487, 3.39471, 0.5e-4, 1.85061, 1.30530, 2.48446, .76986, 1.76917, 17.14175, 89.5328, 24.01830, 11.92859, 10];

> Omega := [48.33167, 76.68069, -11.26064, 49.57854, 100.55615, 113.71504, 74.22988, 131.72169, 110.30347, 282.1476, 90.88303, 144.53190, 45];

> omega := [77.45645, 131.53298, 102.94719, 336.04084, 14.75385, 92.43194, 170.96424, 44.97135, 224.06676, 130.8038, 293.03200, 311.18311, 150];

> i := map(x→ convert(x, units, deg, rad) end proc, i);

> Omega := map(x→ convert(x, units, deg, rad) end proc, Omega);

> omega := map(x→ convert(x, units, deg, rad) end proc, omega);

> for j to 13 do omega[j] := arcsin(sin(omega[j]-Omega[j])/sin(arccos(sin(i[j])*cos(omega[j]-Omega[j])))) end do;

> x := array(1 .. 13);

> y := array(1 .. 13);

> z := array(1 .. 13);

> for j to 13 do x[j] := B[1, 1]; y[j] := B[2, 1]; z[j] := B[3, 1] end do;

> Sun := array([1]);

> Inner := array(1 .. 18); for j to 9 do Colors := [black, green, blue, red, black, yellow, green, violet, brown, aquamarine, black, black, red]; Linestyle := [solid, solid, solid, solid, solid, solid, solid, solid, solid, longdash, solid, solid, longdash]; Inner[j] := spacecurve([subs(E[j] = E, x[j]), subs(E[j] = E, y[j]), subs(E[j] = E, z[j])], E = 0 .. 2*Pi, color = Colors[j], linestyle = Linestyle[j]) end do;

> Comet := array([1, 2]); if j = 10 then Colors := [aquamarine]; Linestyle := [longdash]; Comet[1] := spacecurve([subs(E[j] = E, x[j]), subs(E[j] = E, y[j]), subs(E[j] = E, z[j])], E = 0 .. 2*Pi, color = Colors[j], linestyle = Linestyle[j]) end if;

> Oort := array(1 .. 6); for j from 11 to 13 do Colors := [black, black, red]; Linestyle := [solid, solid, longdash]; Inner[j] := spacecurve([subs(E[j] = E, x[j]), subs(E[j] = E, y[j]), subs(E[j] = E, z[j])], E = 0 .. 2*Pi, color = Colors[j], linestyle = Linestyle[j]) end do;

> Sun[1] := plot3d(0.1e-1, 0 .. 2*Pi, 0 .. Pi, style = PATCHNOGRID, coords = spherical, color = red);

> Inner[10] := textplot3d([subs(E[1] = 0, x[1]), subs(E[1] = 0, y[1]), subs(E[1] = 0, z[1]), "Mercury"]); Inner[11] := textplot3d([subs(E[2] = 0, x[2]), subs(E[2] = 0, y[2]), subs(E[2] = 0, z[2]), "Venus"]); Inner[12] := textplot3d([subs(E[3] = 0, x[3]), subs(E[3] = 0, y[3]), subs(E[3] = 0, z[3]), "Earth"]); Inner[13] := textplot3d([subs(E[4] = 0, x[4]), subs(E[4] = 0, y[4]), subs(E[4] = 0, z[4]), "Mars"]); Inner[14] := textplot3d([subs(E[5] = 0, x[5]), subs(E[5] = 0, y[5]), subs(E[5] = 0, z[5]), "Jupiter"]); Inner[15] := textplot3d([subs(E[6] = 0, x[6]), subs(E[6] = 0, y[6]), subs(E[6] = 0, z[6]), "Saturn"]); Inner[16] := textplot3d([subs(E[7] = 0, x[7]), subs(E[7] = 0, y[7]), subs(E[7] = 0, z[7]), "Uranus"]); Inner[17] := textplot3d([subs(E[8] = 0, x[8]), subs(E[8] = 0, y[8]), subs(E[8] = 0, z[8]), "Neptune"]); Inner[18] := textplot3d([subs(E[9] = 0, x[9]), subs(E[9] = 0, y[9]), subs(E[9] = 0, z[9]), "Pluto"]); Comet[2] := textplot3d([subs(E[10] = 0, x[10]), subs(E[10] = 0, y[10]), subs(E[10] = 0, z[10]), Hale-Bopp]); Oort[4] := textplot3d([subs(E[11] = 0, x[11]), subs(E[11] = 0, y[11]), subs(E[11] = 0, z[11]), "2012 VP113"]); Oort[5] := textplot3d([subs(E[12] = 0, x[12]), subs(E[12] = 0, y[12]), subs(E[12] = 0, z[12]), "Sedna"]); Oort[6] := textplot3d([subs(E[13] = 0, x[13]), subs(E[13] = 0, y[13]), subs(E[13] = 0, z[13]), "Planet X ?", color = red]);

> Sun1 := convert(Sun, 'list');
> Inner1 := convert(Inner, 'list');
> Comet1 := convert(Comet, 'list');
> Oort1 := convert(Oort, 'list');
> display(Sun1, Inner1, Comet1, Oort1, scaling = CONSTRAINED);

 

The first error message appears after the if-condition. Can you tell me where I am making a mistake? Beware: when copy paste the code from Maple to Word and from Word in here the colons at the end of lines have changed into semi-colons. Hope this is no problem in executing the code despite the lines being in the same ">..." e.g. where the labels are defined.

Hi all,

I'm currently writing a code to solve the equations for a gravitational collapse of a star numerically. I'm using two dimensional Arrays for most of the physical quantities in my finite difference equations, with one index for the spatial dimension (I'm only considering spherically symmetric collapses) and one time index. I wrote two nested loops, where the inner one solves the equations from the centre of the star to the surface (with the exception of one quantitiy, where I have to integrate the other way around) and the outer loop advances the Arrays in time. My problem is, that Maple doesn't seems to evaluate the two dimensional Arrays. Instead for inserting the appropriate value for e.g. A[3,2], Maple just keeps on using A[3,2] which messes up some formulas, since I have to take roots of the numbers. At least that is what seems to be going on when I'm trying to debug the relevant part of the code and I check for the values, with whicih Maple calculates. I'm also using a one dimensional Array to store the timesteps, I'm using in the code and Maple doesn't seem to have problems evaluating them. Is anybody familiar with this problem? Does Maple have trouble with multidimensional Arrays in loops or have I just messed up my code? I have uploaded my code (I hope it worked). I apologize for my code being messy, but it's the first time I'm working with Maple and using numerical methods. The part which troubles me is labeled "# actual code".

Thank you all.

Oppenheimer-Snyder_Maple_3.mw

If you define an array with entries from 1..10 and you want to plot these entries but with three different plots, e.g. entry 6 and 7, and again entry 10 shall be plotted separately: plot entries 1,2,3,4,5,8,9 in the same way, but entries 6,7 in a second and entry 10 in a third way. For example with different colors.

Is there a command for this?

Hi there,

this may be a common task but did not find any helpful hint nor an answer: is there any way to combine to arrays A and B into another one element-wise, i.e.:
C = [[A[1],B[1]], [A[2],B[2]],...,[A[N],B[N]]]
without doing a for loop?


Thanks,
jon

Hi there,

I would like to have an operator (in this case, the natural logarithm) applied to a list/array of points defined as:

ydata := [0.572594976618e-1, 0.327865007249e-1, 0.280821589546e-1, 0.114365745192e-1, 0.578537931608e-2, 0.139154661062e-2, 0.641467839994e-3, 0.18013801847e-3];

How can I apply Maple's ln() operator to the whole array (i.e. avoid to apply it to ydata [1], ydata [2], etc.)?

Thank you,

jon

 

Hi,

How do you plot a list of values/an array into a surface?

E.g.

t = [seq(0+i*(2*evalf(Pi)*(1/10)), i = 0 .. 10)]

x:=[3,4,2*evalf(Pi), 7.83]:

y:=[2.5,4.3,6,2*evalf(Pi)+2]:

z:=[-2,0.3,1.5,evalf(Pi)]:

plot3d([x[i]*cos(t), x[i]*sin(t), y[i]*cos(t-z[i])],-10..10,-10..10);

 

 

Hi,

I am trying to interpolate a set of arbitrary numbers including real ones like Pi and plot them using ArrayInterpolate. This does not work. Is there a simple way around this?

Thank you.

Hi,

I have a eight different size lists.

I want to put it into the Array with simplest and clear way as possible respect to first column and containg symbols.
I enclose workseet.

Could you help somone?.
Thank you in advanced

wzel

fill_the_array.mw

a:=[1,2,3]:

b:=[1,2,3]:

evalb(a=b)    #The result is true

c:=Array([1,2,3]):

d:=Array([1,2,3]):

evalb(c=d)    #The result is false

This is Why?

Is it possible to evaluate a function at multiple points described by an array or something of that sort and have Maple return the evaluations as an array. I need approximations of a function at various values of its argument so it would be nice to do it with a single command.

Thanks

Hello,
I have some variables which usually have a specific value. I also have some parameters which are calculated using the previously mentioned constants. Sometimes though I want to change the value of the constants and re-calculate the parameters. Therefore I created a library with the initial values of the constants which I load inside a procedure which calculates the parameters. That way I can change the value of the constants and the initial values are not overwritten. My problem is that I want to export the calculated parameters and the value of the constants at the specific calculation. How do I do that_ I don't have an array, table or anything like that. Should I put my parameters in a table?

Thank you for your time.

Hi,

I need to transfer an array of size (M,N) from maple to matlab. But i dont know how to make it. Please help me for this. Thanx in advance.

Regards

Sunit

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