Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

  I want list all  diameter-2  Nonisomorphismgraphs  of order n . I use the following code, but its running speed  is slow with  order of graph gradually increasing . (for example,n=10)
 Are there other ways to Improve it? 
restart:
with(GraphTheory):
Graphs_data:=[NonIsomorphicGraphs(4,restrictto =[connected], output = graphs, outputform =graph)]:
Diameter_select:=select[flatten](t->Diameter(t)=2,Graphs_data):
DrawGraph(Diameter_select,size=[50,50]);

  By the way,  Why doesn't size=[50,50] work ?

 
                       
                   
               
               
           
           
               
                   
                 

  Hello: 
    As a first step to my question, let  G be  a graph and  I'd like to know  whether it contains a C4 (cycle of 4) as its subgraph.
     For example: .   It contains C4. So  program may be return true.  
    I'm most concerned about the following thing ( it is important problem for me, since in graph theory, we usually consider some class graphs contain no sepecific graph ) :
   1 Further , I want to  get all connected graphs of order less than 6  which  contains no C4 .
   2 More generally, I want  to konw  a graph  whether contains some graph as its subgraph.For example : does it contain K4CompleteGraph(4)K32  CompleteGraph(3, 2)  and so on ?
    I read the  function subgaph.  But  It didn't solve my problem. Many thanks for your help or advise.
   # I  just know there is a function  IsTriangleFree which test if graph is triangle-free ( graph comtains no C3 in Maple 2019. I think my question and how to program may be  meaningful.

Hi, 

Versions concerned:  [ Maple 2015 ... Maple 2018 ]

I use DocumentTools:-Tabulate to display a matrix of numbers while coloring them according to some condition.
(line DocumentTools:-Tabulate(M, color=((M,i,j)->`if`(M[i,j]>3,....) below ... please note the output is not loaded for some unknown reason).
The fact is that the matrix appears with black characters meaning 'color' doesn't work.

In a second attempt I convert matrix M into a matrix of strings and use now
DocumentTools:-Tabulate(S, color=((S,i,j)->`if`(parse(S[i,j])>3,...)
I get now the desired result with some blue and red numbers.

So converting to strings could be a workaround.
But think to matrices where elements would be algebraic expressions, for instance 
M := Matrix(2, 2, (i,j)->exp(x^i)+cos(x*j))
and that we use the coloring scheme is color=((M,i,j)->`if`(i+j>3, "Red", "Blue")
Converting M to a string matrix will display the element [2, 2] in red and the others in blue, but what you get then is a no longer a 2D pretty output but, literally, things like exp(x^2)+cos(x*2) 

The "convert to string" workaround is thus far from perfect.
Is the fact that 'color' only acts on strings a "normal and known" behaviour?
Is it possible to change the color of the font for non "string type matrices" ?
 

restart:

M :=Matrix(2, 2, (i,j)->i+j)

M := Matrix(2, 2, {(1, 1) = 2, (1, 2) = 3, (2, 1) = 3, (2, 2) = 4})

(1)

DocumentTools:-Tabulate(M, color=((M,i,j)->`if`(M[i,j]>3, "Red", "Blue")), width=30)

S :=convert~(M, string):
DocumentTools:-Tabulate(S, color=((S,i,j)->`if`(parse(S[i,j])>3, "Red", "Blue")), width=30)

 


 

Download Tabulate_Color.mw

Dear friends~

Recently I wanted to create some funny gif with Maple based on other interesting pictures but I met some problems:(1)I read many commands in ImageTools but few can aid me.(2)If I use “plot(,background=file_address)”,then the whole background will be filled with pictures but I just want it to be a part of my gif.I finally noticed that “plot3d(,image=file_address)”can realize my idea to some extents if I adjust orientation’s value  suitably.

However,I still think my operations can be improved(for example,my code consumes a fair amount of  memory) and there maybe one better approach to be good too. Hence I upload my code and sincerely look forward your suggestions and help~

#Janesefor do it in 2019/4/15 13:20 with Maple2018~
with(plots):
# smile.jpg's address
image_file:="C:/Users/ysl-pc/Desktop/":
str:="有","朋","自","远","方","来","不","亦","乐","乎","?":
location_func,dy,dz:=3*sin(2*3.14/10*y),.75,.75:

display(seq(display(textplot3d([0,1,4.5,cat(str[1..ha])],align='right'),textplot3d([0,3.5,-4.5,"By Janesefor ~"],align='right'),plot3d([0,s,t],subs(y=ha-1,[s=y-dy..y+dy,t=location_func-dz..location_func+dz])[],image=cat(image_file,"smile.jpg"),axes=none,scaling=constrained,orientation=[180,90,-180],view=[default,0..10,-5..5],glossiness=0,lightmodel=light4)),ha=[`$`(1..nops([str]))]),insequence=true);
Export(cat(image_file,"smile.gif"),%)


smile.mw

Dear Support

I am attempting to model quantum dynamics, and have defined a coupled set of nonlinear PDEs I would like to solve for coupled solutions u(x,y,t) and v(x,y,t) using MAPLE 18.

I attach an image of part of the worksheet the pair of PDEs...The initial conditions u(x,y,0), v(x,y,0) are a pair of respectively positive and negative 2D gaussians on the x,y, domain.

Before I go any further, please would you check that MAPLE 18 is in principle capable of finding solutions u(x,y,t), v(x,y,t) solutions, and let me know whether it is worth pursuing the solution?  I have had a look at the MAPLE documentation, but am not sure whether MAPLE can solve this system.

As a warm-up, I successfully solved a 1-D system u(x,t), v(x,t) using pdsolve[numeric], but I am not clear whether MAPLE 18 can solve for u(x,y,t), v(x,y,t) either numerically or analytically on the [x,y,t] domain.

I hope you can provide help/guidance. An image the equations in MAPLE is displayed here...

Melvin Brown

UK

I can  this equation.

CV.mw
 

restart; c__v := 1.2; `τ__q` := 8.5*10^(-12); `τ__T` := 90.0*10^(-12); rho := 1000; k := 10

1.2

 

0.8500000000e-11

 

0.9000000000e-10

(1)

k*(diff(T(x, t), x, x))+k*`τ__T`*(diff(T(x, t), t, x, x)) = rho*c__v*(diff(T(x, t), t))+(diff(T(x, t), t, t))*c__v*rho*`τ__q`+(1/2)*c__v*rho*`τ__q`^2*(diff(T(x, t), t, t, t))

10*(diff(diff(T(x, t), x), x))+0.9000000000e-9*(diff(diff(diff(T(x, t), t), x), x)) = 1200.0*(diff(T(x, t), t))+0.1020000000e-7*(diff(diff(T(x, t), t), t))+0.4335000000e-19*(diff(diff(diff(T(x, t), t), t), t))

(2)

Boundary condition:

T(0, t) = 300; T(10, t) = 300

#####################################

INITIAL CONDITIONS:

 

T(x, 0) = 300; (D[1](T))(x, 0) = 0, (D[2](T))(x, 0) = 0

(D[1](T))(x, 0) = 0, (D[2](T))(x, 0) = 0

(3)

``


 

Download CV.mw

 

 

Hi,

The help page TimeSeriesAnalysis, ExponentialSmoothingModel contains an error.
The command that generates the output (7) should be
esm2 := ExponentialSmoothingModel(seasonal={"A","M"},constraints=admissible)
instead of
esm2 := ExponentialSmoothingModel(seasonal={A,M},constraints=admissible)

PS : there is no tag relative to TimeSeriesAnalysys

 Hello!
  As we  known, in Graphtheory , a loop is an edge that joins a vertex to itself (for example  fig1 vertex1) and multiple edges (for example Fig2)are two or more edges that join the same two vertices.  But in Maple,  G := Graph({{a, b}, {a, c}, {b, c}}). The Edges(G) function returns a set  (not list )of the edges of G.  So, for example I can't create loop{1,1} by G:=Graph({{1,1},{1,2},{1,5},{2,5},{2,3},{5,4},{3,4},{4,6}})   . But in my research, I consider a graph which exist loops or multiple edges. I want to create  it  .How should I do?  Thanks in advance.

my code like this

with(GraphTheory):
G:=Graph({{1,2},{1,5},{2,5},{2,3},{5,4},{3,4},{4,6}}):
G:=Graph({{1,1},{1,2},{1,5},{2,5},{2,3},{5,4},{3,4},{4,6}}):DrawGraph(G,style=spring);
G2:=Graph({{1,2}}):
DrawGraph(G2);
G3:=Graph({{1,2},{1,2}}):
DrawGraph(G3);

 

How I can get integral by part.

I want to calculate these integral.

Thank you

integral_part.pdf

 

How I can take Laplace Transform from equation.

Thanks

LAPLACE

Right now I am going through Bishop's ML book and as a part of the first exercise I need to define a polynomial that goes like this.

y(x,w) = w_0 + w_1 * x + w_2 * x^2 ... + w_m * x^m = sum (k=0 to m) w_k * x^k

Here is how I've written it out in Maple.

f := proc (x, w) options operator, arrow; sum(w[k]*x^k, k = 0 .. nops(w)) end proc

Sorry for the raw code, Maple Math won't accept the code I've written as a valid Maple expression for some reason. When I try to use this I get an error that says too many levels of recursion.

f(2, [a, b, c]);
Error, (in limit/mrv/limsimpl) too many levels of recursion

Where am I going wrong here?
 

Please look at this codes!!!

i cant understand the idea of how maple works with parameters...

Problem.JPG

if u watch it exactly u can see that first maple understands that diff(a__1,t) is equall 1; but anfter that it couldnt load the value 1.
why?

what is hapening?

what can i do for this problem. its not the main code. i just send u an example of what  i want and what maple does. plz help me. tnx 

Hi,

When multiple request to DocumentTools:-Tabulate(...) are enclosed in the same group of commands (which typically happens when they are within a procedure), only the last one is displayed.
Is it possible to overcome this behaviour?

Thanks in advance

Hello, everyone: I have a question of drawing graph。
restart:
with(GraphTheory):
with(SpecialGraphs):
H := HypercubeGraph(3):
DrawGraph(H,
style = spring);


How  do I change  the vertex style   to polygon without line.
the aim graph  like figure below:

Thank you very much!

 

Greeting for all 

 , How to plot gyroid surface by Maple where its equation is 

                            

Amr

First 27 28 29 30 31 32 33 Last Page 29 of 61