Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Dear Users! Hope everything fine here. For any vales of M and N I generated the system of equation.

for j from 2 while j <= N do
for i while i <= M do

omega[2]*(2-b[1])*u[i, j]+(2*b[1]*omega[2]-b[2]*omega[2]-omega[2]+1)*u[i, j-1]-omega[2]*(sum((b[l+2]-2*b[l+1]+b[l])*u[i, j-l-1], l = 1 .. j-2))
end do end do

But I want to convert it into matrix for example if N = 3 and M = 4, I need the following form

I am waiting for your response.

Hello everyone !,


I would like to generate two random complex vectors (x1 and x2) several time and I want to check how these two vectors (j iteration) close to their previous values (j-1 iteration): abs (x1(j)-x1(j-1)) < 10^-4 and abs (x2(j)-x2(j-1)) < 10^-4. Therefore, I want that my program stop when this criteria is satisfied for x1 and x2 simultaneously.

I know how to check that for one element of the vector but not all the elements of the vector.
code:
Comp.vect.mw

Quantum Mechanics for Chemistry

J. F. Ogilvie

 

            This interactive electronic textbook, freely available from the Maple Application Centre [https://www.maplesoft.com/applications/view.aspx?SID=154768] in the form of three Maple worksheets comprises three extensive chapters, on model systems, atoms and molecules in turn.  As quantum mechanics is neither a chemical theory nor even a physical theory but a collection of methods, numbering at least thirteen, or algorithms, for calculations on systems of an atomic scale, it is appropriate that computer software combining both strong arithmetical and symbolic capabilities, i.e. Maple, be applied to implement this material.  The book includes calculations involving five of the known methods, and provides many examples and exercises for a reader to enhance understanding of the principles and practice. For the first and third chapters, a readable text as .pdf is also provided but the extent of the second chapter precludes this possibility.

            The objective of this textbook is to demonstrate how the principles of the varied methods become implemented in practical calculations. The chapter on model systems includes treatments of several oscillators that might serve as prototypical of features of diatomic molecules.  The chapter on atoms includes the most extensive treatment available on solutions of Schroedinger's equation for the hydrogen atom, in all four systems of coordinates in which the variables are separable, and also in momentum space.  The chapter on molecules includes an introduction to transparent quantum-chemical calculations, which enables a reader to understand each stage of a calculation on a simple atomic or molecular system leading to a self-consistent field and even to Moeller-Plesset perturbation theory of second order and application of density functionals, which can provide an excellent basis for a subsequent use of opaque numerical programs for calculation of molecular structures and properties.

            This textbook contains, with permission, contributions from several eminent chemists, mathematicians and physicists, acknowledged in the particular locations, that complement the explanatory descriptive text as a profound introduction to quantum mechanics in a context of chemical education.

Hi!

I see that from Maple 2018 there is a command to compute the so called Radial Basis Function Interpolation:

https://www.maplesoft.com/support/help/Maple/view.aspx?path=Interpolation%2FRadialBasisFunctionInterpolation

I am trying to implement that code in Maple 2015, but it returns the error

Error, (in h) bad index into Vector

Displaying the vectors computed with the procedure, they seem correct, but the function that I want to return seems to fail (it is a summatory).

Attached the maple file

RBF_Interpolation.mw

I will appreciate any suggestion. Many thanks in advance for your comments!

BR,

GGM

 How to insert legends in the surfdata?

plots:-surfdata({Mat1}, ll1 .. ul1, ll2 .. ul2, dimension = 2, colorscheme = ["Blue", "Green", "Yellow", "Red"], axes = boxed, axesfont = [TIMES, BOLD, 16], axis = [thickness = 2], labelfont = [TIMES, BOLD, 16], labels = ["R", "Ma"])

 

 

 

 

Now I have a Matrix say  

 

Now I have another matrix say 

Now my second matrix has to be appended below the previous matrix the number of coulmns will the same in each case.

Again if create a new matrix I will ask it to append below the already appended new matrix and so on 

 

and lastly I want to export the matrix to excel.

 

 

If someone can help your work will be 100% acknowledged

 

I alpologize for any inconvince caused kind help

Dear, I am a newby using Maple and encounter following issue: when I multiply a vector with 2 elements and units [m] with e.g. 6 [m] using the *~ for an element by element multiplication this works as it should. However, when I try to multiply a vector with 2 elements and units [mA] and multiply this in the same way as above with 14 [V] I get as answer 2 results with a correct multiplication but followed by V mA. First I would expect [W] as unit but the V mA in the result vector are apparently no units. What am I doing wrong?

Thank you for any help.

PlaneDual returns the plane dual of a planar graph G, that is, a graph with faces of G as its vertices in which two vertices are adjacent if and only if they share an edge as faces of G. Of course, this is a little different from the standard definition of plane dual. (Interlude: I estimate that the two definitions are equivalent in the case that the planar graph is 3-connected simple graph)

It's not hard to find a plane dual of a planar graph in Maple. 

g:=Graph({{1,2},{2,4},{3,4},{2,3},{1,3},{1,4},{4,5},{2,5},{1,5}});
DrawPlanar(g);

dual_g:=PlaneDual(g);
DrawPlanar(
dual_g)

Since all labels of the dual graph are used numbers 1..n in maple, I cannot see how its vertices correspond to the face of the original graph.  And further, I want to know one edge of the dual graph corresponds to which edge (should be the boundary on two faces) of the original planar graph.

Maybe input {1,4} of the dual graph and output {2,4} of the original graph.

For example, Input {1} that is a vertex of  dual graph  to get the original face {2,3,4} and if we input {1,4} of the dual graph, we will output edge {2,4} of the original graph.

I don't know if there's a good way to do that.

 

 

Hi! I was wondering about drawing phase plane for differential system with some conditions. For example how can we draw this for:

 

restart;
with(plots);
with(DEtools);

ode := piecewise(1 < abs(x(t)), diff(x(t), t $ 2) - 2 = 0, abs(x(t)) < 1, diff(x(t), t $ 2) = 0);
????????????

I wanted something similar to that:

DEplot({diff(x(t), t) = y(t), diff(y(t), t) = 8*x(t)*y(t)}, [x(t), y(t)], t = -2 .. 2, x = -1 .. 1, y = -4 .. 4);

or this:

ode1 := diff(x(t), t $ 2) + 2*diff(x(t), t) = 0

DEplot(ode1, x(t), t = -2 .. 10, [[x(1) = 0.2, D(x)(1) = -1.4]]);

Edit:

I rewrite that to make integral curves and this phase plot should look similar to this:


 

Hi! I know that length of blue line and red line equal: Pi/4 and Pi*sin(Pi/8)/4 so from spherical pythagorem theorem green line should equals cos(Pi/4)*cos(Pi*sin(Pi/8)/4) but when I calculate this from formula for length of parametric curve I got something like this (I have just emphasized):

restart;
with(plots);
assume(t, real);
K := plot3d(1, theta = 0 .. 2*Pi, phi = 0 .. Pi, coords = spherical);
S2 := display(spacecurve([cos(t)*sin(t + Pi/8), sin(t + Pi/8)*sin(t), cos(t + Pi/8)], t = 0 .. Pi/4, thickness = 3, color = green)):

int(sqrt(<diff(cos(t)*sin(t + Pi/8), t), diff(sin(t + Pi/8)*sin(t), t), diff(cos(t + Pi/8), t)> . <diff(cos(t)*sin(t + Pi/8), t), diff(sin(t + Pi/8)*sin(t), t), diff(cos(t + Pi/8), t)>), t = 0 .. Pi/4)

-sqrt(2 - sqrt(2))*sqrt(2 + sqrt(2))*sqrt(2)*EllipticE(I/2*sqrt(2 - sqrt(2)), I)*I/2 + sqrt(2 - sqrt(2))*sqrt(2 + sqrt(2))*sqrt(2)*EllipticF(I/2*sqrt(2 - sqrt(2)), I)*I + EllipticE(I/2*sqrt(2 + sqrt(2)), I)*I - 2*I*EllipticF(I/2*sqrt(2 + sqrt(2)), I)

evalf(%)

0.959458136 + 0.*I

evalf(cos(Pi/4)*cos(Pi*sin(Pi/8)/4))

0.6754080210

I am not sure is Maple calculation wrong or I have missed something important?

restart;
Here is my pde and a procedure that plots the solution.
K1:=proc(g)
uses PDEtools,plots:
local pde, ic,ans;
pde:=-4*x*diff(f(u,x),u,x)+4*diff(f(u,x),u)=x^4*diff(f(u,x),x,x)+x^3*diff(f(u,x),x)+8*x^2*f(u,x)*(1-f(u,x)^2);
ic:={f(u,0) = 1, f(u,1) = 0,f(0,x)=g};
ans:=pdsolve(pde,ic,numeric,compile=true,time=u,range=0..1,'spacestep'=0.005);
ans:-plot(u=3)
end proc:
K1(1+x^2-2*x^3);

It works just fine; I get a plot of f(u,x) for u =3.  (Note that unlike dsolve there is no complaint about the global variable g in the initial conditions.)
Now I want to see a plot of diff(f(u,x) for u=3.
K2:=proc(g)
uses PDEtools,plots:
local pde, ic,ans;
pde:=-4*x*diff(f(u,x),u,x)+4*diff(f(u,x),u)=x^4*diff(f(u,x),x,x)+x^3*diff(f(u,x),x)+8*x^2*f(u,x)*(1-f(u,x)^2);
ic:={f(u,0) = 1, f(u,1) = 0,f(0,x)=g};
ans:=pdsolve(pde,ic,numeric,compile=true,time=u,range=0..1,'spacestep'=0.005);
ans:-plot([diff(f(u,x),x,u),color=cyan],u=3)
end proc:
K2(1+x^2-2*x^3);

That does not work.

I try to introduce a new variable h(u,x) = diff(f(u,x),x) so that I can plot h(u,x).
K3:=proc(g)
uses PDEtools,plots:
local pde, ic,ans;
pde:={h(u,x)=diff(f(u,x),x),
-4*x*diff(h(u,x),u)+4*diff(f(u,x),u)=x^4*diff(h(u,x),x)+x^3*h(u,x)+8*x^2*f(u,x)*(1-f(u,x)^2)};
ic:={f(u,0) = 1,f(u,1) = 0,f(0,x)=g};
ans:=pdsolve(pde,ic,numeric,compile=true,time=u,range=0..1,'spacestep'=0.005);
ans:-plot(h(u,x),u=3)
end proc:

K3(1-x^2);
Error, (in pdsolve/numeric/par_hyp) Incorrect number of initial conditions, expected 2, got 1

I have no idea what Maple is referring to; there are 3 initial conditions, not 1 or 2.

Anybody know what is going on? Any idea how to get what I need?

One more comment. I have never knowingly used a module in all the years I have been using and teaching Maple. I am sure there are good reasons for the construct but I think it would be difficult to teach. For ode's the result of dsolve is a procedure and it is relatively easy to teach because procedures are the bread and butter of using Maple. Why does pdsolve return a module?  I spent a good deal of time figuring out the use of pdsolve and would not like to force my students to do the same. I get them up to speed solving ode's using dsolve and DETools in a one hour lab. I wonder how much time it would take to do pdsolve.

 

Hello there, 

Would you allow me to a question regarding the correct way of using 'alias?

In the attached worksheet, an alias is defined, then a. the defined alias is not working (please have a look at the line with the same comment), b. the alias works in the other way around (please have a look at the line with the corresponding comment, Alias is working backward). When I tried to substitute the function with the 'subs' command (please have a look at the expression 'Desired'), then I was able to get the result, expected from alias command. 

Perhaps, I am confused with how the 'alias' command works. I would appreciate it if the correct way is explained. 

Thank you, 

In Kwon Park 

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Q20210724.mw .
 

Download Q20210724.mw

 

Hello everyone,

I am presently carrying out some computation of which I intend to solve some equations and get the preceeding values. But it would appear that my maple software just keeps showing evaluating without actually producing any results for hours even days. Is this due to my low laptop specs? 

I would love if the community can take a look at the code, and possibly run it to see if it's ok. I have attached the code for reference. 

Thank you.

 


test.mw

 

Hi,

    here a problem when i solve equations.i guess solve lost a root.how can i do.


An_unexpected_solve_bug_.pdf
Download An_unexpected_solve_bug_.mw

I'm having an issue with MacOS Big Sur 11.4 recognizing a package from saved documents. The package works great from new documents! 

Specifically: 
I've followed the instructions on 
https://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet/reference/initialization
to add  a .mapleinit
file to my user home directory under MacOS Big Sur 11.4

The .mapleinit file has code as follows to run the VLA package: 
VLAlibpath := "/VLA/library/":
libname := `VLAlibpath`, libname:
and I have the VLA package files with the library inside of it in my home directory too. 

When I open a new Maple document and run and use the package, it works just fine! 

The problem though is that if I save the Maple file and reopen it, it will no longer recognizes the package. I get: 
Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received VLA

It is very odd since the file still recognizes the libname just fine:
libname;   "VLA/library/", "/Library/Frameworks/Maple.framework/Versions/2021/lib"

The workaround is to copy and paste into a new document and start a fresh but that is obviously not ideal. 

Any ideas? It is a really really old package, but great for visualization.

Thanks,
Sarah

First 381 382 383 384 385 386 387 Last Page 383 of 2216