Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

How do you apply colors to an entire solid of revolution? I can't seem to color the bases of a disk. Please help.

Here is what I have. I would like the entire solid to be the same color,transparency,etc.

v := VolumeOfRevolution(4, x = 1 .. 2, volumeoptions = [color = blue, transparency = 0.6], orientation = [270, 0, 15], view = [0 .. 3, -5 .. 5, -5 .. 5], labels = [x, y, z], output = plot, axis = horizontal, scaling = constrained)

I'd like to print a high res and quality worksheet but maple has very poor printing.

 I'd like to change the font so I can print more text. I'd like to change the dpi of the print to get higher quality.

Right now I'm having to print screen then scale in photoshop just to get a halfway decent print. I don't want pages of wrapped text that is very confusing to view. If I zoom out all the way on the worksheet I can almost get what I want as far as the size and wrapping(I want to avoid wrapping and there seems to be no way to turn this "feature" off). Of course when I zoom out and use print screen the quality is extremely low due to resolution issues. [So "zooming out" let's me stuff most of the data in to view that I want but then when I use print screen to capture it the quality is so low as not to be useable due to the dpi issue. Of course if I use any of maples printing "features" it will ignore the zoom scaling so as to be useless]

The only thing I can see on how to solve this issue is to save to latex and modify the latex. The problem is that maple puts a lot of junk formatting in the latex to make the wrapping look the same which is exactly what I do not want.

Maple has a "copy as image" but this doesn't seem to do anything. The printing of Maple really needs to be worked on. It's so limited to be almost useless.

Why solutions (5) and (6) are different? The solution (5) is obtained by putting f=0 of the series, while (6) is the result by taking limit at f->0. 

check.mw

I want to know if it is possible to use the declare command from the PDETools package for a function

f(x,y,z)

and still, having the notation $\frac{\partial f}{\partial x}$ instead of $f_x$ for the Maple command %diff(f(x,y,z),x)

Thanks !

Kevin

recurssion.mw

NULL

"f(x,t) :=(|Psi|)^(2)"

proc (x, t) options operator, arrow, function_assign; abs(Psi)^2 end proc

(1)

" a(t):=piecewise(0<= t<=1,1.5*t,1<= t<=2,1.5*(2-t))"

proc (t) options operator, arrow, function_assign; piecewise(0 <= t and t <= 1, 1.5*t, 1 <= t and t <= 2, 1.5*(2-t)) end proc

(2)

" y[a](t):=piecewise(0<= t<=0.1,a(t),0.1<= t<=0.2,-a(t))"

proc (t) options operator, arrow, function_assign; piecewise(0 <= t and t <= .1, a(t), .1 <= t and t <= .2, -a(t)) end proc

(3)

"y(t):=y[a](t)+mu(t)"

proc (t) options operator, arrow, function_assign; y[a](t)+mu(t) end proc

(4)

"w(t):=&int;x(t)*f(x,t) &DifferentialD;x"

proc (t) options operator, arrow, function_assign; int(x(t)*f(x, t), x) end proc

(5)

" v(t):=y(t)-w(t)*w(t)"

proc (t) options operator, arrow, function_assign; y(t)-w(t)^2 end proc

(6)

NULL

diff(K(x, t), t) = beta*v(t)*f(x, t)

Error, (in y[a]) too many levels of recursion

 

"map(int, , t)"

Error, invalid function arguments

"map(int,,t)"

 

NULL

Here psi is a general wave function from schrodinger wave equation.

Download recurssion.mw

The problem comes from the link https://www.mapleprimes.com/questions/234398-Convert-Maple-Code-To-Python-#comment287424.

We know that when we compile a C or C ++ function, it generates an executable file.  Then we are free from source code.  For example. the function below returns a square matrix A where    "A[i, j]" is the distance from vertex i to vertex j in the graph G. My computer system is Windows.

// C Program for Floyd Warshall Algorithm
#include <stdio.h>

// Number of vertices in the graph
#define V 4

/* Define Infinite as a large enough
  value. This value will be used
  for vertices not connected to each other */
#define INF 99999

// A function to print the solution matrix
void printSolution(int dist[][V]);

// Solves the all-pairs shortest path
// problem using Floyd Warshall algorithm
void floydWarshall (int graph[][V]) {
    /* dist[][] will be the output matrix
      that will finally have the shortest
      distances between every pair of vertices */
    int dist[V][V], i, j, k;

    /* Initialize the solution matrix
      same as input graph matrix. Or
       we can say the initial values of
       shortest distances are based
       on shortest paths considering no
       intermediate vertex. */
    for (i = 0; i < V; i++)
        for (j = 0; j < V; j++)
            dist[i][j] = graph[i][j];

    /* Add all vertices one by one to
      the set of intermediate vertices.
      ---> Before start of an iteration, we
      have shortest distances between all
      pairs of vertices such that the shortest
      distances consider only the
      vertices in set {0, 1, 2, .. k-1} as
      intermediate vertices.
      ----> After the end of an iteration,
      vertex no. k is added to the set of
      intermediate vertices and the set
      becomes {0, 1, 2, .. k} */
    for (k = 0; k < V; k++) {
        // Pick all vertices as source one by one
        for (i = 0; i < V; i++) {
            // Pick all vertices as destination for the
            // above picked source
            for (j = 0; j < V; j++) {
                // If vertex k is on the shortest path from
                // i to j, then update the value of dist[i][j]
                if (dist[i][k] + dist[k][j] < dist[i][j])
                    dist[i][j] = dist[i][k] + dist[k][j];
            }
        }
    }

    // Print the shortest distance matrix
    printSolution(dist);
}

/* A utility function to print solution */
void printSolution(int dist[][V]) {
    printf ("The following matrix shows the shortest distances"
            " between every pair of vertices \n");
    for (int i = 0; i < V; i++) {
        for (int j = 0; j < V; j++) {
            if (dist[i][j] == INF)
                printf("%7s", "INF");
            else
                printf ("%7d", dist[i][j]);
        }
        printf("\n");
    }
}

// driver program to test above function
int main() {
    /* Let us create the following weighted graph
            10
       (0)------->(3)
        |         /|\
      5 |          |
        |          | 1
       \|/         |
       (1)------->(2)
            3           */
    int graph[V][V] = { {0,   5,  INF, 10},
        {INF, 0,   3, INF},
        {INF, INF, 0,   1},
        {INF, INF, INF, 0}
    };

    // Print the solution
    floydWarshall(graph);
    return 0;
}

 

The above functions will be packaged as the disall.exe , and then we will move them anywhere in my computer and run it in Powershell.  We don't have to deal with the source code unless we want to change it.

I mean can Maple do something like that?

with(GraphTheory);
G := Graph([1, 2, 3, 4, 5], {{1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 3}, {2, 5}, {3, 4}, {4, 5}});
AllPairsDistance(G);

For exmaple, can I package the above code snippet into an exe file?

hallo evert body please how i do calculate this integral

in maple 18

ttp.pdf

int_{0}^{2\pi}(\cos^{i}(\theta)-\cos^{i+2}(\theta))d\theta

Dear All,
I want to extract the coefficients of Chebyshev of an arbitrary function, for example, exp(x). I know that we can use the following command to make a Chebyshev series expansion of exp(x):
chebyshev(exp(x),x);
the above returns the sum of nth Chebyshev polynomials multiplied by Chebyshev coefficients as the following:
1.26606587775201*T(0, x) + 1.13031820798497*T(1, x) + 0.271495339534077*T(2, x) + 0.0443368498486638*T(3, x) + 0.00547424044209371*T(4, x) + 0.000542926311913993*T(5, x) + 0.0000449773229542760*T(6, x) + 3.19843646244580*10^(-6)*T(7, x) + 1.99212480641582*10^(-7)*T(8, x) + 1.10367717095000*10^(-8)*T(9, x) + 5.50589697979079*10^(-10)*T(10, x)

I like to take the coefficients 1.266,1.1303, 0.2714, 0.04433, and so on. How can I do it?
Thanks

Why GenerateMatrix produces wrong results?

``

restart

N := 2:

a := 1:

with(ArrayTools):

``

Qa := [-0.5379667864e-1*(diff(tau[1, 1](t), t, t))+7.862351349*10^(-11)*tau[2, 1](t)-8.050993899*10^(-12)*(diff(tau[2, 1](t), t, t))+.1166068042*(diff(tau[1, 2](t), t))+2.181309895*10^(-11)*(diff(tau[2, 2](t), t))+.5309519363*tau[1, 1](t) = 0, -1.265965258*10^(-11)*(diff(tau[1, 1](t), t, t))+.4884414390*tau[2, 1](t)-0.4948946475e-1*(diff(tau[2, 1](t), t, t))+2.738892495*10^(-11)*(diff(tau[1, 2](t), t))+.1340883970*(diff(tau[2, 2](t), t))+1.246469610*10^(-10)*tau[1, 1](t) = 0, 3.649366137*10^(-10)*tau[2, 2](t)-9.135908950*10^(-12)*(diff(tau[2, 2](t), t, t))-5.160677740*10^(-11)*(diff(tau[2, 1](t), t))+1.953765755*tau[1, 2](t)-0.4948946473e-1*(diff(tau[1, 2](t), t, t))-.3476543209*(diff(tau[1, 1](t), t)) = 0, 2.246672656*tau[2, 2](t)-0.5690888318e-1*(diff(tau[2, 2](t), t, t))-.3198194887*(diff(tau[2, 1](t), t))+4.602903411*10^(-10)*tau[1, 2](t)-1.159417294*10^(-11)*(diff(tau[1, 2](t), t, t))-8.175817372*10^(-11)*(diff(tau[1, 1](t), t)) = 0]

Q1 := [seq(seq(diff(tau[i, j](t), t), i = 1 .. M), j = 1 .. N)]

[diff(tau[1, 1](t), t), diff(tau[2, 1](t), t), diff(tau[1, 2](t), t), diff(tau[2, 2](t), t)]

(1)

with(LinearAlgebra):

CR := GenerateMatrix(simplify(Qa), Q1)

CR := Matrix(4, 4, {(1, 1) = 0, (1, 2) = 0, (1, 3) = .1166068042, (1, 4) = 0.2181309895e-10, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0.2738892495e-10, (2, 4) = .1340883970, (3, 1) = -.3476543209, (3, 2) = -0.5160677740e-10, (3, 3) = 0, (3, 4) = 0, (4, 1) = -0.8175817372e-10, (4, 2) = -.3198194887, (4, 3) = 0, (4, 4) = 0}), Vector(4, {(1) = 0.5379667864e-1*(diff(diff(tau[1, 1](t), t), t))-0.7862351349e-10*tau[2, 1](t)+0.8050993899e-11*(diff(diff(tau[2, 1](t), t), t))-.5309519363*tau[1, 1](t), (2) = 0.1265965258e-10*(diff(diff(tau[1, 1](t), t), t))-.4884414390*tau[2, 1](t)+0.4948946475e-1*(diff(diff(tau[2, 1](t), t), t))-0.1246469610e-9*tau[1, 1](t), (3) = -0.3649366137e-9*tau[2, 2](t)+0.9135908950e-11*(diff(diff(tau[2, 2](t), t), t))-1.953765755*tau[1, 2](t)+0.4948946473e-1*(diff(diff(tau[1, 2](t), t), t)), (4) = -2.246672656*tau[2, 2](t)+0.5690888318e-1*(diff(diff(tau[2, 2](t), t), t))-0.4602903411e-9*tau[1, 2](t)+0.1159417294e-10*(diff(diff(tau[1, 2](t), t), t))})

(2)

``

``

``

Download GenMatrix.mw

I use Maple 2020 on a Windows 10 PC.

The command ssystem("CMD") enables to launch any Windows command accessible from the shell.
But how to launch a PowerShell command?

For instance ssystem("get-process") returns -1 (not surprising in fact for get-process is not a shell process).
How can I tell Maple that this command is to be found in the PowerShell ?

And even, I this possible for, in the ssystem help page, it's said that not all the command can be launched by ssystem

TIA

I have quite a big code with lot of functions how to convert all together to python in one go 

Or any other way of advice 

As recoding is difficult. Can you help with a small sample program with 2 simple functions returning values

Graph theory and it's algorithms, linear algebra , have used in my program codings mainly 

In small function kind take to a create a small graph find allpairshortestpath 

It would help to understand how it converts

Please help sorry to disturb in your busy schedule

Hi,

I am just starting with Maple after using Mathcad for nearly 30 years. I want to recreate something I have used a lot in Mathcad: select certain rows in array based on a specified criterion. For example, I want to save just the rows that have a certain value in a certain column and save the new array for use later. I am slowly learning how to do it Maple--for instance, I learned that I need to change the variable printlevel if I want to get the output from nested loops. 

I currently have the following code:

k := 1;

rows := RowDimension(M);


for i to rows do

   if M[i, 3] = "A" then

      row(out, k) := row(M, i);

       k := k + 1;

   end if;

end do;
out;

 

This doesn't seem to work, though. When I try to display out, I just get the name out instead a matrix of values.

I would appreciate it if someone could give me some idea of what I am doing wrong (with Maple, that is).

Thanks,

John
 

Hi Maple Users

As I hope you have already heard, Maplesoft is having our Maple Conference again this fall. And that means that

Last year we had many great submissions and you can still read about them in detail on the 2021 conference site. Some of the featured works were excellent Maple visualizations, including a special prize for a student contribution by Avek Dongol (center).

But we also featured a number of impressive physical works, including the people's choice winning wood carving by Paul DeMarco (left), and the judges' choice winning cross stitch by Bridjet Lee and Curtis Bright (right).

This year, we are again looking to fill our virtual exhibition with all types of mathematical art, ranging from computer graphics and animations, to needlework, geometrical sculptures, or almost anything you can come up with. Surprise us!

The full announcement can be found at the Maple Conference Art Gallery page. We would like to have all submissions by September 22nd so that we can review and finalize the gallery before the conference begins November 2nd.

I can't wait to see what everyone sends in this year!

Hello

I have the following summation to do, 

d(l,m')=\sum_{N=-l'}^{l'}d(l',N,m')=d^{l'}_{00}(\dfrac{\pi}{2})d^{l'}_{0m'}(\dfrac{\pi}{2})f_{m'0}+\sum_{N=1}^{l'}((-1)^{l'}+1)d^{l'}_{0N}(\dfrac{\pi}{2})d^{l'}_{Nm'}(\dfrac{\pi}{2})f_{m'N}

where  d^{l'}_{0N} are the rotation matrix functions and  f_{m'N} is a piecewise function which takes a certain value at N=0, another value for N even and it takes 0 as a value for N odd.

The prblem is that I don't know how to write a summation for N even only so that in that case i can replace f_{m'N} by its expression for N even. The other way is to write f_{m'N} as a piecewise function but in that case, i don't know how to do it (I tried to use assuming N even ..) but got wrong answer.

Thank you for helping me solving my proble.

Best regards.

Dear all, 

I'm trying to enter an equation (Navier-Stokes) in Maple using the Physics[Vectors] package. I am having trouble with the term 

$(u\cdot \nabla) u$

but Maple returns an error when entering the commands :

( u_(t,x,y,z) . %Nabla) u_(t,x,y,z)

I tried other combinations of this without success, like :

( u_(t,x,y,z) . %Nabla)(u_(t,x,y,z))

( u_(t,x,y,z) %. %Nabla) u_(t,x,y,z)

( u_(t,x,y,z) %. %Nabla) (u_(t,x,y,z))

Could you please give me some help with this? 

First 178 179 180 181 182 183 184 Last Page 180 of 2097