Maple 2021 Questions and Posts

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

Hi,

    here a problem when i solve equations.i guess solve lost a root.how can i do.


An_unexpected_solve_bug_.pdf
Download An_unexpected_solve_bug_.mw

I'm having an issue with MacOS Big Sur 11.4 recognizing a package from saved documents. The package works great from new documents! 

Specifically: 
I've followed the instructions on 
https://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet/reference/initialization
to add  a .mapleinit
file to my user home directory under MacOS Big Sur 11.4

The .mapleinit file has code as follows to run the VLA package: 
VLAlibpath := "/VLA/library/":
libname := `VLAlibpath`, libname:
and I have the VLA package files with the library inside of it in my home directory too. 

When I open a new Maple document and run and use the package, it works just fine! 

The problem though is that if I save the Maple file and reopen it, it will no longer recognizes the package. I get: 
Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received VLA

It is very odd since the file still recognizes the libname just fine:
libname;   "VLA/library/", "/Library/Frameworks/Maple.framework/Versions/2021/lib"

The workaround is to copy and paste into a new document and start a fresh but that is obviously not ideal. 

Any ideas? It is a really really old package, but great for visualization.

Thanks,
Sarah

Hi,

I am using Maple in Document mode and I want to print my worksheet. Is there a possibility to show the page margins as an overlay so that I can adjust the lines of my worksheet in order to avoid automatic breaks making the print difficult to read?

Hi,

I have a function of 3 variables (PiM) which I can use in plot3d given the first argument while the other two arguments are functions of the two variables I use in plot3d.

In the code I attached below, I am plotting 2 planes using plot3d, but I cannot implicitplot where these two planes intersect. COuld you please take a look at my code?

Thanks.

maple_primes_question.mw

 

 

Hi,

Is there a way to change the font type and size when printing a table of data using DocumentTools:-Tabulate? Also can I change the column width?

DocTabFont.mw

I can't figure this one out.

I need to pick out the subexpression   anything*sin(3*x) from an expression.

it works, when the expression is   anything*sin(3*x)+something else. But when the expression is exactly  anything*sin(3*x) then select returns and not anything*sin(3*x) as I was expecting.

So I must be doing something silly, but do not see it.

restart;
TypeTools:-AddType('type_1', '`*`'({anything,identical(exp(3*x))}));
expr:=25*A[1]*exp(3*x);
type(expr,type_1);

returns true. good. Now I test it on 

select(type,expr+sin(x),type_1) ;

and this returns what is expected. 25*A[1]*exp(3*x) but when I type

select(type,expr,type_1) ;

it return

reading select help page did not help.  Tried flatten, inplace.

I can do this using patmatch

patmatch(expr,a::anything*exp(3*x),'la');la

But why is select not working in the above? What is the correct way to do this so it works for a*expr+anything and also for a*expr only? This is done inside a function and not interactive. So I need it to work for both cases, since the input can be anything, but I only need the term anything*exp(3*x) pulled out.

 

I want to have a proc, which returns an expression using an indexed symbol. The proc needs to basically generate constansts to use to build an expression, similar to how dsolve uses _Cn.  But I do not want to use _Cn for this so not to confuse the expression with another one that was generated using _Cn already.

So I thought to use a local symbol say A.  (I could have used _Zn also, but I think _Z is also used by Maple).

The symbol A is first declared local to the proc, and then the proc returns the expression using A[n]. For example  A[0]*x+A[1]*x^2 etc... The number of A[n]'s is not known before hand, but should not be more than 10. 

I want to make sure that A[n] returned is really part of the local symbol and not different symbol to avoid clash with any global A[n] 

When I do the following check

restart;
foo:=proc()
 local A;
 return A[99]
end proc;

expr:=foo()

type(expr,`global`)

gives

good. So Maple says that A[99] is not global. But when I do

type(expr,`local`)

it also says false!

My question is: When making local A , will A[1] and A[2] also be local, or are they different symbols? Maplemint says nothing about it, so I assume A[n] is local also?

maplemint(foo)
Procedure foo() 
  These local variables were used but never assigned a value:  A

It did not say that A[99] was never declared local. This tells me that A[99] is local, because A is local. But then why did type(expr,`local`)  say false?

Hi,

I was wondering why each time solve is executed, I get a different of number of solutions and can I specify the number of solutions?

 

Thanks so much for taking time to answering this question.

 



Maple Worksheet - Error

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

I don't way the above error happened. But here is my worksheet below.

Download number_of_solutions.mw

Given an expression, how to best find the constants _C1, _C2, etc.... in this expression?  Currently I do the following, but I think there should be a better way.

restart;
sol:=dsolve(diff(y(x),x$2)+y(x)=1);
indets(sol);
select(x->`if`(type(x,symbol) and convert(x,string)[1..2]="_C",true,false),indets(sol))

The above works, at least on the few examples I tried it on, but is there a better way to do it?  All constants will have the form _Cn where n is integer. 

 

 

Why is this integral so difficult -- so slow to execute?

seq(evalf(Int(1/R*sinh(s*coth(1/2*s))^(2*I/k)/(gam-I*k*cosh(s))^5*
     Int(exp(-(k^2*sinh(s)^2/(gam-I*k*cosh(s))-I*k*(1+cosh(s)))*v)*
     hypergeom([1/k*I],[1],k*v*I)*v^n,v = 0 .. 1/2*R), s=0..s_max)), n=0..1);

Hints to improve the efficiency of execution would be appreciated.

The conversion of a maple formula in latex version 2021 produces some

commands which are not defined , see   primes_latex.mw.

Perhaps more informations should be given  in the news about the command latex in Maple 2021

Hello

I need to find all the variants (I am not sure if this is the correct term to be used but I hope this will be clear in the example) of a specific indeterminate in a given expression.  Here is an example:

alpha[3, 5]*xi[1]*xi[8] + alpha[3, 5]*xi[4]*xi[5] + alpha[3, 3]

For this particular example, xi[1], xi[8], xi[4], and xi[5] are the variables I am looking for. The indexes of xi change depending on the previous calculation.  Also, in some cases, I need the alpha variables instead, that is, alpha[3,5], and alpha[3,3].  

I could not figure out how to use indets in this case.

Many thanks for your help. 

I may be misunderstanding the documentation of implicitplot.  Can someone set me straight?

This is extracted from the implicitplot's help page:

implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. x);

The plotting range is limited to y ≤ x, as intended.  Let us verify that it does the right thing:

display(
	implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. x, color=red),
	plot(x, x=0..2, color=blue)
);

Yes, indeed it does.

Now let us try limiting the plotting range to y ≤ 1 − x2. Here is what we get:

display(
	implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. 1-x^2, color=red),
	plot(1-x^2, x=0..2, color=blue)
);

I expected the red curve to lie entirely below the blue curve but it doesn't. Am I misunderstanding implicitplot?

Download worksheet: mw.mw

Sorry to bother you with a basic question again.

How do I get both the indexes and the values of a table?

Table.mw

 

The following code completes apparently without error on Maple 2020.2, but with Maple 2021.1 I get a deconnection from the kernel:

restart:
with(LinearAlgebra):
A:=Statistics:-Sample(Normal(0,1),[2500,2500]):
U,S,Vt:=SingularValues(A,output=['U','S','Vt']):
Norm(U.DiagonalMatrix(S).Vt-A);

The crash occurs when running the last line.

The code works on both versions with a smaller matrix (256x256).

Is there something obviously wrong with this piece of code, or a change in Maple 2021 that could explain this?

Note: I'm running Maple on Windows 10, the machine has 16 GB RAM, and the memory usage stays low.

First 29 30 31 32 33 34 35 Last Page 31 of 40