Maple 2017 Questions and Posts

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

Why different between calculate two form? I use maple 2017

evalf(sech(20)^2); evalf(sech(-20)^2);
                                     
                       1.699341702 *10^ -17  
                                     
                       1.699341702 *10^ -17  
evalf(1-tanh(20)^2); evalf(1-tanh(-20)^2);
                               0.
                               0.

 

This may be a frequently asked question but I could not find

it in MaplePrime's archives.

 

The expression

z := (x^(a+1) - x^a)/(x-1);

(x^(a+1)-x^a)/(x-1)

should simplify to x^a. I don't know how to do that in Maple 2017.

I have tried all sorts of commands and assumption but none

worked.  For instance:

simplify(z) assuming x>1, a::posint;

(x^(a+1)-x^a)/(x-1)

What's the trick?

Hi, I use Maple 2017 on Windows 10 Pro. When I try to save a package that was included with the book entitled
"Finite Elements Using Maple - A Symbolic Programming Approach" by A. Portela and A. Charafi, Springer Verlag, Berlin, Heidelberg, 2002, with the line: "savelib('Plotter'):", maple return the error "Error, cannot open archive, C:\Program Files\Maple 2017\lib, for writing.". Someone can help me? Tank you.

Hi All,

I would like to generate a sequence (say 10) of points <x_i,y_i>. (i=1, 2,..,10.)

There is a predefined constraint like f(x_i,y_i)=0.01. And I don't know the close form of f() (becasue there is a intermediate parameter in f() that was caculated numerically by optimization.).

Is there any simple function, e.g. a variant of seq(), that can do this? I am looking for something looks like:

seq(f(x,y)=0.01, x=0..1, y=0..1, 0.1)

Thanks.

Hi,
First of all I am not an expert in using Maple. 
When I execute the following code, it runs without an error:
----------------
restart;  

with(plots):

g:=(x,y)->sin(((1+x^2+y^2))*(Pi/2)) ;                                                                            

 q:=(n,k,x)->binomial(n,k)*(((1+x)/2)^k)*((1-x)/2)^(n-k) ;                                                            

  K:=(n,m,x,y)->((1+n)/2)*((1+m)/2)*sum(q(n,k,x)*sum(q(m,j,y)*int(int(g(t,u),u=2*(j/(m+1))-1..2*((j+1)/(m+1))-1),t=2*(k/(n+1))-1..2*((k+1)/(n+1))-1),j=0..m),k=0..n);                                                                      

p1:=plot3d(g(x,y),x=-1..1,y=-1..1,color=blue):                                                                       p2:=plot3d(K(30,30,x,y),x=-1..1,y=-1..1,color=brown):                                                                    

display([p1,p2]);
---------
However, when I execute the following code,  I get the error message "to many levels of recursion"
---------
restart;                                                                                                                

with(plots):                                                                                                          

 g:=(x,y)->sin(Pi*(x+y))*(x^2+y^2);                                                                  

 q:=(n,k,l,x,y)->binomial(n,k)*binomial(n-k,l)*(((1+x)/2)^k)*(((1+y)/2)^l)*(1-((1+x)/2)-((1+y)/2))^(n-k-l) ;                                              K:=(n,x,y)->(((1+n)*(2+n))/4)*sum(sum(q(n,k,l,x,y)*int(int(q(n,k,l,t,u)*g(t,u),u=-1..-t),t=-1..1),l=0..n-k),k=0..n);  p1:=plot3d(g(x,y),x=-1..1,y=-1..-x,color=blue):                                                                      

 p2:=plot3d(K(1,x,y),x=-1..1,y=-1..-x,color=brown):                                                                  

p3:=plot3d(K(2,x,y),x=-1..1,y=-1..-x,color=yellow):                                                                

p4:=plot3d(K(5,x,y),x=-1..1,y=-1..-x,color=green):                                                                    

p5:=plot3d(K(10,x,y),x=-1..1,y=-1..-x,color=red):                                                              

   display([p1,p2,p3,p4,p5]);
--------
Could you please help me with this problem. Thanks in advance.

Hello Everybody!
Please help me to find a way to write the Taylor's series of some function in factiorial or Gamma notation.
Please see the attached file and suggest me something.
taylor_series_general.mw

I have the following pertubation problem I want to use maple to expand for me.

 

We have epsilon := eps;

x(t,eps):= x_{-1}(t)/eps+x_0(t)+x_1(t)*eps

z(t,eps):=z_{-1}(t)/eps+z_0(t)+z_1(t)*eps

I want to expand a Taylor series of the following function upto some arbitray order of eps, i.e O(eps^3) or higher (depending on my mood :-)), around t=0, f(x(t,eps),z(t,eps),cos(t/eps),sin(t/eps)).

 

Anyone has any suggestion how to use maple 2017.3 to do this?

Thanks!

 

 

I am trying to define a periodic piecewise function where essentially for every positive integer I have an output of '1' and the output is '0' everywhere else. I want to use this function in defining a Partial Differential Equation as well.

This is how I have been going about it after reading through the answers on similar questions posted before:

f := piecewise(t::posint, 1, 0_otherwise):
p := 1:
fperiodic := eval(f, t = t-p*trunc(t/p)):

But when I plot it to just as a test, I get a dead plot:
plot(fperiodic, t = 0 .. 5)

 


                     
I am hoping for something like:

Please help!
TIA

Hello,

     I've been using the invhilbert procedure from the inttrans package, but I'm running into a small problem. I'm attempting to apply invhilbert to an unknown function, and then later evaluate that function. However, in one particular case (bad, below), it does not produce the expected output. Curiously, I noticed that if I did *two* substitutions (good, below), it produces the expected result.

with(inttrans):

pde := inttrans:-invhilbert(f(t,s),s,x):
def := g = ((t) -> exp(t)*sin(B)):

bad := f = ((t,x) -> (1 + exp(t)*sin(B))*sin(x+A)):
good := f = ((t,x) -> (1 + g(t))*sin(x+A)):

eval['recurse'](pde, [good,def]);
# -cos(A) exp(t) sin(B) cos(x) + sin(A) exp(t) sin(B) sin(x) - cos(A) cos(x) + sin(A) sin(x)
eval['recurse'](pde, [bad,def]);
# -exp(t) sin(B) cos(x) + sin(A) sin(x) - cos(A) cos(x)

As a side-note: this discrepancy was very delicate. Removing any of terms (for instance, A) causes both to give the same, correct answer.

For this particular problem, I was able to manually replace exp(t)*sin(b) with the function g(t) and get the correct result, but I was hoping for a more automated approach (I need to apply it to many equations). Is there any way to get the correct result from equation bad?

Thank you very much!

Hello,

     I've been trying to figure out how to partially expand a trig function using the sum-rule but not the multiple-angle rule. For instance, I would like to expand

sin(2*x+3*y)

to

sin(2*x)*cos(3*y) + cos(2*x)*sin(3*y)

Unfortunately, expand also uses the multiple-angle rules, which is unwanted. The trigsubs command looked promising, but I don't know the names of the variables (x and y here) a priori, so I believe I need something with type matching (like applyrule with x::monomial + y::monomial).

Thanks for your help!

Hello,

     The following system of ODEs is handled correctly by dsolve, but PDEtools:-Solve raises an error:

ranking := [{A(), B(x)}]:
eqn_sys := {D(B)(x) = 0, A()* D(B)(x) = 0}:
dsolve(eqn_sys, ranking);
# {A() = A(), B(x) = _C1}
PDEtools:-Solve(eqn_sys, ranking);
#Error, (in dsolve) found many possible indications of the solving variables as [{B(x)}, [{A(), B(x)}]]

In particular, it seems the error is raised when 1) the ranking is a nested list and 2) at least one of the ranking elements is a function without any arguments.

Admittedly, this is a very strange case, but I did run into this earlier today. Of course, the example here is contrived (the nested-list ranking is completely unnecessary for this example), but it illustrates the error.

As a workaround, I found replacing the function A() with its name A in the ranking solves this problem (it can be left as a function in the system of equations). Nevertheless, I thought I would point this out as it seems dsolve handles this just fine even without the workaround, and presumably PDEtools/Solve should be able to as well.

This seems similar to a previous bug; this bug was fixed in Maple 2018. Unfortunately, I haven't updated yet, so I can't verify if the patch solves this problem as well.

Hello,

     So, dsolve is able to pass arguments through to casesplit. Further, PDEtools/Solve is able to pass arguments through to dsolve. However, it appears PDEtools/Solve isn't able to pass arguments through dsolve to casesplit? For instance, consider the following differential equation:

eq := {diff(A(t),t) = A(t)*x}:
dsolve(eq, {A(t)}, ivars={x,t});
PDEtools:-Solve(eq, {A(t)}, ivars={x,t});

Here, I'm considering both x and t to be independent variables (hence, A(t) should not depend on x).

In that case, dsolve correctly gives the only solution as A(t) = 0. However, PDEtools/solve doesn't seem to pass-through the ivars option and incorrectly gives A(t) = _C1*exp(x*t) as a solution.

Is there another way to have PDEtools pass this option through to casesplit?

Thanks!

Hello, when I write a large document block in maple and want to do some operations, maple shows wait cursor (hourglass) for 2-3 minutes again and again. I attached a sample file below. 

I found out when maple is installed , javaw.exe also instal and when I open bellow file, the javaw use 15% of cpu and this cause maple works slowly. 

the attached file is just an example for large document block and I undrestand that it can be simplified. I want to know how to handle large expressions generally?

K-Euler_Lagrange.mw

 

Hello people in mapleprimes,
I have two files: a batchfile named test.command, and a mpl file,
both in <<my home directory>>.

And, the codes written there are, for the test.command,

/Library/Frameworks/Maple.framework/Versions/2017/bin/maple test.mpl > output.txt

And, for the mpl file,

1+1;
diff(x^2,x);
int(x^3,x);

The test.command was made executable with chmod u+x  test.command, in advance.

From my home directory, I can run the test.command, and obtain output.txt with the result of the calculation of 
the mpl file. The above things have no problem. 

My question is a following.

When I moved the two files, the batch file and the mpl file, to /Users/myname/Desktop/maple_test, 
I cannot get maple to exhaust the appropriate output.txt but an error message, saying it could not read the mpl file.
What should be done to the contents of two files?

I hope you will teach me about this.

Thanks in advance.

taro

 

 

 

I tried to open Maple but it just won't launch it just stays in the loading screen but it doesn't load. I tried everything Uninstalled it and installed it again, uninstalled Java and installed it again, updated all my drivers but it just seems like it doesn't work. Please help if you can.

First 14 15 16 17 18 19 20 Last Page 16 of 40