MaplePrimes Questions

Dear Maple experts,

 

I would like to visualize the equation -3*x+2*y+3*z=0  and (with other color) 2*y+3*z =0. I used the following commands:

with(Student[LinearAlgebra]):
infolevel[Student[LinearAlgebra]]:=1:
PlanePlot(-3*x+ 2*y + 3*z = 0, [x,y,z], normaloptions=[shape=harpoon], showbasis);

But I do not know how to show at the same time the second equation (2*y+3*z=0 ).

 

How should I proceed? Any hint?

Thanks for your attention,

 

Jean-Jaques

 

I am trying to find a way to take the rows of a matrix and put them in a sequence.  For example if i have the matrix 

M:=Matrix(3,[[1,1,1],[2,2,2],[3,3,3]]);

I want to rewrite it as S:= {111222333}.  

Sorry if this is not clear.  I know how to create a sequence, but I want to be able to use the Matrix and output a sequence without manually inputing the numbers.  

Thank you in advance for your help.  

I am finding it a struggle to do this trivial task in Maple.

Given a matrix, I simply wanted to find the positions (index i,j) of all elements that meets some condition. For example, given matrix A:=[[1,2,3,],[4,5,-1]]; I want to find the index of all elements >=3, so the result should be a list of set such as

         [[1,3],[2,1],[2,2]] 

I tried to use member with 'pos' option but that does not work for matirx. It seems only designed for 1D

A:=Matrix( [ [1,2,3],[4,5,-1]] );
c:=select[flatten](x->x>=3,A);  #tried without flatten also
member(c,A,'pos');
pos;

Then I tried rtable_scanblock(), which is the most convoluted and badly documented command I have ever seen in my life (for such a complex command, one will expect 100 examples of many sorts of functionality to illustrate how to use, but only 3-4 trivial examples exist and 3 of them pretty much the same).  What is operation_passindex? what is operation_passnoindex? how to use them? Why is there a star next to val* and operation* ? What is passindex actually? is it a name? value? proc?  etc.. Worst help page ever. 11 parameters for a command??

This is what I tried:

A:=Matrix( [ [1,2,3],[4,5,-1]] ):
rtable_scanblock(A,[],(val,ind,res)->( evalb(val>=3),[ind,val],res),[[1,1],A[1,1]]);

So the result I want is there. I just do not understand why the true,false and those last entries are there and how to get rid of them. I tried. I think I need one other options, but I am lost with all the options listed there with no examples on how to use them.

rtable_scanblock(A,[],(val,ind,res)->`if`( val>=3,[ind,val],res),[[1,1],A[1,1]]);

but then I get only the last value:

I tried

rtable_scanblock(A,[],(val,ind,res)->`if`( evalb(val>=3),[ind,val],res),[[1,1],A[1,1]]);

no difference.  I think I am close, but after 30 minutes, I am calling it quit. If something so easy takes that much effort to find how to in Maple, then something is wrong.

In Matlab, I do this with my eyes closed:

A=[1,2,3;4,5,-1];
[I,J]=find(A>=3)

I =
     2
     2
     1
J =
     1
     2
     3

In Mathematica, such as trivial

mat = {{1, 2, 3}, {4, 5, -1}};
Position[mat, x_ /; x >= 3]

                 {{1, 3}, {2, 1}, {2, 2}}

Thank you

 

Hello,

I have a question concerning the initial conditions.

One interest of MapleSim is to enable to model a multibody systems with different kinds of coordinates : namely relative and absolute coordinates.

For a complex system, it seems to me that the determination of the initial position is not an easy task.

Consequently, I wonder if it is possible to determine the initial positions for the system in absolute coordinates thanks to the knowledge of the initials positions in relative coordinates.

In other words, I have already determined the initial positions of my system in relative coordinates but as I would like to simulate my system with absolute coordinates. I wonder if I can have a process to deduct the initial positions for the absolute coordinates for the initial positions in relative coordinates.

Thanks a lot for your ideas and help.

I want to write an equation in the text portion of my document.  I do not need it evaluated. I just want to write formulas, like I do in LaTeX. 

RandomCompositions:= proc(n::posint, k::posint)
local
C,
Compositions:= [seq(C-~1, C= combinat:-composition(n+k, k))],
Rand:= rand(1..nops(Compositions))
;
()-> Compositions[Rand()]
end proc:

R:= RandomCompositions(9,6):
n:= 2^13:
S:= 'R()' $ n:

 

I want to compile statistics each number in a sequence cannot  occur  over twice.

The sequences that do not fit the rule above must be ommitted.

The statistic is  Fermi-Dirac statistics.

confused the Bose-Einstein condensation and Fermi-Dirac statistics.

But the theory is right.

My question is very similar to this question however my .txt files are in a different format.

I've generated a .txt file with Macaulay2 that looks like this

| -1 0 9  -17 4   |

| 1  2 -3 7    17 |

I would like to import this file into maple and define a matrix M as this matrix. Is there any way to accomplish this?

phi Φ represents the golden ratio 1.61803 . . .

 

In Maple, is it possible to evaluate phi to a number ? (As Pi evaluates to a number.)

 

Cheers !

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,

I don't manage to animate a DensityPlot. Here is my program :

> restart;
> with(Statistics): with(plots):
> P := lambda->RandomVariable(Poisson(lambda)):
> animate(DensityPlot,[P(n),range=0..10],n=1..5,frames=5);

And here is the error message :

Plotting error, non-numeric vertex definition

Thanks for any help

Hi

I'm dealing with 2nd order ODE on Maple. By using " infolevel 5" Maple tell me that it use Kovacic's algorithm to find the solution. Could anybody tell me how or at least some idea so that I can go on this my self. Following here my ODE

Thank you so much

Chaimongkol

I have two questions and I don't know whether it can be solved using Maple. The first question is that I have a text file, the data of which has been sorted using Unix procedure SORT. Since the data has been sorted, we just need to compare consecutive lines. Our aim is to count the total number of the same lines of this file and obtain the maximum number of the same consecutive lines. For example, the data of the file, named file.txt, is:

1,0,5,-2,2,0
1,0,5,-2,3,0
1,0,5,-2,4,-2
1,0,5,-4,4,0
1,0,5,-4,4,0
1,0,5,-4,4,0
1,0,5,0,5,-2
1,0,5,0,6,0
1,0,5,0,6,0

I want to get two numbers: the total number of the same lines 5 and the maximum number of the same consecutive lines 3. Another question is, given a string s, if s is not contained in this file, then the program returns NULL;otherwise, the program returns the total number it appears and the specific line numbers it appears. For instance, suppose the string is s=1,0,5,-4,4,0, then it returns the total number 3 and the line numbers 4,5,6.

Best regards,

Liu

In Maple, I seem to keep finding commands in different Maple build-in packages that does the same thing. Which is very confusing for someone trying to learn Maple.

Maple seems to have good things in it, but at the same time, it strikes me as a large bag with lots of tools and commands thrown in with little sense of coherence. One needs one command from one package to finish the job started using a command from a different package, and an option from one place to patch something done with a command from another package.

Here is one example. I wanted to obtain the diagonal of a matrix. So far, I found 3 commands that do the same exact thing:

A:=Matrix([ [1,2,3],[4,5,6],[7,8,9]]);
MTM:-diag(A);  #1
LinearAlgebra:-Diagonal(A);  #2
Student:-LinearAlgebra:-Diagonal(A);  #3

I am sure if continue to look, I might find another command to do the same thing hiding in some other package.

The problem for new user like me, is how does one decide which comand to use. This is the same as with constructing a Matrix. There is the Matrix([[]]) notation and metod, and there is the <<>> notation that does the same thing but with different and conflicting syntax.

Having many commands that do duplicate things is not a good thing at all. Commands should be axiomatic and orthogonal to each others. I think there should be a document that describes from a high level all these packages, may be as a block diagram with arrows that show the relation, if any, between them, and how they interact and when to use one vs. the other.

Is there a reason for this duplication of functionality? Does any one at Maplesoft look at such issues?

 

Hello,

 

in summary, I have a problem with the evaluation of a matrix multiplication between matrices with trigonometric entries.

Im a bloody beginner with Maple, so sorry in case this question is stupid or I posted in a wrong way!

 

There is the 6x6-Matrix  L, which has entries like:  Lmn = L1 + L2 cos(2 phi + phi_0).

I want to transform this Matrix L with  the 3x6 rotational Matrices T and its 6x3 Inverse-Matrix  T_p_inverse, 

like:                              L_transformated = T * L * T_p_inverse

 

The problem is, that I don't get Maple to simplify the solution.

I tried combine, simplify, expand, evala, but maple does not combine and simplify the solution. Due to the trigonometric entries and orthonomal row-vectors in T, I expect the solution to be quite simple.

Attached you find my worksheet!   transformation_L.mw

It would be great if somebody can help me or give me a hint!

Thanks a lot!

nilssson

 ---------------------------------------------------------------------

Here are the exact Matrices:

 

 

 

 

 

Hi
I am trying to define commutation rules between operators a1, a2, b1, b2.


restart;
with(Physics);
with(Library);
Setup(mathematicalnotation = true);

Setup(op = {a1, a2, b1, b2});
alias(A = %AntiCommutator);
algebra := [A(a1, a1) = 0, A(a2, a2) = 0, A(a1, a2) = 0, A(b2, a1) = 0, A(a1, b1) = 1,
A(a2, b2) = 1];
Se
tup(algebrarules = algebra);

However, the command Setup(algebrarules = algebra); causes an error. What is wrong? Noteworthy that if commutator is considered instead of anticommutator alias(A = %Commutator); then correct result follows.
Thank you.

First 1391 1392 1393 1394 1395 1396 1397 Last Page 1393 of 2434