MaplePrimes Questions

in my program, I need to generate plot of solution. I only know where the initial condition x value is. So I give to plot the x range as some value around that initial condition location. But this is not perfect, since the command line script will fail if Y value happend to be too large somewhere in this range due to singularity. (This fails only in the command line print driver, not in the worksheet GUI).

I can ofcource limit the y range also, using view=[....] but I do not know how to pick best Y range  automatically in the program to show what is interesting in the plot without doing lots of analysis on the expression.

There is something called smartview which is supposed to be active by default. But it does not seem to be working too well.

Here is an example. This function blows up at value near x=Pi  due to singularity. and I want the plot to automatically limit the Y range without having to specify manually the y view.

restart;
sol:=exp(-3^(1/2)*(cos(x)-1)/sin(x)):
plot(sol,x=0..2*Pi);

So clearly "smartview" did not do it or I am not using it correctly. But it is supposed to be "active"? 

Compare the same thing with Mathematica Plot where this  is handled automatically by Plot

sol = Exp[-3^(1/2)*(Cos[x] - 1)/Sin[x]];
Plot[sol, {x, 0, 2*Pi}]

Again, I know I can do the following in Maple

plot(sol,x=0..2*Pi,view=[default,-1..20]);

The problem is that I am doing this in a program, which only gets an expression as function of x to plot, around some x location. So hard to decide what the right Y range is. It will best if Plot can determine the best view automatically.

How to use smartview to handle this? Or are there other alternative plot options for such cases?

Is there a build-in package for Maple where I can do binomial test ? single tail and two tailed? If n and p are known?

The command line print driver is still broken in Maple.  Same code works OK in the worksheet, but gives error in command line.

restart;
p:=plot(sin(x),x=0..3,axesfont=[12,12]);
full_file_name:=cat("C:\\TMP\\tmp.ps");
plotsetup(ps,plotoutput=full_file_name);
print(p);   
plotsetup(default):

No problem in the worksheet.  When putting the above code in file t.mpl and running it from DOS command line, it gives this error

>"C:\Program Files\Maple 2021\bin.X86_64_WINDOWS\cmaple.exe"  t.mpl

    |\^/|     Maple 2021 (X86 64 WINDOWS)
._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2021
 \  MAPLE  /  All rights reserved. Maple is a trademark of
 <____ ____>  Waterloo Maple Inc.
      |       Type ? for help.
> p:=plot(sin(x),x=0..3,axesfont=[12,12]):
> full_file_name:=cat("C:\\TMP\\tmp.ps");
> plotsetup(ps,plotoutput=full_file_name);
> print(p);

Error, invalid FONT specification

> plotsetup(default):
> quit

The fix is to remove axesfont=[12,12] from the plot command.

Is this known bug in Maple 2021.1 on windows 10?

ans:=6 *a[0]+2 *k^2 *b[1]*x^2 *y+k^2 *b[1] *y *lambda+6* k^2 *b[2]* x^3 *y-c *b[1] *x* y-2* c* b[2] *x^2 *y-c *b[2] *y *lambda+(6 *b[2]^2 *x^4 *lambda)/(lambda^2 *sigma+mu^2)+(6 *b[2]^2 *x^2 *lambda^2)/(lambda^2 *sigma+mu^2)+(6 *b[1]^2 *lambda* x^2)/(lambda^2 *sigma+mu^2)-12 *a[0] *b[2] *x *y-12* (a[1] . x)* b[2] *x* y-12* (a[2] . (x^2)) *b[2] *x* y+(6 *b[1]^2 *lambda^2)/(lambda^2 *sigma+mu^2)+k^2 *(a[1] . (-2 *x* (mu* y-x^2-lambda)-mu *x* y))+2 *k^2* (a[2] . ((mu* y-x^2-lambda)^2+x* (-2 *x (mu* y-x^2-lambda)-mu *x* y)))+c (a[1] . (mu *y-x^2-lambda))+2 *c (a[2] . (x *(mu *y-x^2-lambda)))+5* k^2 *b[2] *x *y *lambda-(c *b[2] *lambda^2 *mu)/(lambda^2 *sigma+mu^2)+(12 *b[1] *lambda *b[2] *x^3)/(lambda^2 *sigma+mu^2)+(12 *b[1] *lambda^2 *b[2] *x)/(lambda^2 *sigma+mu^2)-(12 *b[1]^2 *lambda *mu* y)/(lambda^2 *sigma+mu^2)+(k^2 *b[1] *lambda^2 *mu)/(lambda^2* sigma+mu^2)-12 *a[0] *b[1] *y-12* (a[1] . x) *b[1] *y-12* (a[2] . (x^2)) b[1] *y-6 *a[0]^2-12 *a[0] *(a[1] . x)-12 *a[0]* (a[2] . (x^2))-6* (a[1] . x)^2-12* (a[1] . x) *(a[2] . (x^2))-6* (a[2] . (x^2))^2-(2 *k^(2)* b[1] *lambda* mu^2 *y)/(lambda^2 *sigma+mu^2)+(k^2 *b[1] *lambda *mu *x^2)/(lambda^2 *sigma+mu^2)+(6* k^2 *b[2] *lambda *mu *x^3)/(lambda^2 *sigma+mu^2)+(6* k^2 *b[2] *lambda^2 *mu *x)/(lambda^2 *sigma+mu^2)+(2* c *b[2] *lambda *mu^2* y)/(lambda^2 *sigma+mu^2)-(c *b[2] *lambda* mu* x^2)/(lambda^2 *sigma+mu^2)-(12 *b[2]^2 *x^2 *lambda* mu* y)/(lambda^2 *sigma+mu^2)-(12* k^2 *b[2] *lambda* mu^2 *x *y)/(lambda^2 *sigma+mu^2)-(24 *b[1] *lambda *b[2] *x *mu* y)/(lambda^2 *sigma+mu^2)+6* (a[1] . x)+6* (a[2] . (x^2))+6 *b[2] *x *y+6 *b[1] *y;


P1 := coeff(coeff(ans, x, 4), y, 0);


Error, unable to compute coeff

Sometime, answer is coming sometine not.

2. Also, if one wants to substitute the value of x^2=t^2+5, in x^3 then why it is giving the ans.

Thank you very much!

I create and use the variable e (for elementary charge) often in my work.  I recently upgraded from version 2019 to version 2021 .  My workbooks now show the following warning when I run anything using my e vaiable.

Warning, if e is meant to be the exponential e, use command/symbol completion or palettes to enter this special symbol, or use the exp function
 

Is there a way to turn off this warning?  It is very annoying and a bit embarassing when I demo anything.

Thanks

Hi Maple Users,

Microsoft is enticing me to upgrade to Windows 11 from 10 for free. I am a bit hesitant because I don't know if Maple 2021 will continue working as well as in Windows 10. Does anyone have any thoughts or wisdom to share.

Thank you.

So this is my integral and I need to determine the recursion formula (using maple's integration by parts) and then calculate In: 
∫ 1/(x^2+1)^n 𝑑𝑥

Thanks in advance!

i have this differential equation of order 4 that i have problem with solving it,

when ever i try solving it using maple the answer comes like this [  ] with nothing inside.

the differntial equation is: u'''' - sin x u'' + uu' - u=-1-sinx.

and the inital values are: u(0)=2, u'(0)=0,u''(0)=-1,u'''(0)=0.

if you got the answer can you send the code in maple so i can try it and see where i did wrong.

How do i get to the 2nd line for a multiple problem? 

Run these codes

with(inttrans)

y := t -> invlaplace(exp(-s)/s, s, t)

The following gives correct answer

y(t - 1)

The following gives junk answer

y(t - 1.1)

and I cannot plot added shifted signals in time domain if their shifts are not integer numbers. Maple goes into infinite calculation loop.

I am trying to calculate numerically a triple integral of a function (see below). However I could not get a result. I stopped the calculation after one hour of evaluation. One of the integral is from 0 to infinity and uses NAG d01amc. The 2 other integrals have finite bounds and use NAG _d01ajc. I also tried to use maple default integration algorithms for the 2 finite bounds integrals but without success. in the following xs, ys, zs, k, k_0, x, y, rho_0 and d are real numbers. k_m, rho_me, nu_m are complex numbers. The variable sof integration are k (from 0 to +infinity), x (from -1 to +1) and y (from -1.5 to 1.5). Here is the Maple script. restart; Digits := 15; nu_0 := sqrt(k^2 - k_0^2); nu_m := sqrt(k^2 - k_m^2); pref2 := 2*rho_me*exp(-nu_0*(zs + z))*BesselJ(0, k*sqrt((xs - x)^2 + (ys - y)^2))*k/(rho_me*nu_0 + rho_0*nu_m*tanh(nu_m*d)); (evalf@Int)(eval(0.5*Re(`~`[evalf@Int]((Re + Im*I)(eval(pref2, [z = 0, k_0 = 0.018371886863098, xs = 0, ys = 0, zs = 10, rho_0 = 1.2, d = 0.04, rho_me = 1.528516816439260 - 1235.297048886680*I, k_m = 0.490806242885258 - 0.490314205803914*I])), k = 0 .. infinity, epsilon = 0.1*10^(-5), method = _d01amc)), [z = 0, k_0 = 0.018371886863098, xs = 0, ys = 0, zs = 10, rho_0 = 1.2, d = 0.04, rho_me = 1.528516816439260 - 1235.297048886680*I, k_m = 0.490806242885258 - 0.490314205803914*I]), [x = -2/2 .. 2/2, y = -3/2 .. 3/2], epsilon = 0.1*10^(-5), method = _d01ajc); Thanks for the help.

Hi All!  New to MapleSIM and working on a program help my FIRST Robotics team start using MapleSIM.  I am looking for any presentation material already created, directed at high school kids.

Appreciate any links to presentation material I can repurpose for them.  

Cheers,

Andy 

In the worksheet below is an equation for non-Euclidean lines. How can Maple plot these?

NonEuclideanLines.mw

Recently I saw a heated discussion on this post:https://www.mapleprimes.com/questions/233026-Write-Output-Of-For-Loop-To-txt-File

In Carl Love  's answer, I felt the power of adjacency matrix of graph. I carefully read maple's function to generate non IsomorphicGraphs:  NonIsomorphicGraphs. There was one passage that I thought was really interesting.

selectform = graph, adjacency, or bits
This specifies the form used for a graph when it is being passed to the select procedure. The forms are identical to those for outputform, but note that adjacency and bits are the most efficient forms, while graph is only reasonable for a relatively small number of comparison operations (1000 or less), as it needs to form a Graph for every comparison. Note also that when selectform=adjacency the same read-only Matrix is internally used to pass the data for every call to reduce overhead. This is not possible with a Graph structure.

I never quite understood what the advantage of this bits was. At least according to the help documentation, we have  to do many works to do to convert this into a adjacency matrix of graph.

[NonIsomorphicGraphs(8, output = graphs, restrictto = regular[2])]

bit := Vector[row](Bits:-Split(210256131, bits = (8*(8 - 1))/2));
M := Matrix(8, 8, shape = symmetric, datatype = integer[1]);
M[1, 2 .. 8] := bit[1 .. 7];

M[2, 3 .. 8] := bit[8 .. 13];

M[3, 4 .. 8] := bit[14 .. 18];
M[4, 5 .. 8] := bit[19 .. 22];

M[5, 6 .. 8] := bit[23 .. 25];

M[6, 7 .. 8] := bit[26 .. 27];
M[7, 8 .. 8] := bit[28 .. 28];
M;

From adjacency matrix of graph,  we can diractly get a lot of information about the graph, like edges, and the number of closed walks of a particular length, but from bits , what imformation of graph we can get?

If we have to convert it to an adjacency matrix fist, maybe it's a little bit more complicated from above long codes. At least there isn't a more efficient way to convert?

Hi,

I am generating several random weighted graphs using the following code:

with(GraphTheory):
with(RandomGraphs):
G:=RandomGraph(10,20,connected):
G1:=AssignEdgeWeights(G,5..25):
DrawGraph(G1,showlabels=true,stylesheet=[edgecolor=blue,weightfont = [times,bold,11]])

By default weight labels appear to be positioned at the midpoint of each edge. Is there a way to change that positioning?

Thanks!

4 5 6 7 8 9 10 Last Page 6 of 2070