MaplePrimes Questions

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?

Hi Guys,

I need help regarding simplifying definite integrals. I have following expression

2*s^2*(int(Phi[1, 1](x, T[2])*(diff(Y1(x), x, x)), x = 0 .. x1))+int(Phi[1, 1](x, T[2])*(diff(Y1(x), x, x, x, x)), x = 0 .. x1)-omega_y^2*(int(Y1(x)*Phi[1, 1](x, T[2]), x = 0 .. x1))

As we can notice the limit for each integral is same, so I should be able to take these integral limit outside. I am trying to use collect and simplify, but both of these command are not working. It would be really helpful for me if I can get the solution for it.

Please find the attached example sheet also.example.mw

With Regards

Sunit

 

Maple's plot3d makes nice plots, but it is not quite polished enough I feel.

When I compared the same plot with what I get with Mathematica, I found these 3 issues shown below. I am not too good in Maple, so I am not able to see how to improve on this any more.

 

 

The Maple code is

restart;
f:=-x^4-2*y^4+14*x^2*y^2/5:
plot3d(f, x=-5..5,y=-5..5,
   axes     = boxed,
   axesfont = [Times,default,10],
   axis[1]  = [tickmarks=[3,subticks=5]],
   axis[2]  = [tickmarks=[3,subticks=5]],
   axis[3]  = [tickmarks=[3,subticks=5]],
   labeldirections = [horizontal, horizontal, horizontal],	
   labels   = ['x', 'y', 'z'],
   scaling  = unconstrained) 

Compare to Mathematica's output

 

f = -x^4 + (14*x^2*y^2)/5 - 2*y^4; 
Plot3D[f, {x, -5, 5}, {y, -5, 5}, 
 AxesLabel -> {"x", "y", "z"}, 
 PlotRange -> All, 
 BoxRatios -> {1, 1, 1}, ImageSize -> 400]

Another major limitation in Maple's plot3d, is that it does not support `BoxRatios` like option. I asked about this years ago and got help on it, but nothing very satisfactory to use in geneal.

https://www.mapleprimes.com/questions/217092-How-To-Change-box-Ratio-Or-3D-Aspect

I hope Maplesoft can improve on this in next version.

Any suggestion how to improve the above 3 issues for now? The ticks issues for me seems the most annoying, becuase they keep moving around as I rotate the 3d plot.

 

Maple 2020 on windows 10

Dear all

I need your help to compute the discrete convolution product. Is there a simple way in maple that hep me to compute the coefficient of the matrix g 

thanks

convolution.mw

 

 

Hi, 

I represent 3 thin parallel slices of colors red, green and blue; all have the same transparency equal to 0.5
For the default orientation of the display, the blue slice is on the forefront, the red one in the background and the green one in beween. Then the blue slice is "bluer" than green and  the green one "greener" than red (FIG 1)
If you rotate manually the figure in order to place the red slice in the forefront and the blue one in the background, you expect to have the red slice "redder" than the green one and the green one "greener" than the blue one (FIG 2)
This is not the case.

The order in which the slices appear in the PLOT3D command defines the foreground and the background, but these latter are not dynamically recalculated when the figure is rotated.
To recover the correct colors one must revert the order of the slices in PLOT3D (FIG 3)

Are we comdamned to change to change manually the order of the slices in PLOT3D or does it exist an option whixh avoids doing so?

Don't pay too much attention to the plots above for the foreground is strangely correct on figure 2 ???

restart

with(plottools):

alpha := Pi/18.:
a := 2*cos(alpha):
b := 2*sin(alpha):
e := 0.02:
p := [[0,0,0],[a,b,0],[a,b,1],[0,0,1]],
     [[0,e,0],[a,b+e,0],[a,b+e,1],[0,e,1]],
     [[0,0,0],[0,e,0],[0,e,1],[0,0,1]],
     [[a,b,0],[a,b+e,0],[a,b+e,1],[a,b,1]],
     [[0,0,0],[a,b,0],[a,b+e,0],[0,e,0]],
     [[0,0,1],[a,b,1],[a,b+e,1],[0,e,1]]

[[0, 0, 0], [1.969615506, .3472963554, 0], [1.969615506, .3472963554, 1], [0, 0, 1]], [[0, 0.2e-1, 0], [1.969615506, .3672963554, 0], [1.969615506, .3672963554, 1], [0, 0.2e-1, 1]], [[0, 0, 0], [0, 0.2e-1, 0], [0, 0.2e-1, 1], [0, 0, 1]], [[1.969615506, .3472963554, 0], [1.969615506, .3672963554, 0], [1.969615506, .3672963554, 1], [1.969615506, .3472963554, 1]], [[0, 0, 0], [1.969615506, .3472963554, 0], [1.969615506, .3672963554, 0], [0, 0.2e-1, 0]], [[0, 0, 1], [1.969615506, .3472963554, 1], [1.969615506, .3672963554, 1], [0, 0.2e-1, 1]]

(1)

f   := k -> transform((x, y, z) -> [x, y+k, z]):
col := k-> COLOR(RGB, op(ListTools:-Rotate([1, 0, 0], -k))):
t   := TRANSPARENCY(0.5):
PLOT3D(POLYGONS(p, t, col(0)), f(1)(POLYGONS(p, t, col(1))), f(2)(POLYGONS(p, t, col(2))), AXESLABELS(2, 3, 1))

 

PLOT3D(POLYGONS(p, t, col(0)), f(1)(POLYGONS(p, t, col(1))), f(2)(POLYGONS(p, t, col(2))), AXESLABELS(2, 3, 1))

 

PLOT3D(f(2)(POLYGONS(p, t, col(2))), f(1)(POLYGONS(p, t, col(1))), POLYGONS(p, t, col(0)), AXESLABELS(2, 3, 1))

 

 


 

Download Background_Foreground.mw

Is that possible ? Or do I need a seperate compiler?

Hello everyone.

I've took part in a math competition and we use Maple 15 as software to solve the various problems. We, apart from solving the problems, to correct and give a score to 4 other participants per problems. We have to download their solution and read it and then valuate it. However one of the files is .maple and not .mw. How can I open it? The tutors said to us that we just have to change extension and copy-paste the content into another document, but the the program doesn't let me copy the text (it's a mess) because "it's too big to be copied". I have obviously asked them how to solve this since what they said isn't working, but they didn't answer...

So, does anyone know how I could convert a file from .maple to .mw and still see the document as it was intended?

I would like to be able to calculate 3D vector dot products using the spherical coordinate system, but so far I have not been sucessful.  A few suggestions would be greatly appreciated!

These are my failed attempts:
 

Calculating dot products using spherical coordinatesNULL

With Physics Vectors

 

with(Physics[Vectors])

Setup(mathematicalnotation = true)``

Setup(coordinatesystems = spherical)

[coordinatesystems = {X}]

(1.1)

k_ := _phi*c+_r*a+_theta*b

_phi*c+_r*a+_theta*b

(1.2)

k_.k_

a^2+b^2+c^2

(1.3)

I was hoping for the dot product to be calculated using the spherical coordinate system, but this is the cartesian dot product.

NULL

With Vector Calulus

 

restart

with(VectorCalculus)``

SetCoordinates('spherical'[r, phi, theta])

spherical[r, phi, theta]

(2.1)

``

k := VectorField([a, b, c], coords = spherical[r, phi, theta])

Vector(3, {(1) = a, (2) = b, (3) = c})

(2.2)

k.k

a^2+b^2+c^2

(2.3)

This is also the cartesian dot product.

NULL


 

Download Calculating_dot_products_using_spherical_coordinates.mw

If I am running Windows is there any way to make Maple see the directory of an external program like for instance Geogebra? 

I have tried with

file := fopen("inputfile.ggb",WRITE, TEXT);

execute; fprintf(file, "line((2,3),(4,6)\n");
close(file);
 system[launch]("Geogebra.exe testfile.ggb"); 

Where line is a command in Geogebra, to draw a straight line.  

But I get an error where Maple claims it cannot see Geogebra. 

Any idea how to fix this?  

Hi Guys,

It might be a very basic question, but I am struggling with it for a quite a time.  I have an expression in a form of

f(x)=h(x)+g(x);

and I want to use factor operation elementwise, i.e., it can individually act on h(x) and can give me

f(x)=h1(x)*h2(x)+g1(x)*g2(x). But whenever I am putting factor operation with elementwise it is not giving me desired answer. It would be really helpful and great if someone can help me out.

I am attaching maple sheet for reference also.

Thanks in advance and regards

Sunit.
example.mw
Download example.mw

 

First 439 440 441 442 443 444 445 Last Page 441 of 2308