Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Dear,

I would like to do equation of motion calculations using spin matrices.

I would like to do calculations using the  coupling.

Thanks for listening.

Given a vector-valued function z(u,v), I want to calculate the derivative of z with respect to its first argument by applying the D operator to it. I don't see how.  Any suggestions?

restart;

z := (u,v) -> < a(u,v), b(u,v) >;

proc (u, v) options operator, arrow; `<,>`(a(u, v), b(u, v)) end proc

Calculate the derivative of z with respect to its first argument:

P := diff(z(u,v), u);

Vector(2, {(1) = diff(a(u, v), u), (2) = diff(b(u, v), u)})

Express P through the D operator:

Q := convert(P, D);

Vector(2, {(1) = (D[1](a))(u, v), (2) = (D[1](b))(u, v)})

Question:  How do we obtain Q directly by applying the D operator to z

without the help of diff?  This one doesn't work:

D[1](z)(u,v);
type(%, Vector);

(D[1](`<,>`))(a(u, v), b(u, v))*(D[1](a))(u, v)+(D[2](`<,>`))(a(u, v), b(u, v))*(D[1](b))(u, v)

false

Download diff.mw

restart;
with(Physics[Vectors]);
Setup(mathematicalnotation = true);
with(Physics);

Setup(op = {Omega, r});

lprint(m*Omega^2*r);

which outputs this:

i want to substitute  Physics:-`*` which is an overloaded version of matrice multiplication with the default one which is `.` so I wrote the following code :

use   `*`= :-`.` in
a := m*Omega^2*r
end use

the result is the same and its not substitute the physics product with the default one. what is the mistake here?

I also tried the following code and its worked. but I want to make it work with the 'use' function for general purposes

lprint(m . (:-`.`(Omega^2, r)))

thanks in advance

How do I draw this polyhedron knowing all vertices?
https://artofproblemsolving.com/wiki/index.php/2022_AMC_10A_Problems/Problem_21?fbclid=IwAR2bdHwJEpjarZEwope1hYOcnnXqnvzae38Y8ZrfWKCKQunfAuT9s30q32o

[[-1.5, -0.5, 0.], [-1.5, 0.5, 0.], [-1., -1., -0.707107], [-1., 1., -0.707107], [-0.5, -1.5, 0.], [-0.5, -0.5, -1.41421], [-0.5, 0.5, -1.41421], [-0.5, 1.5, 0.], [0.5, -1.5, 0.], [0.5, -0.5, -1.41421], [0.5, 0.5, -1.41421], [0.5, 1.5, 0.], [1., -1., -0.707107], [1., 1., -0.707107], [1.5, -0.5, 0.], [1.5, 0.5, 0.]]

 

I want to write a program in differential geometry that get g as a metric matrix then calculate christoffel.

Thank you for your consideration.

I'm trying to use Maple to take the following integral for positive values of a, b, c and non-negative integers i and j.

I know that for fixed values of j and k this doable — for example, for j=k=0 Mathematica gives

I'm trying the following code in Maple:

int(exp(-(x + y)/2)/(a*x + b*y + c), [x = 0 .. infinity, y = 0 .. infinity]) assuming (a::real, 0 < a, b::real, 0 < b, c::real, 0 < c)

Am I doing anything wrong?

This is probably trivial but I can't find how to display and allow user input of numeric values in a table.  There doesn't appear to be a component for this and I can't find a way to make text areas work for numeric values.  I am sure I must be overlooking something very simple but I checked the documentation and googled and still can't find the answer.

Hi dears

I have a pde system and want to get the solution of this system step by step. is there any command or bunch of commands that could help me?

(pde = partial differential equations)

My document contained an inline plot component named Plot0 and was referenced in the following code

DocumentTools:-SetProperty("Plot0", value, calculatePlot())

This worked as expected. I selected and cut the plot and pasted it into a cell in a table.  Now the same line of code generates this error

Error, (in DocumentTools:-GetProperty) Attempted to retrieve property of unknown component Plot0.

The plot has presumably changed name but I can't find its new name.  I have tried changing the code to refer to Plot1 instead of Plot0 but the error persists.  I am completely mystified.

Maple 2022.2 on windows 10. I found another serious problem with timelimit. When changing the timelimit value, solve hangs.

i.e. timelimit do not timeout.  But that is not all. Unable to terminate the process running the worksheet. Clicking on the little ! circle at the top does nothing.  But that is not all. Killing the server.exe from the task manager, now I am not even able to close the worksheet. Maple hangs on closing the worksheet.

This code below on  my PC produces this. I used 60 seconds to make it hang. When using 10 seconds it does not hang. You might have to change these values depending on how fast/slow your PC is. If it does not hang for you using 60, you might to try 100 and so on.

Why does it hang so bad? This really makes using Maple for development not practical if one can't even put a timeout on an operation like this. What is a user to do?  Not use solve? reduce the timelimit to avoid maple lockin? To what value? If I reduce all timelimits to 5 seconds, this will cause problems as I could lose solutions that will show up with more time.

Anyone else can produce this? Make sure to save all your work before because you might not be able to close the worksheet after this.  I use worksheet mode only.
 

interface(version);

restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):

eq:=1/24*ln(9*u + 2) + 1/8*ln(u) - 1/24*ln(3*sqrt(4*u + 1) + 1) - 1/8*ln(sqrt(4*u + 1) - 1) + 1/24*ln(3*sqrt(4*u + 1) - 1) + 1/8*ln(sqrt(4*u + 1) + 1) - 1/2*ln(x) - c[1] = 0;

try
   the_sol := timelimit(60,[solve(eq,u)]);
   print("finished before timeout");
  catch:
    print("Timed out OK");
end try;

 


 

Download solve_hangs_different_timing_dec_23_2022.mw

To get optimum value (maximum) of 3 variable p, q and w. Where p and q are from the function E1(p,q) and w from the function M1(p,q). The algorithm to obtain the optimum value is described below:-
step 1: Initialize w = c = 20

step2: Evaluate E1(p,q) by substituting w in it.

step3: Find optimum value of p and q from function E1(p,q) using NLPsolve or any other optimiztion method.

step 4: Substitute q optimum value into function M1(p,q) and evaluate it.

step 5: find optimum value of w from optimizing function M1(p,q).

step 6: substitute optimum value of w to E1(p,q) and evaluate it.

step 7: do step 3

step 8: do step 5 and 6

step 9: stop the loop when (w final - w previous) <0.05

I have done this through NLPsolve but it is showing error "Error, (in int) integration range or variable must be specified in the second argument, got 5000 = -3500 .. 1500*p+q-100000"

I am attaching the worksheet below. Please see the numerical analysis part below in the sheet. maple_question.mw

Is there a command to generate a second-difference matrix of size n by n?

This matrix has 2s on its main diagonal and -1 above and below each main diagonal element.

I currently have a document in which controls and a plot are displayed "inline".  I need more controls and more control over where they appear.  Ideally I need my code to display a window in which the controls are laid out and in which the plot can be displayed.  Is this possible with Maple (I know it can be done with other products)?

This is really a question on getting index positions of a sub list from the main list.

Have a list of Vertices and a list of populations for each vertes.

Then from the Neighbours list I need the respective positions in the Vertex list to sum to corresponding values from the population list.

2nd Question  Can the population values be displayed near its vertex or in the vertes circle? e.g y=5

restart

NULL

with(GraphTheory)

with(SpecialGraphs)

Vs := [x, y, z, w]

[x, y, z, w]

Popvs := [-2, 1, 6, 3]

[-2, 1, 6, 3]

newPopsvs := Popvs

[-2, 1, 6, 3]

``

X := Graph(Vs)

GRAPHLN(undirected, unweighted, [x, y, z, w], Array(1..4, {(1) = {}, (2) = {}, (3) = {}, (4) = {}}), `GRAPHLN/table/1`, 0)

``

AddEdge(X, {{w, y}, {w, z}, {x, y}, {y, z}})

GRAPHLN(undirected, unweighted, [x, y, z, w], Array(1..4, {(1) = {2}, (2) = {1, 3, 4}, (3) = {2, 4}, (4) = {2, 3}}), `GRAPHLN/table/1`, 0)

Nbs := [seq(Neighbors(X, Vs[i]), i = 1 .. nops(Vs))]

[[y], [x, z, w], [y, w], [y, z]]

``

vp := [[0, 0], [1, 0], [1.5, 1], [2, 0]]

[[0, 0], [1, 0], [1.5, 1], [2, 0]]

SetVertexPositions(X, vp)

DrawGraph(X)

k := rand(1 .. 4)

NULL

for c to nops(Nbs) do Nbs[c]; select(proc (i) options operator, arrow; Vs[i] = Nbs[c, 1 .. -1] end proc, [`$`(1 .. nops(Vs))]) end do

[]

NULL

Download Q_23-12-22_Test_Graph_indices_.mw

with(ImageTools);
U1 := Read("C:/Users/S/Desktop/StarPicture.jpg"):

ttt0 := textplot([0 + 0.5, (5 + 0) - 0.5, " Star ", color = "blue", font = ["times", "roman", "bold", 40]]):
display(ttt0, U1, axes = none, size = [400, 160]);

This is the error I get:

Error, (in plots:-display) cannot display array with other plots

I can see Maple doesn't allow adding images to plots. But is there a way around that?

I want to be able to virtually have a white box that I can add plots to such as curves, text, and images at certain locations etc? I want to do that with actual Maple code in the worksheet, without having to mouse-clicking Menu, insert, etc.

Thanks

First 126 127 128 129 130 131 132 Last Page 128 of 2097