Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Unit_vectors_from_different_coordinate_systems.mw
 

restart

NULLNULL

with(Physics)``

with(Vectors)

NULL

It's common in mathematical physics to use cartesian unit vectors to describe the position of a point in space.

 

r_(t) = x(t)*_i+y(t)*_j

r_(t) = x(t)*_i+y(t)*_j

(1)

Sometimes it neccessary to convert a position vector like `#mover(mi("r"),mo("→"))`(t) to another cartensian coordinate system with different unit vectors, I call the primed system. In the primed system the position vector looks like:

"(r')(t)=x'(t) (i')+y'(t) (j')"

When using Physics[Vectors] and the unit vector hat notations to define vectors in cartesian space, can I define more than one cartesian space such as:

`#mover(mi("r"),mo("→"))`(t) = x(t)*`#mover(mi("i"),mo("∧"))`+y(t)*`#mover(mi("j"),mo("∧"))`

NULL

and

  "(r')(t)=x'(t) (i')+y'(t) (j')"?

Another way to ask the same thing: Can I define the position vector in different coordinates, each system having a distinct pair of orthogonal unit vectors?

 

The short answer I think is no. Given the current implementation it's not clear how one would go about defining the relationships between unit vectors from different coordinate systems. See below.

 

In 2D the transformation corresponds to a rotation of a vector the plane. The tranformation is characterized by the rotation angle α.

 

 

 

The unit vectors from different systems are related through scalar products.

 

"(i)*i' =(|i|)*|i'|*cos(alpha)=cos(alpha)"``NULL

NULL

"(j)*(j)' =(|j|)*|(j)'|*cos(alpha)=cos(alpha)"NULLNULL

``

"(j)*(i)' =(|j|)*|(i)'|*cos(3 alpha)=cos(3 alpha)"``NULL

 

Is there a way to implement scalar products of vectors from different coordinate systems using the Physics Tensors package? Here I create three different coordinate systems. I don't know whether the unit vectors systems X and Y have the same (i, j, k) unit vectors or does each system have its own triplet?

NULL

Setup(coordinates = cartesian, metric = Euclidean, dimension = 3, spacetimeindices = lowercaselatin, geometricdifferentiation = true)

[coordinatesystems = {X}, dimension = 3, geometricdifferentiation = true, metric = {(1, 1) = 1, (2, 2) = 1, (3, 3) = 1}, spacetimeindices = lowercaselatin]
````

(2)

Coordinates(Y, Z, Z = cylindrical)

{X, Y, Z}

(3)

NULL

NULL


 

Download Unit_vectors_from_different_coordinate_systems.mw

 

Given a set (list) of PDE, is there a way to search all possible solution sets? For instance, pdsolve will output the solution

{_eta[0](t, x) = 0, _xi[t](t, x, u) = _C1, _xi[x](t, x, u) = _C2, eta[1](t, x) = 0}

for the list of PDEs below. But I am aware that there is another solution different from the above, is there way to seek these other solutions?

 

[alpha*u^2*(diff(eta[1](t, x), t))+alpha*u*(diff(_eta[0](t, x), t))-u*(diff(eta[1](t, x), t))-u*(diff(eta[1](t, x), x))+u*(diff(eta[1](t, x), x, x, t))-(diff(_eta[0](t, x), x))-(diff(_eta[0](t, x), t))+diff(_eta[0](t, x), x, x, t), -(diff(_xi[x](t, x, u), u, u, u)), -(diff(_xi[t](t, x, u), x))-(diff(_xi[t](t, x, u), t)), -(diff(_xi[t](t, x, u), x, x)), -2*(diff(_xi[t](t, x, u), x, x))-(diff(_xi[x](t, x, u), x, x))+2*(diff(eta[1](t, x), x)), diff(eta[1](t, x), t)-2*(diff(_xi[x](t, x, u), x, x)), -(diff(_xi[x](t, x, u), t))*alpha*u-(diff(_xi[x](t, x, u), x, x, x))-(diff(_xi[t](t, x, u), x))+2*(diff(eta[1](t, x), x, t)), -(diff(_xi[x](t, x, u), x)), -(diff(_xi[t](t, x, u), t))*alpha*u+(diff(_xi[t](t, x, u), x))*alpha*u+(diff(_xi[x](t, x, u), x))*alpha*u+(diff(_xi[x](t, x, u), t))*alpha*u+eta[1](t, x)*alpha*u+alpha*_eta[0](t, x)+diff(_xi[t](t, x, u), t)-(diff(_xi[t](t, x, u), x, x, x))-(diff(_xi[x](t, x, u), x))-(diff(_xi[x](t, x, u), t))+diff(eta[1](t, x), x, x), -2*(diff(_xi[x](t, x, u), u)), -2*(diff(_xi[t](t, x, u), x, u)), -2*(diff(_xi[t](t, x, u), u))-(diff(_xi[x](t, x, u), u)), -(diff(_xi[t](t, x, u), u)), -(diff(_xi[t](t, x, u), u)), -5*(diff(_xi[x](t, x, u), u, u)), -(diff(_xi[t](t, x, u), u, u)), -3*(diff(_xi[t](t, x, u), x, u)), -2*(diff(_xi[x](t, x, u), u)), -(diff(_xi[t](t, x, u), u)), -(diff(_xi[t](t, x, u), u)), -2*(diff(_xi[t](t, x, u), u, u))-(diff(_xi[x](t, x, u), u, u)), -(diff(_xi[t](t, x, u), u, u, u)), -3*(diff(_xi[t](t, x, u), u, u)), -3*(diff(_xi[t](t, x, u), x, u, u)), (diff(_xi[t](t, x, u), u))*alpha*u-(diff(_xi[x](t, x, u), u))-3*(diff(_xi[t](t, x, u), x, x, u)), -2*(diff(_xi[x](t, x, u), x, u))-4*(diff(_xi[t](t, x, u), x, u)), -(diff(_xi[t](t, x, u), u))*alpha*u+(diff(_xi[x](t, x, u), u))*alpha*u+diff(_xi[t](t, x, u), u)-(diff(_xi[x](t, x, u), u)), -3*(diff(_xi[x](t, x, u), x, x, u))-(diff(_xi[t](t, x, u), u)), -7*(diff(_xi[x](t, x, u), x, u)), -3*(diff(_xi[x](t, x, u), x, u, u))]

Hi.  I am using the linux version of Maple.  I seem to experience more bombs in Maple/Linux vs MathCad/Windows.  The program just froze as I was entering text.  Just text.  It is not a disaster since I make very frequent saves.  But it is very annoying.  I was a heavy user of MathCad from about 2005 to 2019.  In the early days, it bombed a lot.  But I do not recall that it ever bombed when I was entering text.  Any suggestions?  Would there be a limition on the number of text characters?  Is it Linux?  Other than this problem, it is a great program.

The Examples section on the help page of a command is important for learning, but cannot cover all uses. This is especially true for general purpose commands like "solve" or "simplify". Searching all help pages that contain the word "solve" results in too many irrelevant hits that do not contain examples.

Why does adding a bracket to a command not filter for help pages with examples using the command?

Inside a help page Find/Replace finds such strings.

Hello,

Is it possible to have a common legend for different figures? I can plot them as Array of Plots (below) but then they each have a legend. 

Is it possible to have the two figures side by side and a common legend in the middle?

Thank you!

restart:
with(plots):
A := Array(1 .. 2):
A[1] := plot([2*sin(x), 3*sin(x)], x = -Pi .. Pi, labels = [x, b*sin(x)], color = [blue, red], legend = ["Case of b=2", "Case of b=3"]):
A[2] := plot([2*cos(x), 3*cos(x)], x = -Pi .. Pi, labels = [x, b*cos(x)], color = [blue, red], legend = ["Case of b=2", "Case of b=3"]):
display(A);

I'd like to print a high res and quality worksheet but maple has very poor printing.

 I'd like to change the font so I can print more text. I'd like to change the dpi of the print to get higher quality.

Right now I'm having to print screen then scale in photoshop just to get a halfway decent print. I don't want pages of wrapped text that is very confusing to view. If I zoom out all the way on the worksheet I can almost get what I want as far as the size and wrapping(I want to avoid wrapping and there seems to be no way to turn this "feature" off). Of course when I zoom out and use print screen the quality is extremely low due to resolution issues. [So "zooming out" let's me stuff most of the data in to view that I want but then when I use print screen to capture it the quality is so low as not to be useable due to the dpi issue. Of course if I use any of maples printing "features" it will ignore the zoom scaling so as to be useless]

The only thing I can see on how to solve this issue is to save to latex and modify the latex. The problem is that maple puts a lot of junk formatting in the latex to make the wrapping look the same which is exactly what I do not want.

Maple has a "copy as image" but this doesn't seem to do anything. The printing of Maple really needs to be worked on. It's so limited to be almost useless.

I want to know if it is possible to use the declare command from the PDETools package for a function

f(x,y,z)

and still, having the notation $\frac{\partial f}{\partial x}$ instead of $f_x$ for the Maple command %diff(f(x,y,z),x)

Thanks !

Kevin

Hi

Keep getting "Error, null" on every calculation i make. It indicates hidden spaces or something weird????.

Screenshot of it is included. 

https://imgur.com/a/wSdUeqe

Would be great with a fix or some help because this is driving me mad....

It would be nice to have the file name in addition to the name of the code attachment on the top.

Is their anyway we can get the smiles file of given IUPAC name 

Smiles with explicit hydrogen

And draw its chemical graph 

I  generated some graphs via maple and would like to put them in my paper. So I am going to convert the following worksheet to pdf.

with(GraphTheory):
Graphs:=[NonIsomorphicGraphs(6,8,output=graphs,outputform = graph)]:
num_g:=nops(Graphs):
num:=ceil((num_g)/5.):
M1:=Matrix (num,5,(i,j)->`if`((i-1)*5+j<=num_g, DrawGraph(Graphs[(i-1)*5+j],size=[250,250] ,overrideoptions ,showlabels=false,style=planar, stylesheet =  [
 vertexcolor     = orange
,vertexfontcolor = black
,vertexborder    = false
,edgethickness   = 0.6
,edgecolor       = MidnightBlue
,vertexshape     =  "circle"
,vertexfont      = [Arial, 4],
vertexthickness=5], caption = cat(H__,5*(i-1)+j),captionfont=["ROMAN",7]),plot(x = 0 .. 1, axes = none))):
DocumentTools:-Tabulate (M1[1..5,.. ],widthmode=percentage ,width=80 , exterior =all) :

 

 

But there was a problem with the exported pdf. There was some mosaic stuff at the vertices of all those graphs. It was strange. (I want to reduce the size of vertices of the graphs in order not to look crowded.)

 

Only when I insert the option vertexpadding and set a large enough size  of vertex (for this example, we set vertexpadding=7),  it won't go wrong. However, in fact, we often need make vertice‘s size smaller , especially when there are more vertices.

How to integrate the below function from 0 to eta.

A := P(eta)+S(H-2*`cos&theta;`(eta+1)*F)+`cos&theta;`*(2*F(eta)-2*H*F) = S(eta+1)*`sin&theta;`*F(theta)-`sin&theta;`(F*H(theta)-H*F(theta)+F(theta, eta))

Thanks in advance

I need to make my base class local variable static, so that when extending the class, the subclass will share these variable and use their current values as set by the base class. If I do not make them static, then the base class when extended, will get fresh instance of these variable, losing their original values, which is not what I want.

To do this, one must make the base class variables static

This works, but now I do not know the syntax where to put the type on the variable. 

I can't write   local m::integer::static; nor local m::static::integer;

I could only write local m::static; but this means I lost the ability to have a type on the variable and lost some of the type checking which is nice to have in Maple. From Maple help:

 

Here is example

restart;

base_class:=module()
  option object;
  local n::static;  #I want this type to ::integer also. But do not know how

  export set_n::static:=proc(_self,n::integer,$)
     _self:-n := n;
  end proc;
  
  export process::static:=proc(_self,$)
    local o;
    o:=Object(sub_class);
    o:-process();
  end proc;
end module;    

sub_class:=module()
   option object(base_class);
   process:=proc(_self,$)
      print("in sub class. _self:-n = ",_self:-n);
   end proc;
end module;

o:=Object(base_class);
o:-set_n(10);
o:-process()


            "in sub class. _self:-n = ", 10

The above is all working OK. I just would like to make n in the base class of type ::integer as well as ::static

Is there a syntax for doing this?

 

Hi,

One of my areas of expertise is in Designer Filters EMC. Could any professional that already uses MapleFlow for EMC and Electromagnetism, help me about the main functions of this amazing software?

Thanks.

Leandro Zamaro

I have a set of formulas I saved in a matrix and the exported the matrix to Excel. However when I open the file in Excel the equations are in prefix notation (I think).  That's not exactly human readable friendly.  If I copy and paste straight into excel they are readable.

It there a way to make the Maple export similar?

EDIT:-  I exported as a.csv file because if export as .xlsx    all the equation change into "#NUM!" in the spreadsheed.

restart

NULL

Digits := 5

5

(1)

interface(displayprecision = 5); interface(rtablesize = 30)

5

(2)

cosrule := proc (a, b, c, A) options operator, arrow; a^2 = b^2+c^2-2*b*c*cos(A) end proc

proc (a, b, c, A) options operator, arrow; a^2 = b^2+c^2-2*b*c*cos(A) end proc

(3)

Ang := solve(cosrule(a, b, c, A), A)

Pi-arccos((1/2)*(a^2-b^2-c^2)/(b*c))

(4)

Formulas := Matrix(20, 4)

 

 

 

 

data := [L[1] = 619.35, L[2] = 891.12, pos = 180, tos = 90, x1 = 600, y1 = -800, z1 = 500, x2 = 900, y2 = -200, z2 = 850, `&Theta;t` = 29.34*Pi*(1/180), `&Theta;p` = 53.98*Pi*(1/180)]
 

 

 

 

i := 3

res0 := `&Delta;Z` = z2-z1; Formulas[i, 1] := lhs(res0); Formulas[i, 2] := rhs(res0)

`&Delta;Z` = z2-z1

(5)

res0 := eval(res0, data); Formulas[i, 3] := rhs(res0); Formulas; i := i+1

`&Delta;Z` = 350

(6)

res1 := dt[1] = sqrt(tos^2+L[1]^2); Formulas[i, 1] := lhs(res1); Formulas[i, 2] := rhs(res1); res1 := eval(res1, data); Formulas[i, 3] := rhs(res1); Formulas; i := i+1

dt[1] = 625.85

(7)

NULL

res2 := d[1] = sqrt(pos^2+tos^2+L[1]^2); Formulas[i, 1] := lhs(res2); Formulas[i, 2] := rhs(res2); res2 := eval(res2, data); Formulas[i, 3] := rhs(res2); Formulas; i := i+1

d[1] = 651.22

(8)

res3 := dt[2] = sqrt(tos^2+L[2]^2); Formulas[i, 1] := lhs(res3); Formulas[i, 2] := rhs(res3); res3 := eval(res3, data); Formulas[i, 3] := rhs(res3); Formulas; i := i+1

dt[2] = 895.65

(9)

NULL

res4 := d[2] = sqrt(pos^2+tos^2+L[2]^2); Formulas[i, 1] := lhs(res4); Formulas[i, 2] := rhs(res4); res4 := eval(res4, data); Formulas[i, 3] := rhs(res4); Formulas; i := i+1

d[2] = 913.56

(10)

NULL

res7 := tau = arctan(tos/L[1]); Formulas[i, 1] := lhs(res7); Formulas[i, 2] := rhs(res7); res7 := eval(res7, data); Formulas[i, 3] := rhs(res7); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1

8.2678

(11)

NULL

res8 := rho = arctan(tos/L[2]); Formulas[i, 1] := lhs(res8); Formulas[i, 2] := rhs(res8); res8 := eval(res8, data); Formulas[i, 3] := rhs(res8); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1; data := [op(data), res0, res1, res2, res3, res4, res7, res8]

5.7674

(12)

NULL

res9 := alpha = `&Theta;t`+tau-rho; Formulas[i, 1] := lhs(res9); Formulas[i, 2] := rhs(res9); res9 := eval(res9, data); Formulas[i, 3] := rhs(res9); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1; data := [op(data), res9]

31.840

(13)

NULL

NULL

NULL

res10 := dt[3] = solve(cosrule(dt[3], dt[2], dt[1], alpha), dt[3])[1]; Formulas[i, 1] := lhs(res10); Formulas[i, 2] := rhs(res10); res10 := eval(res10, data); Formulas[i, 3] := rhs(res10); Formulas; i := i+1; data := [op(data), res10]

dt[3] = 491.45

(14)

NULL

NULL

res11 := beta = solve(cosrule(dt[1], dt[2], dt[3], beta), beta); Formulas[i, 1] := lhs(res11); Formulas[i, 2] := rhs(res11); res11 := eval(res11, data); Formulas[i, 3] := rhs(res11); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1; data := [op(data), res11]

42.215

(15)

NULL

NULL

NULL

NULL

res12 := Zeta = arccos(`&Delta;Z`/dt[3]); Formulas[i, 1] := lhs(res12); Formulas[i, 2] := rhs(res12); res12 := eval(res12, data); Formulas[i, 3] := rhs(res12); 180*(eval(rhs(`%%`), data))/Pi; Formulas[i, 4] := %; Formulas; i := i+1; data := [op(data), res12]

44.588

(16)

NULL

NULL

res13 := dt[4] = dt[3]*sin(Zeta); Formulas[i, 1] := lhs(res13); Formulas[i, 2] := rhs(res13); res13 := eval(res13, data); Formulas[i, 3] := rhs(res13); Formulas; i := i+1; data := [op(data), res13]

Matrix(%id = 36893490716944981036)

(17)

 

``

NULL

``

NULL

currentdir()

"C:\Users\Ronan\Documents\MAPLE\A & Q Maple primes"

(18)

NULL

with(ExcelTools)

[Export, Import, WorkbookData]

(19)

NULLExport(Formulas, "Frmls.csv")NULL

Download test_eqn_export.mw

First 31 32 33 34 35 36 37 Last Page 33 of 2097