bmartin

Dr. Blake Martin

85 Reputation

5 Badges

3 years, 46 days
Maplesoft
Application Engineer

MaplePrimes Activity


These are answers submitted by bmartin

Here's how I updated the last line to obtain different colors:

implicitplot3d([f, g, Op], x = 0 .. 2, z = 0 .. 2, w = 0 .. 2, style = surface, color = ["red", "blue", "green"], grid = [50, 50, 50])

I used style = surface to remove all the black "wires" that get added to the plot and I find it looks better that way. Also note that I changed the curly brackets to square brackets in [f, g, Op] and use square brackets when defining the colors.

-Blake
 

Hello,

Using 'kernelopts' you can find the path to Maple's data directory on your system, and then go to the datasets directory. You can also list the files in the datasets directory using FileTools.

kernelopts(datadir);
FileTools:-ListDirectory(FileTools:-JoinPath([kernelopts(datadir), "datasets"]));

 

-Blake

Hello,

Instead of 'eval' you can use 'evalf', which will evaluate using floating-point arithmetic.

Hello,

Maple does have the capabilities to perform parallel processing. Here is a link to the Parallel Programming chapter in the Maple Programming Guide:

https://www.maplesoft.com/support/help/maple/view.aspx?path=ProgrammingGuide/Chapter15

Hello,

First, you should know that using capital 'I' in Maple is interpreted as imaginary. You need to either define I to be local (as below) or use a different variable.

local I;
Ke := Matrix(4, 4, {(1, 1) = (12*I)*E/l^3, (1, 2) = (6*I)*E/l^2, (1, 3) = -(12*I)*E/l^3, (1, 4) = (6*I)*E/l^2, (2, 1) = (6*I)*E/l^2, (2, 2) = (4*I)*E/l, (2, 3) = -(6*I)*E/l^2, (2, 4) = (2*I)*E/l, (3, 1) = -(12*I)*E/l^3, (3, 2) = -(6*I)*E/l^2, (3, 3) = (12*I)*E/l^3, (3, 4) = -(6*I)*E/l^2, (4, 1) = (6*I)*E/l^2, (4, 2) = (2*I)*E/l, (4, 3) = -(6*I)*E/l^2, (4, 4) = (4*I)*E/l});

 

I'm not sure how to get it exactly in the form you want, is there any particular reason why? If you are just trying to check the entries in the matrix you can do the following to your matrix Ke

Ke/(E*I/l^3)

 

Hello,

Boundary value problems need to be defined between two points, say x=a and x=b. In the code you provided there are a total of 4 points used in the conditions, x=0, 0.001, 0.1, and -0.6. If you only had two points x=a and x=b used in the 6 conditions then you should get a solution.

Hello,

If you know the value for each of the unknowns you can use the 'subs' command.

sol := -c^2*(d^2*a*sin(k1*(-c*t+x))/dx^2+2*d*a*k1*cos(k1*(-c*t+x))/dx);
subs({a=A, c=C, ...}, sol);

Above, A and C would be values you want to substitute into your solution and you would do this for each variable. 

Hello,

You can use the 'dsolve' command and additionally you can see an overview of the DEtools package by using the command '?DEtools' in Maple (or by searching DEtools in the Maple help). You can also search for "differential equations" in the Maple Help and it will bring you to a worksheet with links to examples.

Hope this helps!

 

Hello,

Not sure if you still are looking for an answer to this but thought I'd post anyways.

Changing the colour of text can be done from the toolbar. See below where I've emphasized the text colour option in a green square.

Unfortunately, I don't know of any way to change the background colour in Maple.

- Blake Martin

Hello,

Something that I like to do when using the 'rand' command is to reset the seed using the 'randomize' command. This will prevent you from opening your worksheet and getting duplicate results from the last time you opened the worksheet. This can be done just before calling the 'rand' command, i.e. the code would be:

restart;
randomize();
Dice1 := rand(1..6);

...

Hello,

You can just use the 'solve' command to get a solution. i.e. 

solve({(T[1]-T[0])/(10000-T[1]+T[0]) = -2.000000000, (T[2]-T[0])/(20000-T[2]+T[0]) = 0, (T[3]-T[0])/(50000-T[3]+T[0]) = 50, .1*T[0]+.3*T[1]+.55*T[2]+0.5e-1*T[3]-5000 = 0}, {T[0], T[1], T[2], T[3]});

will return a solution to the problem.

Hello,

The error you're receiving is telling you that the initial point in the optimization violates the contraints. For example m2 > sigma2 is violated since m2 = sigma2 = 0.9. Then the program tries to find an initial feasible point but seems to fail to find one.

What if you tried starting with an initial point that is known to be feasible? Would you still run into this issue?

Hello,

If you absolutely wanted to add a small arrow you can do so by overlaying a polygon on your plot. The polygon will use 3 points to draw the arrow. Here is one way of getting this done, which could be extended to include multiple arrows.

 

``

f := [sin(t), cos(t)];

[sin(t), cos(t)]

(1)

plt := plot([op(f), t=0..Pi]):
poly := PLOT(POLYGONS([[-0.025,0.05],[-0.025,-0.05],[0.025,0]])):

t0 := Pi/3;

(1/3)*Pi

(2)

plots:-display(plt,
    plottools:-translate(
        plottools:-rotate(poly, arctan(op(ListTools:-Reverse(subs(t=t0, diff(f,t)))))),
    op(subs(t=t0, f)))
, scaling=constrained)

 

``


In the code, if you change the sign in f to be -cos(t), you will see that the arrow will change directions as expected.

 

Download AddingArrow.mw

Hello,

If you which to generalize the problem to 3D motion, you will want to consider a spherical pendulum since you need to consider more than just a single angle to describe the position of the pendulum. Here is a Wiki page that can serve as a reference for a spherical pendulum:

https://en.wikipedia.org/wiki/Spherical_pendulum

Once you have the equations of motion, you can follow a similar approach to what is found in the Maple worksheet in the link you provided.

Hello,

Is the main problem plotting multiple lines simultaneously? If so, the easiest way to display multiple plots simultaneously is to use the 'display' command in the 'plots' package. This allows you to define a list of plot structures and have them plotted on the same figure. To define multiple plots quickly you can take advantage of the 'seq' command.

As a simple example, here are three sine waves plotted simultaneously with different frequencies.

plots:-display([seq(plot(sin(x*a), x=-Pi..Pi), a=1..3)]);

Hope this helps!

1 2 Page 1 of 2