acer

33064 Reputation

29 Badges

20 years, 174 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

restart;

kernelopts(version);

     Maple 2017.2, X86 64 LINUX, Jul 19 2017, Build ID 1247392

eq:=-44.51913564*sinh(sqrt(x))*x^5*sin(sqrt(x))*cos(0.6232678986e-1*x)
+5.872275982*x^(11/2)*cosh(sqrt(x))*sin(sqrt(x))*cos(0.6232678986e-1*x)
+5.872295982*x^(11/2)*sinh(sqrt(x))*cos(sqrt(x))*cos(0.6232678986e-1*x)
-0.1e-5*x^6*sinh(sqrt(x))*sin(sqrt(x))*cos(0.6232678986e-1*x)
+11465.08352*x^6*cosh(sqrt(x))*cos(sqrt(x))*cos(0.6232678986e-1*x)
-0.10000e-4*x^(11/2)*sin(sqrt(x))*cos(sqrt(x))*cos(0.6232678986e-1*x)
+.1246535797*cosh(sqrt(x))*x^4*cos(sqrt(x))*cos(0.6232678986e-1*x)
+158.9969129*x^(9/2)*sinh(sqrt(x))*cos(sqrt(x))*cos(0.6232678986e-1*x)
-94.84329962*cosh(sqrt(x))*x^5*cos(sqrt(x))*sin(0.6232678986e-1*x)
-0.2e-2*x^7*sinh(sqrt(x))*sin(sqrt(x))*sin(0.6232678986e-1*x)
+0.4000e-2*x^(13/2)*cosh(sqrt(x))*sin(0.6232678986e-1*x)*sinh(sqrt(x))
+0.10000e-4*x^(11/2)*cosh(sqrt(x))*sinh(sqrt(x))*cos(0.6232678986e-1*x)
-158.9969129*cosh(sqrt(x))*x^(9/2)*sin(sqrt(x))*cos(0.6232678986e-1*x)
+38209.64552*sinh(sqrt(x))*x^6*sin(sqrt(x))*sin(0.6232678986e-1*x)
-3761.932636*x^(13/2)*cosh(sqrt(x))*sin(sqrt(x))*sin(0.6232678986e-1*x)
-3761.924636*x^(13/2)*sinh(sqrt(x))*cos(sqrt(x))*sin(0.6232678986e-1*x)
-0.4000e-2*x^(13/2)*sin(sqrt(x))*cos(sqrt(x))*sin(0.6232678986e-1*x)
-2.*10^(-7)*x^(13/2)*cosh(sqrt(x))*sin(sqrt(x))*cos(0.6232678986e-1*x)
-11465.08352*x^6*cos(0.6232678986e-1*x)+.1246535797*x^4*cos(0.6232678986e-1*x)
-94.84329962*x^5*sin(0.6232678986e-1*x)+0.1e-5*x^6*cosh(sqrt(x))^2*cos(0.6232678986e-1*x)
-0.1e-5*x^6*cos(sqrt(x))^2*cos(0.6232678986e-1*x)+0.3e-5*cosh(sqrt(x))^2*x^6*sin(0.6232678986e-1*x)
-0.2e-2*x^7*cos(sqrt(x))^2*sin(0.6232678986e-1*x)+0.2e-2*x^7*cosh(sqrt(x))^2*sin(0.6232678986e-1*x)
+2.*10^(-7)*x^(13/2)*sinh(sqrt(x))*cosh(sqrt(x))*cos(0.6232678986e-1*x)
+2.*10^(-7)*x^(13/2)*cos(sqrt(x))*sin(sqrt(x))*cos(0.6232678986e-1*x)
-2.*10^(-7)*x^(13/2)*sinh(sqrt(x))*cos(sqrt(x))*cos(0.6232678986e-1*x)
+1.159305284*10^5*cosh(sqrt(x))*x^(11/2)*sin(sqrt(x))*sin(0.6232678986e-1*x)
-1.159305284*10^5*x^(11/2)*sinh(sqrt(x))*cos(sqrt(x))*sin(0.6232678986e-1*x)
-8.359616334*10^6*x^7*cosh(sqrt(x))*cos(sqrt(x))*sin(0.6232678986e-1*x)
+8.359616334*10^6*x^7*sin(0.6232678986e-1*x) = 0:

#plot(lhs(eq),x=0..0.2,-1e-7..1e-7);

Digits:=10:
rt[1]:=0.0:
for i from 1 to 5 do
  rt[i+1]:=RootFinding:-NextZero(unapply(lhs(eq),x), rt[i]);
end do:
convert(rt,list);

     [0., 0.04191897329, 0.1445773188, 22.37101613, 50.40561001, 61.67210358]

Digits:=10:
op(sort(simplify({RootFinding:-Analytic(eq,x=0-0.1*I..100+0.1*I)},zero)));

     0., 0.04191897312, 0.1445773137, 22.37101614, 50.40561000, 61.67210360

Digits:=20:
op(sort(simplify({RootFinding:-Analytic(eq,x=0-0.1*I..100+0.1*I)},zero)));

     0., 0.041918973291358269200, 0.14457731887993756592, 
     22.371016133870070862, 50.405610019621053775, 61.672103588567668205

posroots.mw

You could use the explicit location of the .mpl file in the script file, eg,

/Library/Frameworks/Maple.framework/Versions/2017/bin/maple /Users/myname/Desktop/maple_test/test.mpl > output.txt

Note that output.txt may still appear in the directory from which you call test.command , but that may be what you want.

Select the whole visible inlined Input/Output with the mouse cursor. Then from the main menubar choose Edit->Document Blocks->Toggle Input/Output Display.

That lets you switch between showing just the Input or the Output, for the selected inlined item. So you can switch back to the Input display, for further editing.

You may have to still delete the extra `=` sign between the inlined Input and Output.

 

There's probably something easier.

As you say, N and the numbers R[p], for p=1..N will be supplied.

restart;

N:=7;

for p from 1 to N do
  R[p]:=rand(2..4)();
end do;
                             N := 7
                           R[1] := 2
                           R[2] := 4
                           R[3] := 4
                           R[4] := 3
                           R[5] := 2
                           R[6] := 3
                           R[7] := 3

i:='i': j:='j':
S:=op(eval(subs(_seq=seq,[foldl(_seq,F(seq('i'[j],j=1..N)),seq(i[p]=1..R[p],p=1..N))]))):

nops({S}) = mul(R[p],p=1..N);
                           1728 = 1728

I doubt any of these would work in Maple 8 or earlier.  But I might be remembering wrongly.

restart;

d_string:="D*e*v*o*u*r*e*r":

Typesetting:-mrow(Typesetting:-mn(cat(`Does `,d_string,` = `)),Typesetting:-mo("η"));

"Does D*e*v*o*u*r*e*r = eta"

cat(`#mrow(mn(`,`"Does `,d_string,` = "`,`),mo("η"));`);

`#mrow(mn("Does D*e*v*o*u*r*e*r = "),mo("η"));`

nprintf( "#mrow(mn(\"Does %s = \"),mo(\"&%a;\"));", d_string, eta );

`#mrow(mn("Does D*e*v*o*u*r*e*r = "),mo("η"));`

 

Download typ.mw

I expect that you could do it using textplot and the SYMBOL font, on a 2D plot, though.

This is interpolating in just one direction. You could change the method from cubic to linear, if you want. Let me know if this isn't adequate.

restart;

M:=ExcelTools:-Import(cat(kernelopts(homedir),"/mapleprimes/O233.xlsx")):

op(1,M);

290, 59

plots:-listplot(M[150,..],view=1500..1600,size=[400,200]);

L:=[seq(i,i=1..59)]:

A,B:=selectremove(p->M[100,p]<10,L):
A;

[32, 33]

R:=CurveFitting:-ArrayInterpolation(B,M[100,B],A,method=cubic);

[HFloat(1584.1946296296264), HFloat(1573.5070370370522)]

V:=Vector(59):
V[B]:=M[150,B]:
V[A]:=<R>:

plots:-listplot(V,view=1500..1600,size=[400,200]);

restart;

M := ExcelTools:-Import(cat(kernelopts(homedir),"/mapleprimes/O233.xlsx")):
m,n := op(1,M);

290, 59

final := copy(M):

L := [seq(i,i=1..n)]:
for j from 1 to m do
  A,B := selectremove(p->M[j,p]<10, L):
  R := CurveFitting:-ArrayInterpolation(B,M[j,B],A,method=cubic);
  final[j,A] := <R>:
end do:

plots:-surfdata(M,view=1520..1600,orientation=[-10,80,0]);

plots:-surfdata(final,orientation=[-10,80,0]);

You can also compare, using the above,
plots:-surfdata(M,view=[default,0.45..0.6,1520..1600],orientation=[30,60,0]);
plots:-surfdata(final,view=[default,0.45..0.6,1520..1600],orientation=[30,60,0]);

interp_ex.mw

I had this problem ( error message about GL3bc -> GL4bc mapping) with Maple 2017.3 on a Linux Ubuntu 17.10 machine with an Nvidia video card.

I believe that indicated an OpenGL problem (in my case used by Maple 2017's Java GUI).

It was fixed by switching from the default X.org video drivers to the Nvidia proprietary driver.

Use the global name :-param , with uneval quotes, in the call to foo2.

foo1 := proc( {param:={}}, $)
  foo2(':-param'=param):
end proc:

foo2 := proc( {param:={}}, $)
end proc:

foo1('param'=1);

It turns out that this works, in at least Maple 2017.2 and Maple 2018.0,

solve({exp(2*sin(t))-1=0, 0 <= t,t <= 16}, real, AllSolutions, Explicit);

         {t = 0}, {t = Pi}, {t = 2 Pi}, {t = 3 Pi}, {t = 4 Pi}, {t = 5 Pi}

AFAIK the real option is currently documented only as part of the ?solve,parametric functionality, which is for polynomial equations. So it's unclear why that extra option makes a difference for this example. There is murkiness in how solve is dealing with this extra option.

Here's one way:

Student:-Calculus1:-Roots(exp(2*sin(t))-1=0, t=0..16);

          [0, Pi, 2 Pi, 3 Pi, 4 Pi, 5 Pi]

Try closing the right-side context-panel.

You could look at some rough procedures I wrote for this kind of thing in this old posting. Those simply insert a translation of the subregion, though, and the inlined magnification window doesn't get its own axes and tickmarks.

If you really want axes and tickmarks in the magnified portion then you could try building it with an image (or an exported and reimported subplot).  See this old posting for some rough code I wrote for that. Another variant for that kind of thing is here. Newer versions of Maple allow for directly placing an image (or a subimage) on the background of a plot, and the answers in those two old postings could likely be revamped and done more cleanly now (and without any recourse to densityplot, say). Perhaps I can find time to modernize it.

@sand15 Attached is what I get when I re-execute your worksheet in Maple 2015.2 for 64bit Linux.

Tabulate_Issue_2015.2.mw

I get the legends displayed whether or not I have Tools->Options->Display->"Automatically display legends in 2-D plots" toggled. I get the legends displayed whether or not I remove the original all output from the Worksheet before re-executing. That's all as expected.

When I open your .mw file in an external editor I do see the property legendvisibility=false on the 2-D plots in the Task regions that DocumentTools:-Tabulate embeds. And when I open your .mw file in Maple 2015.2 the legends are not displayed (until I re-execute).

Your attachment is marked as Maple 2015.0. It's possible that the behavior you see is due to a bug fixed in the point-release. Do you want to try 2015.2? (The installed for that point-releasee is available for download from here.)

For a univariate problem the method=branchandbound option instructs Optimization:-Maximize to use a global optimization approach.

(Yes, this contradicts the claim given in other Answers that Optimization is only ever attempts local optimization.)

restart;
with(Optimization):
app:=x->0.14546e-1*sin(3.141592654*x)+(-1)*0.50512e-2*sin(6.283185308*x)+0.19918e-2*sin(9.424777962*x):
ex:=x->evalf(-AiryAi(2^(2/3)*x)*(5*3^(5/6)-9*AiryBi(2^(2/3))*GAMMA(2/3))/(8*AiryAi(2^(2/3))*3^(5/6)-8*AiryBi(2^(2/3))*3^(1/3))-AiryBi(2^(2/3)*x)*(9*AiryAi(2^(2/3))*GAMMA(2/3)-5*3^(1/3))/(8*AiryAi(2^(2/3))*3^(5/6)-8*AiryBi(2^(2/3))*3^(1/3))+(1/4)*x^3+3/8):

Maximize(100*(abs(app(x)-ex(x))), x = 0 .. 1);
         [0.0715496606611132, [x = 0.414027159609182]]

Maximize(100*(abs(app(x)-ex(x))), x = 0 .. 1, method=branchandbound);
          [0.183847185739178, [x = 0.923034175928753]]

As you can see, the following involves quite a bit of hand-holding.

restart;

interface(showassumed=0):

pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0:
f:=x-> piecewise(x>0 and x<1/2, 2*x, x>1/2 and x<1, 2-2*x):
bc:=u(0,y)=0,u(1,y)=0,u(x,0)=f(x),u(x,2)=f(x):
sol:=pdsolve([pde,bc],u(x,y)) assuming x>0,y>0;

u(x, y) = Sum(-8*sin((1/2)*n*Pi)*sin(Pi*x*n)*(exp(Pi*n*(3*y-4))-exp(Pi*n*(3*y-2))+exp(Pi*n*(y-2))-exp(Pi*y*n))*exp(-2*Pi*n*(y-2))/(Pi^2*n^2*(exp(4*n*Pi)-1)), n = 0 .. infinity)

temp1:=simplify(expand(sol));

u(x, y) = -8*(Sum(-sin((1/2)*n*Pi)*sin(Pi*x*n)*(exp(Pi*y*n)+exp(-Pi*n*(y-2)))/((exp(2*n*Pi)+1)*n^2), n = 0 .. infinity))/Pi^2

temp2:=subsindets(temp1,'specfunc(Sum)',
                  u->Sum(simplify(numer(op(1,u))/(exp(n*Pi)*2))
                         /simplify(convert(denom(op(1,u))/(exp(n*Pi)*2),trigh)),
                         op(2..,u)));

u(x, y) = -8*(Sum(-(1/2)*sin((1/2)*n*Pi)*sin(Pi*x*n)*(exp(Pi*y*n)+exp(-Pi*n*(y-2)))*exp(-n*Pi)/(n^2*cosh(n*Pi)), n = 0 .. infinity))/Pi^2

solnew:=subsindets(temp2,'specfunc(Sum)',
                   u->Sum(thaw(combine(subsindets(expand(convert(op(1,u),trigh)),
                                                  'specfunc({sin,cos})',freeze))),
                          op(2..,u)));

u(x, y) = -8*(Sum(-sin((1/2)*n*Pi)*sin(Pi*x*n)*cosh(Pi*n*y-Pi*n)/(n^2*cosh(n*Pi)), n = 0 .. infinity))/Pi^2

simplify( combine( convert( sol - solnew, expln ) ) );

0 = 0

 

Download pdesol_comp.mw

First 187 188 189 190 191 192 193 Last Page 189 of 343