DuncanA

698 Reputation

8 Badges

15 years, 144 days

MaplePrimes Activity


These are replies submitted by DuncanA

@gtavictor From the limited information you have provided, it's impossible for me to know exactly why Maple doesn't give the answer you expect, but my guess is that you may need to use unapply more than once to get the answer you expect.  In the example you gave, if x is also a function then you will need to define it as such, e.g., 

x := y -> 3*y;

If you post your longer equations I may be able to be more helpful.

I don't understand why this has received down votes.  It's a good solution.

---

Duncan

I don't understand why this has received down votes.  It's a good solution.

---

Duncan

@supersav144 There are various ways of achieving the desired result.

Index R using a sequence of integers, for example:

min(select(type, [seq(R[i], i=1..25)], 'positive'));

or

min(select(type, [R[i] $ i = 1..25], 'positive'));

 

Select from all of R using

min(select(type, R, 'positive'));

 

Select from a range of values in R:

min(select(type, R[2 .. 24], 'positive'));

@supersav144 There are various ways of achieving the desired result.

Index R using a sequence of integers, for example:

min(select(type, [seq(R[i], i=1..25)], 'positive'));

or

min(select(type, [R[i] $ i = 1..25], 'positive'));

 

Select from all of R using

min(select(type, R, 'positive'));

 

Select from a range of values in R:

min(select(type, R[2 .. 24], 'positive'));

@madsanthon I used a perl script I wrote myself (see attached).  XML::Parser is one of the standard packages installed with perl and I think OS X already has perl installed so you should be able to use this script if you need to. The file extension was originally .pl, but the uploader doesn't allow .pl files to be uploaded so I added the .txt extension.

xml_parser.pl.txt

@madsanthon I used a perl script I wrote myself (see attached).  XML::Parser is one of the standard packages installed with perl and I think OS X already has perl installed so you should be able to use this script if you need to. The file extension was originally .pl, but the uploader doesn't allow .pl files to be uploaded so I added the .txt extension.

xml_parser.pl.txt

Are you selecting landscape mode from within Maple?

---

Duncan

The value returned by the procedure equals the final statement executed so if the two return statements are removed and 

eval(L), eval(U);

is added as the last line then matrices L and U will be returned.

---

Duncan

The value returned by the procedure equals the final statement executed so if the two return statements are removed and 

eval(L), eval(U);

is added as the last line then matrices L and U will be returned.

---

Duncan

evalc is Maple's symbolic evaluator for complex numbers and produces the results you require

z := 1 + I * omega * tau;
evalc(abs(z));
                                            (1/2)
                           /         2    2\
                           \1 + omega  tau /     
evalc(argument(z));
                            arctan(omega tau, 1)

 

---

Duncan

evalc is Maple's symbolic evaluator for complex numbers and produces the results you require

z := 1 + I * omega * tau;
evalc(abs(z));
                                            (1/2)
                           /         2    2\
                           \1 + omega  tau /     
evalc(argument(z));
                            arctan(omega tau, 1)

 

---

Duncan

If N is assumed to be an integer prior to the calls to sum then the desired result will be achieved without calling simplify.

> assume(N::integer);
> sum(sin(2*Pi*i/N), i = 1 .. N);
                                      0
> sum(sin(2*Pi*i/N)^2, i = 1 .. N);
                                     1
                                     - N
                                     2  
---

Duncan

Ali Hassani, from your email:

"I used gc() to free the occupied memory. kernelopts(gcbytesreturned) showed that about 3 Gb of memory is released. I also invoked "forget" procedure to remove the table remember of all procedures, however any memory was not freed in windows task manager. another reason for being not freed any memory is that the virtual memory of windows which became active (bacause of lacking memory) is yet active after invoking gc(). I am confused. Please guide me."

I don't know the exact details of the internal workings of the maple memory system so the following is speculative.

Calling gc() frees up memory that has been allocated but is no longer in use. This doesn't mean that the freed memory is returned to the operating system (e.g., Windows), but it will prevent Maple from requesting more memory from the operating system which may have to use virtual memory to satisfy the request.

Other options for memory intensive programs are to use the Classic Worksheet interface or the Command-line interface.

"The Classic Worksheet provides a basic worksheet environment for older computers with limited memory. The Classic Worksheet is available on 32-bit Windows and 32-bit Linux platforms."

"The Command-line version does not include graphical user interface features, but this method is recommended when solving very large complex problems or using scripts for batch processing."

"To access the Command-line version in UNIX or Macintosh, use the maple command.  In Windows, use the cmaple command."

?versions  

---

Duncan

Ali Hassani, from your email:

"I used gc() to free the occupied memory. kernelopts(gcbytesreturned) showed that about 3 Gb of memory is released. I also invoked "forget" procedure to remove the table remember of all procedures, however any memory was not freed in windows task manager. another reason for being not freed any memory is that the virtual memory of windows which became active (bacause of lacking memory) is yet active after invoking gc(). I am confused. Please guide me."

I don't know the exact details of the internal workings of the maple memory system so the following is speculative.

Calling gc() frees up memory that has been allocated but is no longer in use. This doesn't mean that the freed memory is returned to the operating system (e.g., Windows), but it will prevent Maple from requesting more memory from the operating system which may have to use virtual memory to satisfy the request.

Other options for memory intensive programs are to use the Classic Worksheet interface or the Command-line interface.

"The Classic Worksheet provides a basic worksheet environment for older computers with limited memory. The Classic Worksheet is available on 32-bit Windows and 32-bit Linux platforms."

"The Command-line version does not include graphical user interface features, but this method is recommended when solving very large complex problems or using scripts for batch processing."

"To access the Command-line version in UNIX or Macintosh, use the maple command.  In Windows, use the cmaple command."

?versions  

---

Duncan

1 2 3 4 Page 2 of 4