Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I just started using Maple for civil engineering calculations and cant figure out how to manage units.  And all of the civil engineering Maple document examples I have seen are done as unitless calculations, sidestepping that issue.  Are there any examples available that show how to manage units to be more usable for civil engineering?  An example where I am having trouble involves pressure:

If I define f:=60 ksi; the result is displayed as 60,000 lbf/in^2

But if I apply that pressure over an area,

F:= f * 1 inch^2;   the result is displayed as "1930442.91 poundals"  And poundals is a totally foreign unit to me and anyone who might look at my calculations.

I would like to be able to display that as either lbf or kip but neither is on the list of options if I right click 'poundals' and try to 'affix units'.  I'm hoping there is an easy way to do this.  It was extremely easy in mathcad but I had to ditch mathcad because it is now crazy expensive.

thanks

Nick

 

 

 

Hi everyone

I have a problem with differentiating an equation. I have the following code:


(sum((x(i)-M)^3, i = 1 .. n))/(n*((sum((x(i)-M)^2, i = 1 .. n))/(n-1))^(3/2));


The values of x(i) is available in Excel and I want to import that. For this case, I copy the column and paste in maple and it seems work fine. But, I want to calculate the differentiate of the summation with respect to x(i) and M and find the answer. I don't know how to write the code appropriately.

In other words, how could I differetiate the following function with respect to x(i) and put the values from excel into it.

(sum((x(i)-M)^3, i = 1 .. n))/(n*((sum((x(i)-M)^2, i = 1 .. n))/(n-1))^(3/2));

 

Thank you so much for your kind attentions  in advance

 

I have been working some plots using piecewise, and this seem to always result in graphs with very jagged edges

Example: https://i.imgur.com/ZBOSDsL.png

The function its plotting is this one:

f:=unapply(piecewise(x^2+y^2 <= 1 and x>=0, 4*x*y^2-x^2, undefined),x,y):

Now I assume this happens because of the piecewise part. How do I smoothen the edges?

Hello. 

I would like to know if Maple can or cannot evaluate the integral below. It can be done analytically and also in Mathematica. It is not an uncommon type of integral being related to a Fourier transform of a Hankel function.

restart;
assume(alpha>0);assume(beta>0);assume(s>0);
gr:=(beta,r)->(1/8*I)*(-HankelH1(1, beta*r)-(2*I)*BesselK(1, beta*r)/Pi)/beta^2;
int(cos(alpha*s)*gr(beta,s),s=0..infinity);

Many thanks

 

Dear all

Hope everything is fine with everything. I want to draw the graph of the u(x,0.5) and T(x,0.5) for different values of alpha like alpha =0.4,0.6,0.8 while keeping Gr, R and Pr are fixed. Please solve the following problem I shall be vary thankful to you. Thanks in advance

with the following BCs

Is there a way to determine the coordinates of all the vertices of a cuboid using geom3d?

See WC06_Vertices_of_a_Cuboid.mwWC06_Vertices_of_a_Cuboid.mw attached.

The graphic of the cuboid is created with

A:=(cuboid([1,1,2],[3,4,5]), orientation [27,78],lightmodel = light4, shading = none, transparency =.85,scaling = constrained, axesfont = [bold, roman, 18], axes = normal):

And the vertices are self-evident, for example 

B:= pointplot3d({[3,1,5]}, symbol = solidsphere, symbolsize = 18, color = red):

One geom3d ....

geom3d[point](P,1,1,2): geom3d[point(Q,3,4,5): geom3d[distance](P,Q); 

gives the lengths of the diagonal of the box.  Is there a way to get geom3d to list the coordinates of the 8 vertices of a cubeoid?

Stupid question maybe, but when will the newest version be released or what will the newest version be label wise? When are the newest versions generally released???

Does anyone know if there exist a script in JAWS for MapleSoft?

How do I access and assign values given by the solve command

for example

f := unapply(x*(8*x^2+5*x+cos(y)), x, y);

p := solve({diff(f(x, y), x) = 0, diff(f(x, y), y) = 0}, {x, y})

This gives the following

{x = 0, y = (1/2)*Pi}, {x = -1/6, y = 0}, {x = -1/4, y = 0}, {x = -1/2, y = Pi}, {x = 1/12, y = Pi}

now if I type: p[1] I get the following

{x = 0, y = (1/2)*Pi}

Now this isn't very useful. I want to access the "0" and the "(1/2)*Pi". How do I do that?

in maple 2017 I have enconterd a problem in showing of matrix elements. this error did not exist in maple 2016.

after some mathematical operations with(Linearalgebra)

I have obtained a matrix but maple shows it as below

 

`Vector(3, {(1) = \`+\`(\`*\`(0.19498673e10, \`*\`(\`^\`(x[1], 3))), \`-\`(\`*\`(0.36539123e10, \`*\`(\`^\`(x[1], 2), \`*\`(x[2])))), \`*\`(0.12514628e10, \`*\`(\`^\`(x[1], 2), \`*\`(x[3]))), \`-\`(\`*\`(7987.1506, \`*\`(\`^\`(x[1], 2)))), \`*\`(0.35170874e10, \`*\`(x[1], \`*\`(\`^\`(x[2], 2)))), \`-\`(\`*\`(0.41418339e10, \`*\`(x[1], \`*\`(x[2], \`*\`(x[3]))))), \`-\`(\`*\`(9187.8615, \`*\`(x[1], \`*\`(x[2])))), \`*\`(0.28788960e10, \`*\`(x[1], \`*\`(\`^\`(x[3], 2)))), \`*\`(2871.4325, \`*\`(x[1], \`*\`(x[3]))), \`-\`(\`*\`(0.95594712e9, \`*\`(\`^\`(x[2], 3)))), \`*\`(0.21616680e10, \`*\`(\`^\`(x[2], 2), \`*\`(x[3]))), \`-\`(\`*\`(16552.293, \`*\`(\`^\`(x[2], 2)))), \`-\`(\`*\`(0.20009067e10, \`*\`(x[2], \`*\`(\`^\`(x[3], 2))))), \`-\`(\`*\`(30447.582, \`*\`(x[2], \`*\`(x[3])))), \`*\`(0.42009564e9, \`*\`(\`^\`(x[3], 3))), \`-\`(\`*\`(42372.407, \`*\`(\`^\`(x[3], 2))))), (2) = \`+\`(\`-\`(\`*\`(0.14713991e11, \`*\`(\`^\`(x[1], 3)))), \`*\`(0.42489026e11, \`*\`(\`^\`(x[1], 2), \`*\`(x[2]))), \`-\`(\`*\`(0.25018214e11, \`*\`(\`^\`(x[1], 2), \`*\`(x[3])))), \`-\`(\`*\`(55498.093, \`*\`(\`^\`(x[1], 2)))), \`-\`(\`*\`(0.34645652e11, \`*\`(x[1], \`*\`(\`^\`(x[2], 2))))), \`*\`(0.52229109e11, \`*\`(x[1], \`*\`(x[2], \`*\`(x[3])))), \`-\`(\`*\`(399927.96, \`*\`(x[1], \`*\`(x[2])))), \`-\`(\`*\`(0.24172439e11, \`*\`(x[1], \`*\`(\`^\`(x[3], 2))))), \`-\`(\`*\`(367829.40, \`*\`(x[1], \`*\`(x[3])))), \`*\`(0.11603445e11, \`*\`(\`^\`(x[2], 3))), \`-\`(\`*\`(0.24618238e11, \`*\`(\`^\`(x[2], 2), \`*\`(x[3])))), \`*\`(163169.71, \`*\`(\`^\`(x[2], 2))), \`*\`(0.24814370e11, \`*\`(x[2], \`*\`(\`^\`(x[3], 2)))), \`-\`(\`*\`(711030.81, \`*\`(x[2], \`*\`(x[3])))), \`-\`(\`*\`(0.64758011e10, \`*\`(\`^\`(x[3], 3)))), \`*\`(427083.52, \`*\`(\`^\`(x[3], 2)))), (3) = \`+\`(\`*\`(0.13627334e11, \`*\`(\`^\`(x[1], 3))), \`-\`(\`*\`(0.67651416e11, \`*\`(\`^\`(x[1], 2), \`*\`(x[2])))), \`*\`(0.94045968e11, \`*\`(\`^\`(x[1], 2), \`*\`(x[3]))), \`*\`(46901.078, \`*\`(\`^\`(x[1], 2))), \`*\`(0.70616015e11, \`*\`(x[1], \`*\`(\`^\`(x[2], 2)))), \`-\`(\`*\`(0.13072873e12, \`*\`(x[1], \`*\`(x[2], \`*\`(x[3]))))), \`-\`(\`*\`(994642.52, \`*\`(x[1], \`*\`(x[2])))), \`*\`(0.41170263e11, \`*\`(x[1], \`*\`(\`^\`(x[3], 2)))), \`-\`(\`*\`(2768390.4, \`*\`(x[1], \`*\`(x[3])))), \`-\`(\`*\`(0.22189949e11, \`*\`(\`^\`(x[2], 3)))), \`*\`(0.67100205e11, \`*\`(\`^\`(x[2], 2), \`*\`(x[3]))), \`-\`(\`*\`(961344.42, \`*\`(\`^\`(x[2], 2)))), \`-\`(\`*\`(0.52533380e11, \`*\`(x[2], \`*\`(\`^\`(x[3], 2))))), \`*\`(2309741.6, \`*\`(x[2], \`*\`(x[3]))), \`*\`(0.23373385e11, \`*\`(\`^\`(x[3], 3))), \`-\`(\`*\`(2708629.4, \`*\`(\`^\`(x[3], 2)))))})`

 

 

however its elemets is shown correctly

for example the first element is shown as:

x(1) ^ 3 * 0.194986727121702600e10 + x(1) ^ 2 * x(2) * (-0.365391227687975264e10) + x(1) ^ 2 * x(3) * 0.125146284187383199e10 + x(1) ^ 2 * (-0.798715058230362229e4) + x(1) * x(2) ^ 2 * 0.351708738191481209e10 + x(1) * x(2) * x(3) * (-0.414183393126536083e10) + x(1) * x(2) * (-0.918786154503699254e4) + x(1) * x(3) ^ 2 * 0.287889598946906424e10 + x(1) * x(3) * 0.287143252997207219e4 + x(2) ^ 3 * (-0.955947121705965400e9) + x(2) ^ 2 * x(3) * 0.216166802966718006e10 + x(2) ^ 2 * (-0.165522927641286878e5) + x(2) * x(3) ^ 2 * 

Any any good programming language or design program the format and style of a document is important for sharing with others.  But for the life of me, I don't know if I'm just missing the painfully obvious, but seriously is there not a blogpost or document about the best writing practices for using maple?

 

It would be a great help to understand general practices for formatting with the document blocks and execution groups.

How do we print the determinant as a matrix with vertical bars instead of brackets?
Thanks!

mapleatha

Hello people in mapleprimes,

I have a problem about map.

restart;
map(`*`,op([1/x,y,z]));

The output of this code is not y*z/x, but  (x*y*z)^(-y*z).

I can't understand why this occurs.
Can't you teach me about this?

Thanks in advance.

Nov_3_2017_mapleprimes.mw

I write shell scripts that call Maple to automate frequent tasks. Because I prefer writing Maple code to shell code, I've created a Maple package, Bark, that generates a shell script from Maple source code. It provides a compact notation for defining both optional and positional command-line parameters, and a mechanism to print a help page, from the command-line, for the script. The optional parameters can be both traditional single letter Unix options, or the more expressive GNU-style long options.

As an example, here is the Maple code, using Bark, for a hello-world script.

hello := module()
export
    Parser := Bark:-ArgParser(NULL
                              , 'prologue' = ( "Print `Hello, World!'" )
                              , 'opts' = ['help' :: 'help' &c "Print this help page"]
                             );
export
    ModuleApply := proc(cmdline :: string := "")
        Bark:-ArgParser:-Parse(Parser, cmdline);
        Bark:-printf("Hello, World!\n");
        NULL;
    end proc;
end module:

The following command creates and installs the shell script in the user's bin directory.

Bark:-CreateScript("hello", hello
                   , 'add_libname' = Bark:-SaveLib(hello, 'mla' = "hello.mla")
                  ):

The hello script is executed from the command-line as

$ hello
Hello,  World!

Pass the -h (or --help) option to display the help.

$ hello -h
Usage: hello [-h|--help] [--]

Print `Hello, World!'

Optional parameters:
-h, --help Print this help page

CreateScript creates two files that are installed in the bin directory: the shell script and a Maple archive file that contains the Maple procedures. The shell script passes its argument in a call to the parser (a Maple procedure) saved in the archive file (.mla file). Here's the created shell script for the hello command:

#!/usr/bin/env sh
MAPLE='/home/joe/maplesoft/sandbox/main/bin/maple'
CMD_LINE=$(echo $0; for arg in "$@"; do printf '%s\n' "$arg"; done)
echo "hello(\"$CMD_LINE\");" | "$MAPLE" -q -w2 -B --historyfile=none -b '/home/joe/bin/hello.mla'

I've used Bark on Linux and Windows (with Cygwin tools). It should work on any unix-compatible OS with the Bash shell. If you use a different shell that does not work with it, let me know and I should be able to modify the CreateScript command to have options for specific shells.

Bark is available on the MapleCloud. To install it, open the MapleCloud palette in Maple, select packages in the drop-down menu and go to the New tab (or possibly the Popular tab). You will also need the TextTools package which is also on the MapleCloud. The intro page for Bark has a command that automatically installs TextTools. Alternatively, executing the following commands in Maple 2017 should install both TextTools and Bark.

PackageTools:-Install~([5741316844552192,6273820789833728],'overwrite'):
Bark:-InstallExamples('overwrite'):

The source for a few useful scripts are included in the examples directory of the installed Bark toolbox. Maple help pages are included with Bark, use "Bark" as the topic.

As my first project as a Junior Applications Developer, I set out to learn to code in the best way I know how, by doing.  I ended up picking what was probably one of the hardest options I could pick, namely to replicate the sliding puzzle game, 2048. (https://en.wikipedia.org/wiki/2048_(video_game) ) Of course I didn’t realize how hard it would be at the time, but after spending the first week alone working on the logic, I had already dug my hole.

2048, the sliding puzzle game, basically starts with a 4x4 grid filled with zeros. As you swipe the grid, values move toward one of the up, down, left or right sides. With every subsequent swipe, a randomly placed value of 2 or 4 is added to the grid. Any neighbouring matching values in the direction of the swipe are added to one another. This was done by swiping 2 tiles of equal value into each other, creating a new tile with double the value. Two 2 tiles became a 4, two 4’s an 8, and so on.

The goal? To create a 2048 tile.

Overall the logic was probably the most challenging part of my task, once the framework was set. . The logic consisted of many if statements that made the numbers “slide” properly, ie not combining with another number. This was probably the hardest part. Troubleshooting and allowing for all the possible conditions also proved difficult. However, the user interface was probably the toughest part, figuring out the labels, making everything display correctly, and programming all the buttons to not break. That was fun.

Anyway, it was a really fun project to work on, and I’m extremely happy for how it turned out, and I hope you enjoy playing it, as much as I did making it!

You can try it out here:

https://maple.cloud/#doc=5765606839156736

First 890 891 892 893 894 895 896 Last Page 892 of 2215