Maple 2018 Questions and Posts

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

I need to find the intersection of 3 planes.

x+3*y-5*z=0
x+4*y-8*z=0
-2*x-7*y+13*z=0

I managed to get the intersection using LinearSolve but I keep getting an error when I try to plot out the planes using plot3d. What can I change in the commands for it to work?
 

with(LinearAlgebra)

[`&x`, Add, Adjoint, BackwardSubstitute, BandMatrix, Basis, BezoutMatrix, BidiagonalForm, BilinearForm, CARE, CharacteristicMatrix, CharacteristicPolynomial, Column, ColumnDimension, ColumnOperation, ColumnSpace, CompanionMatrix, CompressedSparseForm, ConditionNumber, ConstantMatrix, ConstantVector, Copy, CreatePermutation, CrossProduct, DARE, DeleteColumn, DeleteRow, Determinant, Diagonal, DiagonalMatrix, Dimension, Dimensions, DotProduct, EigenConditionNumbers, Eigenvalues, Eigenvectors, Equal, ForwardSubstitute, FrobeniusForm, FromCompressedSparseForm, FromSplitForm, GaussianElimination, GenerateEquations, GenerateMatrix, Generic, GetResultDataType, GetResultShape, GivensRotationMatrix, GramSchmidt, HankelMatrix, HermiteForm, HermitianTranspose, HessenbergForm, HilbertMatrix, HouseholderMatrix, IdentityMatrix, IntersectionBasis, IsDefinite, IsOrthogonal, IsSimilar, IsUnitary, JordanBlockMatrix, JordanForm, KroneckerProduct, LA_Main, LUDecomposition, LeastSquares, LinearSolve, LyapunovSolve, Map, Map2, MatrixAdd, MatrixExponential, MatrixFunction, MatrixInverse, MatrixMatrixMultiply, MatrixNorm, MatrixPower, MatrixScalarMultiply, MatrixVectorMultiply, MinimalPolynomial, Minor, Modular, Multiply, NoUserValue, Norm, Normalize, NullSpace, OuterProductMatrix, Permanent, Pivot, PopovForm, ProjectionMatrix, QRDecomposition, RandomMatrix, RandomVector, Rank, RationalCanonicalForm, ReducedRowEchelonForm, Row, RowDimension, RowOperation, RowSpace, ScalarMatrix, ScalarMultiply, ScalarVector, SchurForm, SingularValues, SmithForm, SplitForm, StronglyConnectedBlocks, SubMatrix, SubVector, SumBasis, SylvesterMatrix, SylvesterSolve, ToeplitzMatrix, Trace, Transpose, TridiagonalForm, UnitVector, VandermondeMatrix, VectorAdd, VectorAngle, VectorMatrixMultiply, VectorNorm, VectorScalarMultiply, ZeroMatrix, ZeroVector, Zip]

(1)

A := `<|>`(`<,>`(1, 1, -2), `<,>`(3, 4, -7), `<,>`(-5, -8, 13))

Matrix(%id = 18446745896624469046)

(2)

b := `<,>`(0, 0, 0)

Vector[column](%id = 18446745896624462294)

(3)

x := LinearSolve(A, b)

Vector[column](%id = 18446745896652349678)

(4)

P1 := x+3*y

P2 := x+4*y

P3 := -2*x-7*y

plot3d([P1, P2, P3], x = -8 .. 8, y = -20 .. 20, plotlist = true, color = [blue, red, green])

Error, (in plot3d) unexpected options: [(Vector(3, {(1) = -4*_t[3], (2) = 3*_t[3], (3) = _t[3]})) = -8 .. 8, y = -20 .. 20]

 

``


 

Download problem.mw

Here's how to break Maple's 'D' function:

~$ cmaple mapleBug.mpl
    |\^/|     Maple 2018 (X86 64 WINDOWS)
._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2018
 \  MAPLE  /  All rights reserved. Maple is a trademark of
 <____ ____>  Waterloo Maple Inc.
      |       Type ? for help.
> D[1]((x, y) ->x^2-y^2);
                                 (x, y) -> 2 x

> D[2]((x, y) ->x^2-y^2);
                                 (x, y) -> -2 y

> with(VectorCalculus):
> assume(x, 'real');
> assume(y, 'real');
> D[1]((x, y) ->x^2-y^2);
                                  (x, y) -> 0

> D[2]((x, y) ->x^2-y^2);
                                  (x, y) -> 0

> quit
memory used=2.4MB, alloc=8.3MB, time=0.06

~$

What if a person needs to have these lines:

> with(VectorCalculus):
> assume(x, 'real');
> assume(y, 'real');

and then he wants to take partial derivatives? Not possible? Once you load VectorCalculus and declare x and y real, Maple stops doing partial derivatives? Why.

Sorry,

I have been away from Maple for a year.
Then, when I used op command, I am puzzed to notice the results were different from those I know.

>op((x+5)^2*(x+y));
      _EXPSEQ((x+5)^2, x+y)

Result I know is 

        (x+5)^2, x+y

Has a modifire such as _EXPSEQ   automatically come to be attatched?
Or, can I have maple express it  in the form I know:  (x+5)^2, x+y?

Thank you in advance.

taro

 

 

 

 

 


 

Given the following functions and respective intervals graph them and determine all values of in the interval (a,b) such that

f'(c) =f(b)-f(a)/b-a (apply the Mean Value Theorem) 

 Question 1: f(x)=x^3-2*x      [0,2]

 Question 2 : g(x)= cuberoot(x-3)^2     [-3,4]

 

Please HELP!!! 

 

how I can write a program code for newmark method.

in this method time has 3 order derivation

 We know the following facts: 

The SequenceGraph command returns a graph with the specified degree sequence given as input, if such a graph exists. It raises an exception otherwise. 
 But  If I  want to get more graphs  that satisfy this condition of degree sequence ? (If graphs are not many ,I want get all graphs better)
what should I do.?
For example: DrawGraph(SequenceGraph([3, 2, 2, 1, 1, 1]));  It returns the first graph below, but it is obvious that the second graph also fits the condition.

squenceGraph.mw

Hello Dear,

I have the following equation

 This equation is satisfied if the coefficients are zero.

So I need an order in Maple to write that

 

 

Good morning everyone, 

I have a problem, when I try to evaluate the definite integral below, Maple can not provide a result. What can I do so that the Maple can calculate this integral?

This is the Maple code with the result:

 

 

restart

with(VectorCalculus):

with(LinearAlgebra):

with(CodeGeneration):

N := 1:

M := 2:

``

for i to N do rpv1 || i := 0; rpv2 || i := 0; rpv3 || i := 0; for j to M do rpv1 || i := VectorCalculus:-`+`(rpv1 || i, Typesetting:-delayDotProduct(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), Phi || i || j)); rpv2 || i := VectorCalculus:-`+`(rpv2 || i, Typesetting:-delayDotProduct(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), `&varphi;` || i || j)); rpv3 || i := VectorCalculus:-`+`(rpv3 || i, Typesetting:-delayDotProduct(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), gamma || i || j)) end do; rp || i := Matrix([[rpv1 || i], [rpv2 || i], [rpv3 || i]]) end do:

``

for i to N do rppv1 || i := 0; rppv2 || i := 0; rppv3 || i := 0; for j to M do rppv1 || i := VectorCalculus:-`+`(rppv1 || i, Typesetting:-delayDotProduct(diff(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), s), Phi || i || j)); rppv2 || i := VectorCalculus:-`+`(rppv2 || i, Typesetting:-delayDotProduct(diff(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), s), `&varphi;` || i || j)); rppv3 || i := VectorCalculus:-`+`(rppv3 || i, Typesetting:-delayDotProduct(diff(diff(VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^j, s), s), gamma || i || j)) end do; rpp || i := Matrix([[rppv1 || i], [rppv2 || i], [rppv3 || i]]) end do:

``

``

for i to N do for j from 0 to 0 do U || i || j := 0 end do end do:

for i to N do for j from 0 to 0 do V || i || j := 0 end do end do:

for i to N do for j from 0 to 0 do W || i || j := 0 end do end do:

for i to N do for j from 0 to VectorCalculus:-`+`(M, -2) do U || i || (VectorCalculus:-`+`(j, 1)) := VectorCalculus:-`+`(U || i || j, VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^VectorCalculus:-`+`(j, 1)) end do end do:

for i to N do for j from 0 to VectorCalculus:-`+`(M, -2) do V || i || (VectorCalculus:-`+`(j, 1)) := VectorCalculus:-`+`(V || i || j, VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^VectorCalculus:-`+`(j, 1)) end do end do:

for i to N do for j from 0 to VectorCalculus:-`+`(M, -2) do W || i || (VectorCalculus:-`+`(j, 1)) := VectorCalculus:-`+`(W || i || j, VectorCalculus:-`*`(VectorCalculus:-`+`(s, VectorCalculus:-`-`(xi || i)), 1/L || i)^VectorCalculus:-`+`(j, 1)) end do end do:

for i to N do f || i := VectorCalculus:-`+`(Typesetting:-delayDotProduct(VectorCalculus:-`*`(Typesetting:-delayDotProduct(E, A), 1/mu), VectorCalculus:-`+`(VectorCalculus:-`+`(rpp || i, VectorCalculus:-`-`(VectorCalculus:-`*`(rpp || i, 1/evalc(norm(Re(rp || i), 2))))), VectorCalculus:-`*`(Typesetting:-delayDotProduct(rp || i, Typesetting:-delayDotProduct(rp || i^%T, rpp || i)), 1/evalc(norm(Re(rp || i), 2))^3))), Typesetting:-delayDotProduct(g, e3)) end do:

for i to N do for j to VectorCalculus:-`+`(M, -1) do fun || i || j := int(VectorCalculus:-`*`(U || i || j, Row(f || i, 1)), s = xi || i .. L || i) end do end do;

fun11

(int((s-xi1)*(E*A*(2*Phi12/L1^2-2*Phi12/(sqrt((gamma11/L1+2*gamma12*s/L1^2-2*gamma12*xi1/L1^2)^2+(`&varphi;11`/L1+2*`&varphi;12`*s/L1^2-2*`&varphi;12`*xi1/L1^2)^2+(Phi11/L1+2*Phi12*s/L1^2-2*Phi12*xi1/L1^2)^2)*L1^2)+(Phi11/L1+(2*(s-xi1))*Phi12/L1^2)*((2*(Phi11/L1+(2*(s-xi1))*Phi12/L1^2))*Phi12/L1^2+(2*(`&varphi;11`/L1+(2*(s-xi1))*`&varphi;12`/L1^2))*`&varphi;12`/L1^2+(2*(gamma11/L1+(2*(s-xi1))*gamma12/L1^2))*gamma12/L1^2)/((gamma11/L1+2*gamma12*s/L1^2-2*gamma12*xi1/L1^2)^2+(`&varphi;11`/L1+2*`&varphi;12`*s/L1^2-2*`&varphi;12`*xi1/L1^2)^2+(Phi11/L1+2*Phi12*s/L1^2-2*Phi12*xi1/L1^2)^2)^(3/2))/mu+g*e3)/L1, s = xi1 .. L1))*e[x]

(1.1)

``

NULL

``


 

Download integral.mw

 

Thank you !

Hello,

What is the minimum period of the following equation.


 

d := evalf(expand((100+100*cos(6*t)+200*cos(12*sqrt(2)*t))^2))

40000.-2580480000.*cos(t)^2*cos(1.414213562*t)^6+604800000.*cos(t)^2*cos(1.414213562*t)^4-51840000.*cos(t)^2*cos(1.414213562*t)^2+2621440000.*cos(t)^6*cos(1.414213562*t)^12-7864320000.*cos(t)^6*cos(1.414213562*t)^10+8847360000.*cos(t)^6*cos(1.414213562*t)^8-4587520000.*cos(t)^6*cos(1.414213562*t)^6+1075200000.*cos(t)^6*cos(1.414213562*t)^4-92160000.*cos(t)^6*cos(1.414213562*t)^2-3932160000.*cos(t)^4*cos(1.414213562*t)^12+0.1179648000e11*cos(t)^4*cos(1.414213562*t)^10-0.1327104000e11*cos(t)^4*cos(1.414213562*t)^8+6881280000.*cos(t)^4*cos(1.414213562*t)^6-1612800000.*cos(t)^4*cos(1.414213562*t)^4+138240000.*cos(t)^4*cos(1.414213562*t)^2+1474560000.*cos(t)^2*cos(1.414213562*t)^12-4423680000.*cos(t)^2*cos(1.414213562*t)^10+4976640000.*cos(t)^2*cos(1.414213562*t)^8+720000.*cos(t)^2+274560000.*cos(1.414213562*t)^4-5125120000.*cos(1.414213562*t)^6+0.4942080000e11*cos(1.414213562*t)^8-0.2811494400e12*cos(1.414213562*t)^10+0.1013841920e13*cos(1.414213562*t)^12+0.1677721600e12*cos(1.414213562*t)^24-0.1006632960e13*cos(1.414213562*t)^22+0.2642411520e13*cos(1.414213562*t)^20-0.3984588800e13*cos(1.414213562*t)^18+0.3810263040e13*cos(1.414213562*t)^16-0.2406481920e13*cos(1.414213562*t)^14-5760000.*cos(1.414213562*t)^2+10240000.*cos(t)^12-30720000.*cos(t)^10+34560000.*cos(t)^8+1320000.*cos(t)^4-16000000.*cos(t)^6

(1)

``


 

Download period

 

 

  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; `&tau;__q` := 8.5*10^(-12); `&tau;__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*`&tau;__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*`&tau;__q`+(1/2)*c__v*rho*`&tau;__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

 

 

First 28 29 30 31 32 33 34 Last Page 30 of 62