Items tagged with assign assign Tagged Items Feed

Dear All

I have simple problem related to ploting of 2-D graph

What I need is listed as below:

1. How I can re-scale axes by 1/2.

2. How to give custom gap between graph and its title.

3. How to place two legends in vertical format in opposite to horizontal.

4. How to assigne custom gap between legends and graph

5. How to place label 'q[b]' on the right side of vertical axes.

f[1] := 0.6553e-2+0.61277e-1*cos(.9976156575*x)-0.3448e-2*cos(1.995231315*x)+0.164e-3*cos(2.992846972*x)



f[2] := 0.6601e-2+0.61212e-1*cos(.9878156204*x)-0.3834e-2*cos(1.975631241*x)+0.182e-3*cos(2.963446861*x)



plot([diff(f[1], x), diff(f[2], x)], x = -3.2 .. 3.2, color = ["Red", "Green"], linestyle = [solid, dash], legend = ["undistorted ( n=0.0, q=0.0)", "undistorted"], labels = [tau*``, q[b]*`\` `], labeldirections = [HORIZONTAL, VERTICAL], size = [500, "golden"], title = "Radial velocity curve of Polytropic Model of Index N=3", titlefont = ["ROMAN", 15], legendstyle = [font = ["HELVETICA", 9], location = bottom]);





I want to assign a value to a symbol stored in a vector. I know the position of the symbol in the vector. Is there an easy way to do this?

Here to illsutrate my problem:



vec(1):=1;    # expected result: a:=1

vec := Vector(3, {(1) = 1, (2) = b, (3) = c})


a;            # expected result: 1








I got a set of ecuations to solve, like this one:


a,b,c,d are numbers, like 2.0458 and so on.


When I want to solve the set, I need to tell Maple the command solve:

solve( {seq(eq[i],i=1..N)},{variables});  (N is an integer of course)


To set the variables, one must check each equation to write: {W[1,0],HRa[1,0],ga[1,0]...} and so on.

I know that I can use the command is(variable,assignable) to check if a variable has not a value assigned already and, according to true/false I can construct the set {variables} and solve the set of equations.

That´s an easy solution if I need to check variables under a certain pattern, like: X[1].X[2],X[3] since I can create a loop and check them one after the other. But my problem is that I have different names for variables or that variables change to assignable from assigned according to other conditions, so I can never be sure if W[1,0] is going to be a variable to compute in all steps instead of SR[1,1].

for example:

if a>3 then
end if;

So, when I need to type solve, the {variables} part is different according to each case. Is there any command that allow me to insert an expression and Maple can return me the variables or parameters in the expression that are not numeric already?

Thanks in advance.

I want to compute some matrix multiplications and i need this expression to be 1 always, i.e,


for every calculation I do.

I have tried x^2+y^2+z^2+w^2:=1 and assign(x^2+y^2+z^2+w^2,1) but it doesn't work.

What I should type to make it work?


Thank you



Suppose I have a table of variables





numelems(f); gives 2.


In case I have not assign f, 

numelems(f); gives error message.


Is there any simple way let maple detect that if it is unassined, numelems(f), can provide zero?


Thank you very much


Dear Maple users

I am unsure how to handle events and their probabilities in Maple. Let's say I know that an event A has the probability say 0.3 and another event B has probability 0.8. I would like to make the following assignments:



and maybe defining the conditional probability:


but I am not allowed to do so in Maple because if will regarded as a function definition. My purpose is to make simple calculations with those probabilities for example:

P(C):=P(A)*P(B)  etc.

My problem is therefore more of a notational problem than a mathematical one. I hope someone can advice me on a proper setup. I am using 2D math notation, by the way. I could of course name the variables containing the probability using simple names like X1, X2, etc., but then I need constantly to remember what they really mean. The above assignments would be much better, because they are easier to handle mentally.


Here is my code

ma[1] := [-885.880598855072776, [bh = 0., g0h = 0., g1h = 0.825946224722250e-4]]

ma[2] := [-877.957885609114328, [bh = 347.116836805625, g0h = 0., g1h = 0.164861392564e-3]]

ma[3] := [-863.445203144006655, [bh = 0., g0h = 0., g1h = 0.787090377403668e-4]]

avb := 90.5276611129000; avg0 := 0; avg1 := 0.92225359e-4;

for j from 1 to 3 do


A[j] := [(avb-bh)^2, (avg0-g0h)^2, (avg1-g1h)^2] 

end do;


Result is that

A[1] := [4763.19965962732, 0., 1.13103562500664*10^(-10)]

Error, invalid left hand side in assignment

 it only shows A[1], but no A[2] and A[3]

Please help!

But I have not found how to do it.

I'd like to tell a new worksheet to use assignments created in another document. This is to save time retyping equations.

And, is this something that others like to do ?



Cheers !

I am trying separation of variables in Maple. I get an equation that has the form   

And now I want to tell Maple to assign the terms with 1/R in them to one variable, say eq21, and the term with 1/Z to second variable, say eq22 The idea is that I can later more easily work with each separate ode. 

I do not know to separate those apart. I could offcourse copy and paste by hand, but I want to automate this.

I tried match() and patmatch() but I am not seeing the way. Here is the code:

T:=  (r,z)-> Z(z)*R(r);
eq1:= diff(T(r,z),r$2)+1/r*diff(T(r,z),r)+diff(T(r,z),z$2);

#need now way to break the above into 2 different variables.

ps. I know I can do this:

T:=  (r,z)-> Z(z)*R(r);
eq1:= diff(T(r,z),r$2)+1/r*diff(T(r,z),r)+diff(T(r,z),z$2);

But this for me is not the right way to do it. I think there should be more algebraic way.


Hello People in Mapleprimes,


I have a question about the codes in the help page of assign.

Please tell me about this.

The folliowing codes were written there:

code (A)





The output of these was 



I think that assign(a,c) means assign(a=c) or a:=c, not c:=a.

If what I wrote was true, the output of the above code should be


And, if I changed assign(a,c) to assign(c,a), the output was d,2,d, which is the output written on the helppage 

of the assign. On the other hand, the output of code A was surely d,2,d.

Why does assign(a,c) have the same meaning as assign(c,a)?


Best wishes



I have the following situation:


Bend is a proc, that returns a Record with info based on its parameters. I would like to get access to the name I assign to (i.e. HB) in the proc. Any chance?

Mac Dude

PS: I can of course kludge things by adding an argument to the proc Bend. But I'd like to avoid that.

I have written a program and at one point I have an assignment statement like BG(i, j) :=1    When ever I run the program, I get a dialog box which asks me to choose between "function definition" and "remember table assignment."  Is there a way to tell the program that I want this to be a table assignment in the code so that I don't always have to answer the question?

Today I have a problem with assign that never arised before. I solved a system of equations with two solutions and wanted to assign, e.g. the second one. Does anybody know why "assign" here does not work, even though I often used it before in the same way. (I also tried it with the array-solution, but I received the same problem.



  {rH = 0., rL = 0., xH = 0.2289428485, xL = 0.2289428485}, {

    rH = 22.70954353, rL = 32.28670872, xH = 0.4250775404,

    xL = 0.4393791233}
  {rH = 0., rL = 0., xH = 0.2289428485, xL = 0.2289428485}, {

    rH = 22.70954353, rL = 32.28670872, xH = 0.4250775404,

    xL = 0.4393791233}
assign {rH = 22.70954353, rL = 32.28670872, xH = 0.4250775404,

  xL = 0.4393791233}
                         rL, rH, xL, xH

I would be very glad, if anybody could help me.

And here is the whole algorithm:





Is it possible in Maple 15 to solve an equation with a parameter for a given set of parameters? How can this be passed to the solve function, should I use some kind of list?  After obtaining the solution how can I assign the solutions to variables such as x1 for the first value of the parameter, x2 for the second value of the parameters and so on. Furthermore, is this possible with the fsolve command?




I was wondering how I could assign small angel assumptions so that I could simplify an equation of motion to solve for theta double dot. Thank you for your help.


Equation Manipulation

-assumptions- small angel







diff(`&vartheta;`(t), t) := 0


diff(x(t), t, t) := (H+u)/M

I*(diff(`&vartheta;`(t), t, t)) = [m*(-l*(diff(`&vartheta;`(t), t))^2*cos(`&vartheta;`)-l*(diff(`&vartheta;`(t), t, t))*sin(diff(`&vartheta;`(t), t)))-m*g]*l*sin(`&vartheta;`)+[m*(l*(diff(`&vartheta;`(t), t))^2*sin(`&vartheta;`)-l*(diff(`&vartheta;`(t), t, t))*cos(diff(`&vartheta;`(t), t))+diff(x(t), t, t))]*l*cos(`&vartheta;`)


Error, (in isolate) unable to isolate diff(diff(`&vartheta;`(t), t), t)





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