MaplePrimes Questions

The loglogplot procedure in the plots package labels the axes using "10 to the power notation" that looks like what you would see in LaTeX from the expresion "10^{-4}".

I"m at a loss about how to do the same.  If I try typesest(10^(-4)) the argument is converted to a rational before typeset gets the argument and the result is something equivlent to LaTeX's "\frac{1}{10000}".

Example:

    loglogplot(x, x = 0.1*10^(-5) .. 10, title = typeset(10^(-4)));

produces:

    

Hello, 

I build a small simple custom library in MapleSim, for some reaon MapleSim is keep giving me that a variable can't be resolved and that there is no "LibraryName" visible. 

The library loads successfully with no error though. 

exact msg:

Cannot resolve type `MyLibrary.Dh_Revolute` of variable `Main.DR1` in model `Main`; there is no `MyLibrary` visible

thanksf or your help. 

Dear all
I have an algorithm  to solve a first order odes, all steps of the algorithm ( as presented in the book are coded) but unfortunately something wrong. 
The algorithm and the code are attached in the following code. 
Thank you in advantage for your help. 

sol_odes.mw


 

 

I am a new user of Maple. I use Mathcad to plot n*n*n 3D mesh as shown in my sheet.

Please show me the way how to plot3D by Maple. I want to make f(n) to make n*n*n 3D mesh with points and lines.

Tokoro.

Hi again,

Are there any Maple experts out there that can help me save a matrix full of data?

two_column_matrix.pdf

Regards,

Matt

sum( (-1)^k/k * sin(k*x), k=-infinity..infinity);

  (mathematica solves this instantly.)

Hello friends, I have the following problem:
I have two lists of vectors, L1 and L2. The lists have the same number of vectors, and all the vectors have the same length.
I need to check if there is a permutation that, when applied to all the elements of one list, will obtain all the elements of the other list. For example, consider the following lists :

L1:=[<0|0|0>,<2|1|2>,<1|2|1>];
L2:=[<1|1|2>,<2|2|1>,<0|0|0>];

In this example the vectors are of length 3. Therefore, there are 3!=6 possible permutations. Namely:

P1:=<<1,0,0>|<0,1,0>|<0,0,1>>;
P2:=<<0,1,0>|<0,0,1>|<1,0,0>>;
P3:=<<0,0,1>|<1,0,0>|<0,1,0>>;
P4:=<<0,0,1>|<0,1,0>|<1,0,0>>;
P5:=<<0,1,0>|<1,0,0>|<0,0,1>>;
P6:=<<1,0,0>|<0,0,1>|<0,1,0>>;

In this case there are two permutations that satisfy the condition above, namely:

P3:=<<0,0,1>|<1,0,0>|<0,1,0>>;
P6:=<<1,0,0>|<0,0,1>|<0,1,0>>;

Cause

for i in L1 do Multiply(i, P3) end do;
>[0 0 0]
  [2 2 1]
  [1 1 2]
 
The same result is obtained using the permutation P6.
I'm working with larger lists and longer vectors so I'm looking for a quick way to check this. Thanks for your valuable help.

Hello,

I am trying to solve the following system of odes where the unknowns are xhat, yhat, uhat and vhat. They depend on the variables (x, y, u, v, a_1, a_2, a_3, a_4, f(x)) where f(x) is an arbitrary function and I want to solve it with respect to a_1. The RHS has f(x) and its derivative with respect to x. The dsolve function fails to solve the ode when I add f(x) at the list of variables. 

restart;
vars := x, y, u, v, a_1, a_2, a_3, a_4, f(x);
sys_ode := diff(xhat(vars), a_1) = a_3*x + a_1, diff(yhat(vars), a_1) = a_2 - a_4*y + f(x), diff(uhat(vars), a_1) = a_3*u + 2*a_4*u, diff(vhat(vars), a_1) = a_4*v + diff(f(x), x)*u;

initvars := x, y, u, v, 0, a_2, a_3, a_4, f(x);
ics := xhat(initvars) = x, yhat(initvars) = y, uhat(initvars) = u, vhat(initvars) = v;
solution_a1 = dsolve([sys_ode, ics], [xhat, yhat, uhat, vhat]);

Can anyone help regarding this issue ?

Hello dear experts. Please help me with a specific issue.
There is an article (attached A_Fuzzy_Best_Worst_approach_to_the_determination_of_the_importance_level_of_digital_supply_chain_on_sustainability.pdf) that describes the Fuzzy Best Worst method for solving a specific problem. On page 7, in the description “Step 5”, it is indicated that the calculation of the equation takes place in the Maple software. As a result, they receive fuzzy criteria weights.


Also on page 9, at the very top, the model itself is described, which is used in Maple.

Please tell me how these fuzzy criteria weights are calculated in Maple? Thanks in advance.

Anyone could help me know how to use of "Back Solving Assistant", please? I can't understand how to enter a formular. When I enter a formula, even the one suggested by Maple, and then click the "Proceed to Back-Solver" button, I always get an error message. Please help me!

how can i Roand my answers to 2 number after decimal point.

That is, Maple shows me only two digits after the decimal point. like this. 

with(LinearAlgebra);
K := evalf(Matrix(3, [1/3, -20/3, -20/3, 200/3, 70000/3, 4000/3, 1.44]), 6);
 

I was searching for an “uneval” command that returns an expression unevaluated (as Maple returns an output). In the attached example I am using eval which works in this instance since the integral is entered in an inert form.
 

Int(1/sqrt(x), x)

Int(1/x^(1/2), x)

(1)

(eval = value)(Int(1/x^(1/2), x))

Int(1/x^(1/2), x) = 2*x^(1/2)

(2)

NULL


Since the use of eval to obtain something unevaluated is somehow confusing (and might not work in all instances): Is there a better way than to use eval?

Download expr_equals_evalexpr.mw

Maple (2015) fails to instanciate a Matrix with a list of elements of type string
(for instance Matrix(2, 2, ["A", "B", "C", "D"]) )

Matrix(2$2, [1$4]):    # ok
Matrix(2$2, [A$4]):    # ok

Matrix(2$2, ["A"$4]);  # not correctly understood by Maple (2015) 
Error, (in Matrix) initializer defines more columns (4) than column dimension parameter specifies (2)

Is this a bug?
Maybe something corrected in earlier versions?

Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking. see  https://en.wikipedia.org/wiki/Depth-first_search 

Here I write a  DFS function in maple  language according to the principle of  BFS algorithm.  

Pseudo codes:

procedure DFS_iterative(G, v) is
    let S be a stack
    S.push(v)
    while S is not empty do
        v = S.pop()
        if v is not labeled as discovered then
            label v as discovered
            for all edges from v to w in G.adjacentEdges(v) do 
                S.push(w)

Maple DFS codes:

DFS:=proc(g::Graph,x)
local  s,seen,vertex,nodes,w,vertexlist;
s := stack[new]():
stack[push](x, s):
seen :=[x]:
vertexlist:= []:
while not stack[empty](s) do
      vertex:=stack[pop](s):
      vertexlist:= [op(vertexlist),vertex]:
      nodes:= Neighborhood(g, vertex):
      for w in nodes do
            if not evalb(w in seen) then:
                stack[push](w, s):
                seen :=[op(seen),w]:
            end if:
      end do:  
end do:
return  vertexlist
end proc:
with(GraphTheory):with(SpecialGraphs):
P := PetersenGraph():
DrawGraph(P);
DFS(P,1)

[1, 6, 10, 9, 8, 4, 3, 7, 5, 2]

The result of a depth-first search of a graph can be conveniently described in terms of a spanning tree of the vertices reached during the search.

But I haven't figured out how to improve the  above codes to get this DFS spanning tree.

 

PS: The stack seems to be deprecated in maple2021.

As another way to search BFS algorithm, Carl Love  provided an example of the application of BFS algorithm. 

I also wrote a BFS code implementation based on the queue as follows.

BFS:=proc(g::Graph,x)
local  s,seen,vertex,nodes,w,vertexlist;
s:= SimpleQueue():
s:-enqueue(x):
seen :=[x]:
vertexlist:= []:
while not s:-empty() do
      vertex:=s:-dequeue():
      vertexlist:= [op(vertexlist),vertex]:
      nodes:= Neighborhood(g, vertex):
      for w in nodes do
            if not evalb(w in seen) then:
                s:-enqueue(w):
                seen :=[op(seen),w]:
            end if:
      end do:  
end do:
return  vertexlist
end proc:
BFS(P,1)

[1, 2, 5, 6, 3, 9, 4, 8, 7, 10]

 

Hello, which operator should I use instead of ":=" (assignment statement) so that the graph H remains unchanged in the code below?

with(GraphTheory);
G := CompleteGraph(4);
DrawGraph(G);
H := G;
DeleteEdge(G, {1, 2}, inplace = true);
DrawGraph(G);
DrawGraph(H);

First 43 44 45 46 47 48 49 Last Page 45 of 2132