Maple 2019 Questions and Posts

These are Posts and Questions associated with the product, Maple 2019

pde := diff(u(x, t), x $ 4) = diff(u(x, t), t $ 2);

iv:= subs(L = 100, {u(0, t) = 0, u(L, t) = 0, u(x, 0) = sin(x), D[2](u)(x, 0) = 2*x, D[1, 1](u)(0, t) = 0, D[1, 1](u)(L, t) = 0});

de := pdsolve(pde, iv, numeric):

sa1 := de:-value(output = listprocedure);

sa1:=[x=proc() ... end proc,t=proc() ... end proc,u(x,t)=proc() .. end proc]

    With the above procedure it works, but in the most compact form below it does not work.

pdsolve(pde, iv, numeric,output = listprocedure):

Error, (in pdsolve/numeric/par_hyp) invalid arguments for theta scheme: [output = listprocedure]
 

What is the solution to this error message when trying to run the Maple add-in for Excel?
"The specified module could not be found.  OpenMaple cannot find Maple engine library, maple.dll."

I am running Maple 19.1 and Excel 2016, both 32-bit, in Windows 7.  Excel appears to have successfully installed the Maple add-in.  For example, the Maple add-in icons appear on the Add-ins tab of Excel.  Excel shows the Maple add-in as active in the list of add-ins.  The location of he WMIMPLEX.xla is correct at "C:\Program Files (x86)\Maple\Excel\WMIMPLEX.xla.

Maple support tells me that Maple should add its "bin" folder to the PATH key for excel.exe in the registry key "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe\Path".  This path information, however, is not in my computer's registry.  This missing path information might be an obvious problem.  But what is the correct registry entry so that Excel knows where to find the Maple engine library maple.dll?

I tried adding the path to maple.dll in the environmental path variables of Windows 7, but that approach did not work.  I have uninstalled, rebooted, and reinstalled Maple 2019 (32-bit) several times.  Still the same error message.

Thanks.

with(PDEtools);
pde := diff(c(x, t), x, x) - h*diff(c(x, t), x) = diff(c(x, t), t):

iv := c(0, t) = 0, c(a, t) = 0, c(x, 0) = c0:

de := pdsolve([pde, iv], c(x, t), build);

                         de := ( )

Does anyone know how to solve this PDE?
Thank you,

Oliveira

      

Is there any way to place a command to the right of an expression to perform a task? Because I only know the way that puts the command to the right.A simple example:

w1 := simplify(sin(x)2 + cos(x)2);

                       w1:=1

w2:=sin(x)2+cos(x)2:-simplify;
             Error, invalid module reference

I wonder if there is a way to put the commands, also to the right of the expressions, as above.

Thank you,

Oliveira
   

Greetings!

I am trying to solve a system of equations involving several symbols. The answer I am getting involves rootof...
I have tried to fix it, and read several post on MP, but in vain. Please help me to get a solution which does not involve root of solutions. Coz the paper I am follwing has a very elegant solution to these equations which i am failed to obtain via maple.rootof.mw



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/rootof.mw .
 

Download rootof.mw

 

Most of the time, odetest() returns just zero if solution satisfies ode, and non-zero expression if solution does not satisfy ode.

So I was just checking for zero as return value to check if my solution was verified or not. This works for most cases.

But there are cases when odetest returns odetest/PIECEWISE` where some cases are zero and some are not.  Example is below.

For this, I still want to consider my solution as valid if one of the cases in piecwise is zero. But I am not sure what is a robust way to do this in code. Currently, I do the following

restart;
ode:=x*diff(y(x),x) = y(x)+2*(x*y(x))^(1/2);
my_sol:=y(x)=x*(ln(x/_C1)^2 - 1) - 2*(-1 + sqrt(ln(x/_C1)^2))*x;
res:=odetest(my_sol,ode);
if res<>0 then
   if type(res,'function') then #this meant to handle PIECWISE                      
      print("verified");
   else
      print("did not verify");
   fi;
else #if we come here, res=0, so I am sure it is valid.
   print("verified");
fi;

In the above, the check  type(res,'function')  is meant to catch PIECEWISE  return, since when I did type(res) Maple told me the type is function.

But I am not sure if this is a robust way to check for this, as it might be possible maple will return non zero, and also a function, but it will not be what I think it is (i.e. PIECEWISE) and then I would flag my solution as valid when it is not.

worksheet attached also.


 

restart;
ode:=x*diff(y(x),x) = y(x)+2*(x*y(x))^(1/2);
my_sol:=y(x)=x*(ln(x/_C1)^2 - 1) - 2*(-1 + sqrt(ln(x/_C1)^2))*x;
res:=odetest(my_sol,ode);
if res<>0 then
   if type(res,'function') then
      print("verified");
   else
      print("did not verify");
   fi;
else
   print("verified");
fi;

ode := x*(diff(y(x), x)) = y(x)+2*sqrt(x*y(x))

my_sol := y(x) = x*(ln(x/_C1)^2-1)-(2*(-1+sqrt(ln(x/_C1)^2)))*x

`odetest/PIECEWISE`([0, x/exp((-x+(x*y(x))^(1/2))/x) = _C1], [0, x/exp((x+(x*y(x))^(1/2))/x) = _C1], [-4*(-x^2*(-ln(x/_C1)^2+2*(ln(x/_C1)^2)^(1/2)-1))^(1/2), x/exp(-(-x+(x*y(x))^(1/2))/x) = _C1], [-4*(-x^2*(-ln(x/_C1)^2+2*(ln(x/_C1)^2)^(1/2)-1))^(1/2), x/exp(-(x+(x*y(x))^(1/2))/x) = _C1])

"verified"

 

 

Download how_to_check_odetest.mw

I use patmatch to look for certain expression inside a larger expression.

I find sometimes I need to repeat the same code to check for  "... + ..."   and also ".... * .....", since I do not know to tell Maple to look for + or * in the same code. *Luckily, I do not have to check for "-" or "/" operators, since "+" match with "-" and "*" match with "/").

An example will make things more clear.

Suppose I want to see if sin(x)*sqrt(x*y) has sqrt(x*y) anywhere in it. So I first try

restart;
expr:= sin(x)*sqrt(x*y);
if patmatch(expr,a::anything+(b::anything*x*y)^(c::anything),'la') then
    assign(la);
    if c =1/2 or c=-1/2 then
       print("found sqrt(x*y)");
    else
       print("did not find sqrt(x*y)");
    fi;
 else
   print("did not find sqrt(x*y)");
 fi;

And this fails, since I used "+" inside the patmatch. Then I try '*" instead

if patmatch(expr,a::anything*(b::anything*x*y)^(c::anything),'la') then

And now it does match.

What I'd like to write, is something like this (which ofcourse does not work)

if patmatch(expr,a::anything (* or +) (b::anything*x*y)^(c::anything),'la') then

I looked at conditional in patmatch, but it does not seem to apply for the above.

Any suggestions?

Maple 2019.1 on windows 10

 

most people who post here seem to use .mw written in 2D, which I do not like to use.

Is there a tool to convert such a file to 1D worksheet that one can use from the command line before opening the document itself in Maple?

The reason I ask, sometimes opening the original file and trying to do this from inside Maple by selecting the code using the mouse, then  Format->ConvertTo->1D   does not work, and gives an error.

Also, sometimes, when I try to first create an empty worksheet document, and then try to copy/paste the code from the other document over, it also does not work. This happens when there are syntax errors in the original document. The error that comes up is

        Parse:-ConvertTo1D, "first argument to _Inert_ASSIGN must be assignable"

As an example, please see the attached file in the following question

https://www.mapleprimes.com/questions/227506--I-Need-Help-Trying-To-Write-A-Code

It will good to have a tool that converts such documents to 1D worksheet or even plain Maple code (.mpl) but I did not see such option under SAVE AS either. Also, when I tried to export it as .mpl file, I get the same error as above in the file. So I gave up.

 

Hello Anybody can help me to write codes for PDE to solve by Galerkin finite element method or any other methods can be able to gain results? parameter omega is unknown and should be determined.

I attached a pdf file for more .

Thanks so much

fem2
 

"restart:  rho:=7850:  E:=0.193e12:  n:=1:  AD:=10:  upsilon:=0.291:   mu:=E/(2*(1+upsilon)):  l:=0:  lambda:=E*upsilon/((1+upsilon)*(1-2*upsilon)):  R:=2.5:  ii:=2:  J:=2:       m:=1:       `u__theta`(r,theta,phi):= ( V(r,theta))*cos(m*phi):  `u__r`(r,theta,phi):= ( U(r,theta))*cos(m*phi): `u__phi`(r,theta,phi):= ( W(r,theta))*sin(m*phi):  :        eq1:=(r (R+r cos(theta))^2 (mu+lambda) (((&PartialD;)^2)/(&PartialD;r&PartialD;theta) `u__theta`(r,theta,phi))+2 r^2 (mu+lambda/2) (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;r^2) `u__r`(r,theta,phi))+r^2 (mu+lambda) (R+r cos(theta)) (((&PartialD;)^2)/(&PartialD;phi&PartialD;r) `u__phi`(r,theta,phi))+mu (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;theta^2) `u__r`(r,theta,phi))+(((&PartialD;)^2)/(&PartialD;phi^2) `u__r`(r,theta,phi)) mu r^2-3 (R+r cos(theta))^2 (mu+lambda/3) ((&PartialD;)/(&PartialD;theta) `u__theta`(r,theta,phi))+2 r (mu+lambda/2) (R+2 r cos(theta)) (R+r cos(theta)) ((&PartialD;)/(&PartialD;r) `u__r`(r,theta,phi))-r^2 sin(theta) (mu+lambda) (R+r cos(theta)) ((&PartialD;)/(&PartialD;r) `u__theta`(r,theta,phi))-3 r^2 cos(theta) (mu+lambda/3) ((&PartialD;)/(&PartialD;phi) `u__phi`(r,theta,phi))-r mu sin(theta) (R+r cos(theta)) ((&PartialD;)/(&PartialD;theta) `u__r`(r,theta,phi))-2 (mu+lambda/2) (2 (cos(theta))^2 r^2+2 cos(theta) R r+R^2) `u__r`(r,theta,phi)+r `u__theta`(r,theta,phi) sin(theta) (3 r (mu+lambda/3) cos(theta)+R mu))/(r^2 (R+r cos(theta))^2):  eq2:=(2 (mu+lambda/2) (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;theta^2) `u__theta`(r,theta,phi))+r (R+r cos(theta))^2 (mu+lambda) (((&PartialD;)^2)/(&PartialD;r&PartialD;theta) `u__r`(r,theta,phi))+r (mu+lambda) (R+r cos(theta)) (((&PartialD;)^2)/(&PartialD;phi&PartialD;theta) `u__phi`(r,theta,phi))+r^2 mu (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;r^2) `u__theta`(r,theta,phi))+(((&PartialD;)^2)/(&PartialD;phi^2) `u__theta`(r,theta,phi)) mu r^2+3 (R+r cos(theta)) ((4 r (mu+lambda/2) cos(theta))/3+R (mu+lambda/3)) ((&PartialD;)/(&PartialD;theta) `u__r`(r,theta,phi))-2 r (mu+lambda/2) sin(theta) (R+r cos(theta)) ((&PartialD;)/(&PartialD;theta) `u__theta`(r,theta,phi))+r mu (R+2 r cos(theta)) (R+r cos(theta)) ((&PartialD;)/(&PartialD;r) `u__theta`(r,theta,phi))+3 r^2 sin(theta) (mu+lambda/3) ((&PartialD;)/(&PartialD;phi) `u__phi`(r,theta,phi))+(-3 r R (mu+lambda/3) cos(theta)+(-lambda-2 mu) r^2-R^2 mu) `u__theta`(r,theta,phi)-2 r (mu+lambda/2) sin(theta) R `u__r`(r,theta,phi))/(r^2 (R+r cos(theta))^2):  eq3:=(r (mu+lambda) (R+r cos(theta)) (((&PartialD;)^2)/(&PartialD;phi&PartialD;theta) `u__theta`(r,theta,phi))+r^2 (mu+lambda) (R+r cos(theta)) (((&PartialD;)^2)/(&PartialD;phi&PartialD;r) `u__r`(r,theta,phi))+mu (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;theta^2) `u__phi`(r,theta,phi))+r (r mu (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;r^2) `u__phi`(r,theta,phi))+2 r (mu+lambda/2) (((&PartialD;)^2)/(&PartialD;phi^2) `u__phi`(r,theta,phi))+(4 r (mu+lambda/2) cos(theta)+R (mu+lambda)) ((&PartialD;)/(&PartialD;phi) `u__r`(r,theta,phi))+mu (R+2 r cos(theta)) (R+r cos(theta)) ((&PartialD;)/(&PartialD;r) `u__phi`(r,theta,phi))-mu sin(theta) (R+r cos(theta)) ((&PartialD;)/(&PartialD;theta) `u__phi`(r,theta,phi))-r (3 sin(theta) (mu+lambda/3) ((&PartialD;)/(&PartialD;phi) `u__theta`(r,theta,phi))+`u__phi`(r,theta,phi) mu)))/(r^2 (R+r cos(theta))^2):  "

EQ1 := collect(eq1, cos(m*phi))/cos(m*phi)+rho*omega^2; EQ2 := collect(eq2, cos(m*phi))/cos(m*phi)+rho*omega^2; EQ3 := collect(eq3, sin(m*phi))/sin(m*phi)+rho*omega^2

(0.1788235818e12*r*(2.5+r*cos(theta))^2*(diff(diff(V(r, theta), r), theta))+0.2535718390e12*r^2*(2.5+r*cos(theta))^2*(diff(diff(U(r, theta), r), r))+0.1788235818e12*r^2*(2.5+r*cos(theta))*(diff(W(r, theta), r))+0.7474825716e11*(2.5+r*cos(theta))^2*(diff(diff(U(r, theta), theta), theta))-0.7474825716e11*U(r, theta)*r^2-0.3283200960e12*(2.5+r*cos(theta))^2*(diff(V(r, theta), theta))+0.2535718390e12*r*(2.5+2.*r*cos(theta))*(2.5+r*cos(theta))*(diff(U(r, theta), r))-0.1788235818e12*r^2*sin(theta)*(2.5+r*cos(theta))*(diff(V(r, theta), r))-0.3283200960e12*r^2*cos(theta)*W(r, theta)-0.7474825716e11*r*sin(theta)*(2.5+r*cos(theta))*(diff(U(r, theta), theta))-0.2535718390e12*(2.*cos(theta)^2*r^2+5.0*r*cos(theta)+6.25)*U(r, theta)+r*V(r, theta)*sin(theta)*(0.3283200960e12*r*cos(theta)+0.1868706429e12))/(r^2*(2.5+r*cos(theta))^2)+7850*omega^2

 

(0.2535718390e12*(2.5+r*cos(theta))^2*(diff(diff(V(r, theta), theta), theta))+0.1788235818e12*r*(2.5+r*cos(theta))^2*(diff(diff(U(r, theta), r), theta))+0.1788235818e12*r*(2.5+r*cos(theta))*(diff(W(r, theta), theta))+0.7474825716e11*r^2*(2.5+r*cos(theta))^2*(diff(diff(V(r, theta), r), r))-0.7474825716e11*V(r, theta)*r^2+3.*(2.5+r*cos(theta))*(0.1690478927e12*r*cos(theta)+0.2736000800e12)*(diff(U(r, theta), theta))-0.2535718390e12*r*sin(theta)*(2.5+r*cos(theta))*(diff(V(r, theta), theta))+0.7474825716e11*r*(2.5+2.*r*cos(theta))*(2.5+r*cos(theta))*(diff(V(r, theta), r))+0.3283200960e12*r^2*sin(theta)*W(r, theta)+(-0.8208002400e12*r*cos(theta)-0.2535718389e12*r^2-0.4671766072e12)*V(r, theta)-0.6339295976e12*r*sin(theta)*U(r, theta))/(r^2*(2.5+r*cos(theta))^2)+7850*omega^2

 

(-0.1788235818e12*r*(2.5+r*cos(theta))*(diff(V(r, theta), theta))-0.1788235818e12*r^2*(2.5+r*cos(theta))*(diff(U(r, theta), r))+0.7474825716e11*(2.5+r*cos(theta))^2*(diff(diff(W(r, theta), theta), theta))+r*(0.7474825716e11*r*(2.5+r*cos(theta))^2*(diff(diff(W(r, theta), r), r))-0.2535718390e12*r*W(r, theta)-1.*(0.5071436780e12*r*cos(theta)+0.4470589545e12)*U(r, theta)+0.7474825716e11*(2.5+2.*r*cos(theta))*(2.5+r*cos(theta))*(diff(W(r, theta), r))-0.7474825716e11*sin(theta)*(2.5+r*cos(theta))*(diff(W(r, theta), theta))-1.*r*(-0.3283200960e12*sin(theta)*V(r, theta)+0.7474825716e11*W(r, theta))))/(r^2*(2.5+r*cos(theta))^2)+7850*omega^2

(1)

#BCs can be from following
``
U(0, theta) = 0, (D[1](U))(0, theta) = 0, U(1, theta) = 0, (D[1](U))(1, theta) = 0

U(0, theta) = 0, (D[1](U))(0, theta) = 0, U(1, theta) = 0, (D[1](U))(1, theta) = 0

(2)

NULL
V(0, theta) = 0, (D[1](V))(0, theta) = 0, V(1, theta) = 0, (D[1](V))(1, theta) = 0
NULL
W(0, theta) = 0, (D[1](W))(0, theta) = 0, W(1, theta) = 0, (D[1](W))(1, theta) = 0
``

V(0, theta) = 0, (D[1](V))(0, theta) = 0, V(1, theta) = 0, (D[1](V))(1, theta) = 0

 

W(0, theta) = 0, (D[1](W))(0, theta) = 0, W(1, theta) = 0, (D[1](W))(1, theta) = 0

(3)

``


 

Download fem2

buchanan2005.pdf

 

 

I wanted to remove entry from a list that contain y=y or x=x in it. Here is an example

f:= (x-1)*y^4/(x^2*(2*y^2-1));
S:=[singular(f)]

Where I wanted to remove those entries highlighted above to obtain

This is below how I ended up doing it. I'd like to ask if there is a better or more elegent way. I had to use map, since could not get remove() to work on the original list in one shot. 

foo:= z->remove(has,z,{y = y,x = x});
map(foo,[singular(f)])

Which gives the output above.

Is there a better way to do this? I always learn when I find how to do something better.

Maple 2019.1

 

 

is the reason for Image result?


 

R+r__i*cos(`&theta;__j`)

R+(1.-0.750482401378084e-231*I)*r__i

(1)

``


 

Download cos

 

Are there commands in Maple to find the order and degree of an ODE?  Searching help I could not find anything so far.

For an example, given 

restart;
ode:=(1+diff(y(x),x)^2)^(3/2)=diff(y(x),x$2)

I want the command to return 2 for the order of the ODE and degree is also 2 in this case.

I looked at DEtools package and googled. I am sure Maple have build in commands to do this without me having to parse the ODE myself to find out.

 

 

so i just went from a really old version of maple to a the newest one maple 2019 and at first glance it doesn't seem to work correctly please take a look at the picture maybe there is a toggle i missed or something of the sorts thanks you for your time 

I have a tough integral I'm trying to solve (see attatched code). Maple seems to be able to compute it if I instruct it to integrate by parts, however the solutions don't make sense. For example, if I differentiate the result I expect to get my original integrand, but I do not. Furthermore, depending on which function you choose as 'u' and which as 'dv' when integrating by parts yields different results.

071319_Integral.mw

The attatched code has four examples:

1) Definite integration by parts

2) Indefinite integration by parts

3) Indefinite integration by parts, alternate choice of 'u'

4) Definite integration by parts, alternate choice of 'u'

and after each indefinite integration, I differentiate the result to compare with the orginal integrand.

What is going on here?

Hi,
I would like to trace periodic functions. I saw that this was possible with the old 'FourierSeries' package with the "Rept" command. How to reproduce the same thing in the Maple 19 environment? Thank you

fs_examples.mw

4 5 6 7 8 9 10 Page 6 of 12
´╗┐