Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Is there a command or method in Maple to list all initially protected names?

This page https://www.maplesoft.com/support/help/Maple/view.aspx?path=UndocumentedNames list undocumented protected names, and this page https://www.maplesoft.com/support/help/Maple/view.aspx?path=initialconstants  lists initially known names, which I assume are all protected.

But what about a list of all protected names? sin,cos, eval, uneval, etc.. any name that can't be assigned to. In my search so far, I could not find how to find these names. There are 100's of such names. Can one get them all in a list to look at?

Using Maple 2019.1

I want to solve the following system using PDE Solve command but finding an error. Please help me in this regard. Thanks!
 

 

restart; d1 := 1; d2 := 1; AA := 0.2e-2; BB := 0.79e-1; L := 1;
with(PDEtools, casesplit, declare);
PDE1 := diff(u(x, t), t) = d1*(diff(u(x, t), x, x))-u(x, t)*v(x, t)^2+AA*(1-u(x, t)); PDE2 := diff(v(x, t), t) = d1*(diff(v(x, t), x, x))+u(x, t)*v(x, t)^2-BB*v(x, t);
                      /  2         \                           
         d            | d          |                  2        
PDE1 := --- u(x, t) = |---- u(x, t)| - u(x, t) v(x, t)  + 0.002
         dt           |   2        |                           
                      \ dx         /                           

   - 0.002 u(x, t)
                          /  2         \                   
             d            | d          |                  2
    PDE2 := --- v(x, t) = |---- v(x, t)| + u(x, t) v(x, t) 
             dt           |   2        |                   
                          \ dx         /                   

       - 0.079 v(x, t)
IBC1 := {u(0, t) = 1, u(1, t) = 1, u(x, 0) = 1-(1/2)*sin(Pi*(x-L)/(2*L))^100}; IBC2 := {v(0, t) = 0, v(1, t) = 0, v(x, 0) = (1/4)*sin(Pi*(x-L)/(2*L))^100}; dys1 := {IBC1, IBC2, PDE1, PDE2};
         /              /  2         \                           
         | d            | d          |                  2        
dys1 := < --- u(x, t) = |---- u(x, t)| - u(x, t) v(x, t)  + 0.002
         | dt           |   2        |                           
         \              \ dx         /                           

   - 0.002 u(x, t), 

                /  2         \                                     
   d            | d          |                  2                  
  --- v(x, t) = |---- v(x, t)| + u(x, t) v(x, t)  - 0.079 v(x, t), 
   dt           |   2        |                                     
                \ dx         /                                     

   /                                                           100
   |                                        1    /1           \   
  < u(0, t) = 1, u(1, t) = 1, u(x, 0) = 1 - - sin|- Pi (x - 1)|   
   |                                        2    \2           /   
   \                                                              

  \   
  |   
   >, 
  |   
  /   

   /                                                       100\ 
   |                                    1    /1           \   | 
  < v(0, t) = 0, v(1, t) = 0, v(x, 0) = - sin|- Pi (x - 1)|    >
   |                                    4    \2           /   | 
   \                                                          / 

  \ 
  | 
   >
  | 
  / 
pds := pdsolve(dys1, numeric, time = t, range = 0 .. 1);
Error, (in pdsolve) invalid input: `pdsolve/numeric` expects its 2nd argument, IBCs, to be of type {list, set}, but received time = t
p1 := pds:-plot(t = 0, numpoints = 50);

p2 := pds:-plot(t = 1/8, numpoints = 50, color = blue);

p3 := pds:-plot(t = 1/4, numpoints = 50, color = green);

plots[display]({p1, p2, p3});
Error, `pds` does not evaluate to a module
Error, `pds` does not evaluate to a module
Error, `pds` does not evaluate to a module
Error, (in plots:-display) expecting plot structures but received: {p1, p2, p3}

Hi, Is there a way in which i can solve the following optimal control problem numerically with Maple ??

where P(t)=N(t)+S(t)+A(t) and N(0)=0.4897, S(0)=0.4018, A(0)=0.1085.

μ=0.000833, d=0.000666, ε1=0.0020, ε2=0.000634, β1=0.002453, β2=0.25*0.02, γ1=0.0048, γ2=0.25*0.02+0.00013, k1=1, k2=0.001, k3=0.99.

 where 

p1,p2,p3 are transversality conditions 

p1(60)=0 
p2(60)=0 
p3(60)=0

Answers and advice are very appreciated. 

Thank you all for reading.

Benz.

Hi MaplePrimes team,

 

If I assume a plot-based function or procedure C(s,t) and P1(t) are hidden in a package somewhere I don’t care about the type of geometry (spacecurve or plot3d). Now, I just want to animate P1(t) following the variable t. How do I do?

Example 1: Curve Animation in variable t

1. Equation

C := (s,t)-> Vector([cos(s), sin(s), t*s/2]):     #Helix shape as example

 

2. Plot

P1 := t-> display(spacecurve(C(s,t), s = 0..3*2*Pi, linestyle = solid)):

 

 

Example 2: Surface Animation in variable t

1. Equation

S := (x,y,t)-> Vector([x, y, t/(1 + x^2 + y^2)]):

2. Plot

P2 := t-> display(plot3d(S(x,y,t), x = -2..2, y = -2..2)):

 

If I assume the function or procedure S(x,y,t) and P2(t) are hidden in a package somewhere I don’t care. Now, I just want to animate P2(t) following the variable t. How do I do?

 

 

Example 3: Mixing Curve and Surface Animation in variable t

The ideal/”dream” basic syntax would be:

animate(display, [P1(t), P2(t)], t = t1..t2)

But it does not work.

 

Best.

Guy.

hi everybody:

I have two Maple files that file 1.mw file is a package and 2.mw file is based on the 1.mw file when running the 2.mw file I see the error and don't know how to solve it, I attach these files, thank you for helping me.

1.mw

2.mw

Could someone confirm if this is a problem in this sample application?

In 2019, in the folder 

    C:\Program Files\Maple 2019\samples\ProgrammingGuide\RandomnessTests

There is sample application. Opening the main module file RandomnessTests.mpl  and scrolling down a little bit to the include statements show

$include "WaldWolfowitz.mm"
$include "BitFrequency.mm"
$include "SequenceFrequency.mm"
$include "Compressibility.mm"
$include "BinaryRank.mm"
$include "Entropy.mm"

$include "Data.mm"
$include "Visualization.mm"

However, in the same folder, there is no Data.mm file. There is only Data.mpl file.

So how could this sample application work?  

This sample app have more problems. The file Visualization.mm  say

Data := module()
option package;
...

And the file Data.mpl has

Data := module()
....

This is all so confusing. Seems someone made some typos and not tested this app? Why put a sample application which makes learning packages in Maple more confusing?

ps. I did not yet try to figure how to locad it and run it myself, I was just browsing it.

 

 

I have the following expression

I would like to know if is it possible avoid negative exponent goes to denominator when I use expand().

Thank you!

 

 

 

 

 

 

Hi. I want to take Laplace transform from differential equation with the final condition(tf).   If the differential equations have initial conditions  it appears in Laplace (for example laplace transform of diff(u,t) is U-s*u(0) that u(0) is initial condition)but for final conditions or boundry conditions What to do ?my equation is
 

restart

with(inttrans)

[addtable, fourier, fouriercos, fouriersin, hankel, hilbert, invfourier, invhilbert, invlaplace, invmellin, laplace, mellin, savetable]

(1)

``

u is function of x,t and u(x(10),10)=0

u[1] := (1/2)*x^2*t; L1 := laplace(eq1, t, s)

(1/2)*x^2*t

 

eq1/s

(2)

u(x(10),10)=0; desired output u[1]=x^2(t-10)/2

s1 := u[1]; N[1] := (1/2)*(diff(s1, x))^2+x*(diff(s1, x)); ul[2] := laplace(N[1], t, s); u[2] := invlaplace(ul[2]/s, s, t)

(1/2)*x^2*t

 

(1/2)*x^2*t^2+x^2*t

 

x^2*(s+1)/s^3

 

(1/6)*x^2*t^2*(3+t)

(3)

I want to apply: u[2](x(10),10)=0

``


 

Download lap.mw

attached

Hi

I have an optimization problem subjects with a system of ordinary differential equations with initial conditions.

I would like to obtain u^star, x^star and y^star solution of my problem 

I prefer if possible we implement hamilton jacobi bellman if possible

 

Optimal_control_problem.mw

 

thanks

 

Hello. I am building a graph and specify the axis titles. The 'y' label is to the left of the axis. Is it possible to move it somehow? I want to put it above the axle (in this case it was over 100)

plot(ff(x), x = 0 .. 10, color = black, labelfont = [TIMES, 19], thickness = 1, size = [1200, 600], axes = boxed, linestyle = 5, labels = ['x', 'y'], axis = [gridlines = [20, color = black]])

Maple always starts a new document with a 2D input style and Times New Roman font. How to change the boot style? (default).
Oliveira

whats wrong with the codes while running the codes in maple 13 it will take memory and time as 41.80M, 9.29s while the same code is running in maple 18 it will take 1492.38M , 911.79s

Why the same codes take different time and memory. The codes are here

 

 

restart:
Digits:=15:
d1:=0.2:d2:=0.6:L1:=0.2:L2:=0.2:F:=0.3:Br:=0.3:
Gr:=0.2: Nb:=0.1:Nt:=0.3:B:=1:B1:=0.7:m:=1:k:=0.1:
Ro:=1:R1:=1:q:=1:alpha:=Pi/4:
h:=z->piecewise( z<=d1,    1,
                 z<=d1+L1,   1-(gamma1/(2*Ro))*(1 + cos(2*(Pi/L1)*(z - d1 - L1/2))), 
                        z<=B1-L2/2,  1 ,          
                    z<=B1,  1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),
                 z<=B1+L2/2,  R1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),
                 z<=B,    R1):
A:=(-m^2/4)-(1/4*k):
S1:=(h(z)^2)/4*A-ln(A*h(z)^2+1)*(1+h(z)^2)/4*A:
a2:=Int((1/S1),z=0..1):
b2:=Int((sin(alpha)/F),z=0..1):
c2:=(1/S1)*(-h(z)^6/(6912*A)-h(z)^4/(9216*A)+h(z)^2/(4608*A^3)+ln(1+A*h(z)^2)*(h(z)^6/(576*A)+h(z)^4/(512*A^2)-1/(4608*A^4))):
c3:=Int(c2,z=0..1):
c4:=2*Gr*(Nb-Nt)*c3:
e2:=(1/S1)*(-7*h(z)^4/(256*A)-h(z)^2/(128*A^2)+ln(1+A*h(z)^2)*(3*h(z)^4/(128*A)+h(z)^2/(32*A^2)+1/(128*A^3))):
e3:=Int(e2,z=0..1):
e4:=2*(Nt/Nb)*Br*e3:
l1:=-a2:
l2:=-b2-c4+e4:
Dp:=q*l1+l2:

igRe:=subsindets(Dp,specfunc(anything,Int),
                         u->Int(Re(op(1,u)),op(2,u),
                                   method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igRe,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
     adaptive=false,
     legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
     linestyle = [solid,dash,dot],
     color = [black,black,black],
     labels=[gamma1,'Re(Dp)'],
     gridlines=false, axes=boxed);

igIm:=subsindets(Dp,specfunc(anything,Int),
                         u->Int(Im(op(1,u)),op(2,u),
                                   method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igIm,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
     adaptive=false,
     legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
     linestyle = [solid,dash,dot],
     color = [black,black,black],
     labels=[gamma1,'Im(Dp)'],
     gridlines=false, axes=boxed);
 

 

why do solve and fsolve have different results?

solve-fsolve.mw

I have to solve the equation rH''(r)+H'(r)+(rk^2-r^2*b^2/R^2)=0 where k, b, and R are real constant positive number, with condition H(R)=0 and H(1/R)=R to be solved into series of power. I know from the literature that xy''+y'+xy=0, can't be solved in terms of elementary function(see G.Nagy-ODE-November 29, 2017) that's why I'm interested in an approximate solution based on series, or any results as long as it satisfied the too condition H(R)=0 and H(1/R)=R of the real function H(r). 

Please advice!.

I want to find one option of coodiantes of vertices A, B, C of the triangle ABC, knowing that coordinates centre of circumcircle is O(0,0) and length of sides are 3, 5, 7. 
How can I get the result?

First 531 532 533 534 535 536 537 Last Page 533 of 2097