AmirHosein Sadeghimanesh

225 Reputation

7 Badges

9 years, 288 days

Social Networks and Content at Maplesoft.com

Finished Ph.D. in Applied Algebraic Geometry in Biology and did postdoc in Mathematics of Chemical Reaction Networks, University of Copenhagen. Another postdoc in Nonlinear Dynamics in the Mathematical Models of Cell Biology at University of Szeged. Currently a research fellow at Coventry University. Main interests; Applied and Computational Algebraic Geometry, Computer Algebra, Mathematical Biology, Chemical Reaction Network Theory, Population Dynamics. I'm also a language lover!

MaplePrimes Activity


These are questions asked by AmirHosein Sadeghimanesh

Very often it happens that using solve alone, gives huge expressions that can't be used. The simplest thing to do is to wrap it inside an evalf. But then sometimes, even your system only has real solutions, you may get some complex numbers. When this evalf(solve()) being used inside an algorithm, then disastrous consequences may arise! If the system consists of a single equation of a single variable, then you may have some more tools. But if you have a system of several equations in several variables, you have less options. I am mostly interested in polynomials, I know several approaches to use and code to solve and get only the real solutions, but my codes might be not very optimized. In Maple 2022, one predefined command which is nice is RootFinding:-Isolate but it has one issue and it is that this command only likes numeric coefficients which means integers, fraction of integers and float numbers, so no square root or other real numbers of this shape in the coefficients. I thought it might be a good idea to have a list of all solving commands in Maple that only return the real solutions or have the options to restrict to only real solutions. fsolve is not very ideal, because it only returns one solution.

For making a Maple package, an mla file, I were always using a same 4 lines code in a Maple worksheet and it was fine, but in Maple 2022 I receive an error message instead with the same 4 lines of code. Here is a simple example. Let's say I have a directory on my computer "C:\Home\Maple projects\Test_package", inside this directory I have one file "main.mpl" and a folder called "Functions" with a single file "Test.mm". The content of these two files are in below.

main.mpl

# This is just to test savelib at Maple 2022

unprotect('testSavelin');

testSavelib := module()
	option package;
	description "This is just a test.";
	export ModuleCopy, ModuleApply, ModulePrint;
	export Test;

kernelopts( includepath = currentdir() ):
$include "Functions\\Test.mm"

end module;

protect('testSavelib');

Test.mm

Test := proc( x :: integer )
	description "prints a message saying what integer you have given to this function.";
	printf("You have inserted the integer %d.\n", x);
end proc:

Now I open a Maple worksheet and do the followings.

kernelopts(includepath="C:\\Home\\Maple projects\\Test_package"):
read("C:\\Home\\Maple projects\\Test_package\\main.mpl");
LibraryTools:-Create("C:\\Home\\Maple projects\\Test_package\\test.mla");
savelib('testSavelib'," C:\\Home\\Maple projects\\Test_package\\test.mla ");

On previous versions of Maple the result would be a test.mla file with the testSavelib package in it. But in Maple 2022 I receive an error message instead, and the test.mla is an empty mla.

Error, could not open ` C:\Home\Maple projects\CAD project\test.mla \testSavelib.m` for writing

Here is a screenshot.

The timelimit command of Maple can be used to do a computation if it uses less than a given amount of time, otherwise generating an error message that can be cought by try ... catch. Now my question is that there exists any similar command, but with a limitation on memory usage, not the time usage. I don't mean what datalimit in kernelopts can does, because I am not going to limit the memory usage of the whole Maple session, but just a command which may be used inside a larger procedure etc.

Let's say I have an mpl file and in this file there are several lines $include<~/~/~.mpl> and in some of those called mpl files, there are also some more include lines. And assume the paths of these files are given relative to a specific folder. Now I guess this specific folder has to be mentioned by modifying includepath. But looking at the help pages related to includepath (here and here) I get this sentence "it can be modified by calling kernelopts(includepath)", but I tired typing things like kernelopts(includepath):="C:\\Homes\\testFolder"; and still I see "" for kernelopts(includepath);. How can I tell Maple to look for the files relative to this location either by typing something at the Maple worksheet before typing read("C:\\Home\\testFolder\\main.mpl); or by adding a line at my main mpl file?

We can write a list, set, MutableSet and array type together with their entries types. For example list(polynom) or array(array(integer)). But what about a table? For example how can I emphasize a type table with indices of the type integer and entries a list of integers? I was guessing table(integer,list(integer)) which is not working, so my guess is not correct. I tried some other combinations which they didn't work too. I can't see anything in the programming guide and the help of Maple or a post here that is addressing this question.

Example:

test:=table([1=[1,2,3],2=[6,5,4]]):
type(test,table(integer,list(integer))): # which of course is not working.

 

1 2 3 4 5 6 7 Last Page 2 of 11