Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Taking the example below from the help page, showstat displays the content of a procedure. This is convenient when writing code. However, to perform copy & paste, I would like to get rid of the displayed line number. Is that possible?

f := proc(x) if x <= 2 then print(x); print(x^2) end if; print(-x); x^3 end proc:
showstat(f);

f := proc(x)
   1   if x <= 2 then
   2       print(x);
   3       print(x^2)
       end if;
   4   print(-x);
   5   x^3
end proc

 

Hi everyone, I hope you are staying safe from coronavirus.

I have a table of data points in excel (attached file) and want to plot a smooth surface plot in Maple, the plot will look like in the image below. How can I do it in Maple (2017)? I tried matrixplot(matrix) and the surface is good. However, I couldn't change the X, Y axes value since it should be the default value. 

Thank you very much.PlotTest.xlsx

The uploaded worksheet contains an apparently unsolvable ode.

Please see the text in the worksheet for a description of the problem.

Roller_coaster_loop.mw

Hi, 

I work for the University of Dundee as a packager for the staff and student desktops.

We have a licence for 2020 applied to our licance server, I only require the software.

Is your free version the full package that once it sees the licence server will unlock all the features do I need to download a specific version from yourselves,

Best regards

Colin 

restart;
plot([sin(x), sin(x), x=0..420]);

The matrix A := op([1,1], %)  has equal columns, so the bug is in the PLOT engine.
plot(A) generates the same plot.
See also the "circle":
plot([cos(x), sin(x), x=0..5000*Pi]);

 

help me for solve the error of plot

p1.mw

Hello everyone! I'm pretty new to Maple and struggling with some basics.

 

I want to use a for-loop to print out the square numbers from 11 to 20. And the outputs should be presented within a list.

This is what I have so far:

|> for i from 11 to 20 do print(i^2) od;


                              121

                              144

                              169

                              196

                              225

                              256

                              289

                              324

                              361

                              400

But I don't know how I can put all these results in a list, so that in the end it looks like this:

L: = [121,144,169,196,225,256,289,324,361,400]

 

I'm grateful for every answer :)

 

 

With Maple 2020, I have been experiencing some odd behavior of simple 2D plots. For example, I plotted two functions on the same graph, and the default view did not contain the full upper or lower limits of both functions. (Sorry, I chose to move on and so I am unable to reproduce this outcome – but it has happened more than once.)  

Now I am experiencing another limited view of a plot, this time a single function. In creating a simple example of the SIR model, I have dsolve output a list of procedures so that I can plot them as functions. But when I plot one of the functions, it does not plot the entire function from the lower to the upper limit. Am I alone in experiencing this outcome? Is there something I am doing wrong that is causing this behavior?

 

restart; plots:-setoptions(size = [300, 300])

s_eq := diff(s(t), t) = -ir*i(t)*s(t); i_eq := diff(i(t), t) = ir*i(t)*s(t)-rr*i(t); d_eq := diff(d(t), t) = dr*i(t); ics := s(0) = s0, i(0) = i0, d(0) = 0

"i0:=1.E3:    P0:=3.E8:    drate:=0.02:     s0:=0.6*P0:    ir:=(0.1)/(s0):   rr:=1/(30.):  dr:=rr*drate:   "

sol := dsolve({d_eq, i_eq, ics, s_eq}, numeric); tf := 120; plots:-odeplot(sol, [t, d(t)], 0 .. tf)

 

sol := dsolve({d_eq, i_eq, ics, s_eq}, numeric, output = listprocedure); i := eval(i(t), sol); s := eval(s(t), sol); d := eval(d(t), sol)

tf; plot(d(t), t = 0 .. tf)

120

 

 

plot(d(t), t = 0 .. tf, view = [0 .. 150, 0 .. 40000])

 

``


 

Download plot_view_problem.mw

Following situation: I have a bunch of matrices A,B,Dm, Dinv (which is the inverse of Dm). They happen to be 2x2 matrices, but I want/need to keep these in a symbolic or abstract form, i.e. I am not saying what these are.

They are then used as submatrices of other (2x2) matrices like so:

R:=<<A|0>,<0|B>>;

I then have various dot products between these & others.

My issue/question is: How can I make sure, Maple obeys the non-commutativeness of the products that occur in doing these matrix products? I tried declaring A and B etc. as Matrix(), but that fails, saying the matrices are either too short or too long.

At any rate, I do not want Maple to expand these into their elements. A particular concern is that Dm*B*Dinv bcomes B*Dm*Dinv = B; obviously not correct for matrices B,Dm,Dinv.

So, can Maple handle abstract matrices?

M.D.

Dear all

I need to display a matrix K defined in the attached maple code.

Thanks for your help

matrix.mw

Dear maple users,
Greetings.
How to plot residual error for BVP.
Here I have enclosed the file.rerror.mw
 

restart; with(plots)

fcns := {f(eta), g(eta)}:

bet := 0.:

eq1 := diff(f(eta), `$`(eta, 3))+(diff(f(eta), `$`(eta, 2)))*f(eta)+be*((diff(g(eta), `$`(eta, 1)))^2-(diff(g(eta), `$`(eta, 2)))*g(eta)) = 0:

eq2 := pr*lam*(diff(g(eta), `$`(eta, 3)))+(diff(g(eta), `$`(eta, 2)))*f(eta)-(diff(f(eta), `$`(eta, 2)))*g(eta) = 0:

bc := f(0) = 0, (D(f))(0) = 0, (D(f))(N) = 1, g(0) = 0, ((D@@2)(g))(0) = 0, (D(g))(N) = 1;

f(0) = 0, (D(f))(0) = 0, (D(f))(5) = 1, g(0) = 0, ((D@@2)(g))(0) = 0, (D(g))(5) = 1

(1)

R := dsolve(eval({bc, eq1, eq2}), fcns, type = numeric, method = bvp[midrich], output = listprocedure):

Sol_exact := dsolve(eval({bc, eq1, eq2}), fcns):

``


 

Download rerror.mw

Have a good day

 

When I use something like plots[display](Array([p1,p2]));  And the plots p1,p2 have been resized before to be small, there is lots of wasted empty space in the final result. I have to manually adjust the size of each Array entry with the mouse to make the fit better. But this solution is not practical. 

Is there an option to do this automatically? Here is an example

restart;

p1:=plot(sin(x), x=-Pi..Pi, size=[300,300]):
p2:=plot(cos(x), x=-Pi..Pi, size=[300,300]):
plots[display](Array([p1,p2]));   #one option
plots[display](Vector[row]([p1,p2])); #another option

Manually, using the mouse, I can, after some adjustments and trrial and errors, get the final result such that the wasted space is removed.

I am asking, becuase if I want to save/export the above final plot as PDF to include in a Latex document, it will look bad with that wasted space there.

How to do this adjustment using code?

In Mathematica for example, this is done using Grid and the Spacing option. I could not find something similar in Maple but I could have overlooked it.

If A then B After clustering B , how to find a set of A in machine learning topic and fuzzy topic?

First 431 432 433 434 435 436 437 Last Page 433 of 2097