## Applying a function to nested elements

by: Maple
A poster on the usenet group comp.soft-sys.math.maple asked how to do the following more simply:
```A:={ { [1,2],[3,4] } , { [5,6],[7,8] } }:
map(x->map(y->map(f,y),x),A);

{{[f(1), f(2)], [f(3), f(4)]}, {[f(5), f(6)], [f(7), f(8)]}}
```
As has been discussed here recently, this can be readily done using evalindets. For example,
```evalindets(A, list, integer, f);
{{[f(3), f(4)], [f(1), f(2)]}, {[f(5), f(6)], [f(7), f(8)]}}
```

## Sorting Lists of Lists of Small Integers

by: Maple
John Fredsted asks whether there is a built-in method in Maple for lexically sorting a list of lists of small positive integers. There is not, however, Robert Israel provided two methods for accomplishing the task. The first uses the standard technique for extending Maple's `sort` procedure, that is, assigning a boolean-valued binary function and passing it to `sort`. The second method that Robert provided is ingenious. Here it is, in full,
```Ls:= map(convert,L,bytes):
Ls:= sort(Ls, lexorder):
map(convert,Ls,bytes);
```

It converts each list into a string, sorts the strings, then converts the strings back to lists. This method is significantly faster than the previous. It does, however, have a limitation; it can only operate on lists with positive integers in the range 1..255. While that limitation was suitable for the original poster's application, that will not always be the case.

## Maple vs Excel Addin - Elliptic Integrals

by:
I have been trying to replicate the results of an analysis which uses elliptic integrals of the first and second kind (see an earlier post titled "Solve This! - Elliptic Integrals" for a copy of the analysis and a Maple worksheet that plots an equation containing an ellipitc integral). Dr. Israel provided the Maple commands that generate the plot; however, the results are not in agreement with the paper - not even close! In an attempt to validate the EllipticF(z,k) command in Maple, I have generated a spreadsheet (attached) which uses an EllipticAddin to generate a table of values for a range of phi from 1 to 45 degrees and theta over the same range. As you can see from the workbook, the Addin has successfully generated a table that is in perfect agreement to five decimal places with the results given on page 94 of "Elliptic Integrals", 1st Edition, by Harris Hancock, Wiley & Sons, 1917 (available in PDF format from Google). The sheet that uses the EllipticF(z,k) command is not in good agreement with the table from Hancock's publication.

## Strange bug with sum an evalf

by:
I could not find any place to submit bug reports to Maplesoft, so I'll post this here:

## long equation

by: Maple
Dear Sir: In worksheet mode, I got an evaluation result which has a very long equation. The maple display it just on one line so that the result is displayed over window bound. I want to set it up to display the result on multiline. So, it is easy to look at my result without moving my mouse. Could you tell me how to set it up? Thanks in advance.

## Infinite summation problem ... direct comparison...

by:
So I get this to calculate correctly: sum(1/n, n = 2 .. infinity); And the result is infinity - which is obviously correct. but the following does not give me a result ... sum(1/ln(n), n = 2 .. infinity); what is the trick - do i need to assume something here ? thanks, dp

## Ordering a list of lists

Consider, just a test example, the following list of lists of positive integers ordered ascendingly
```L := [[1,2,7,12],[3,4,5,6],[1,2,5,9]];
```
I would like this list of lists ordered so that [1,2,5,9] precedes [1,2,7,12], because 5 < 7 (the first two elements being equal), and [1,2,7,12] precedes [3,4,5,6], because 1 < 3. I think you see the general scheme. That can be achieved with the following code:
```with(ListTools):
swapLists := proc(L1::'list'(posint),L2::'list'(posint))
local L;
L := MakeUnique(L1-L2);
if L = [0] then
false
elif L[1] <> 0 then
```

## Attributes and unevaluation quotes

In connection with setting attributes on Arrays, as discussed here, I have run into a problem which boils down to the following: why does the code (which is only for test purposes)
```p1 := proc(x,y)
table(['x' = x,'y' = y])
end proc:
p2 := proc()
local x,y;
x,y := 1,2;
table(['x' = x,'y' = y])
end proc:
p1(1,2);
p2();
```
produce two different outputs; the former, p1, evaluates 'x' and 'y', even though they are surrounded by unevaluation quotes, while the latter, p2, does not?

## matrix

by:
When using matrix with real (non integers) coefficients, maple does significant mistakes. Does somebody knows why?

## Disagreement with Maple

by:
I present the following:
``````[> restart;
[> a1:= foo = bar;
a1 := foo = bar
[> a2:= blam = foo = bar;
Error, `=` unexpected
[> a3:= blam = a1;
a3 := blam = (foo = bar)
``````
The fact that the definition of `a2` (correctly) throws an error and the definition of `a3` does not can lead to some odd errors down the way. I disagree with Maple's choice not to say that the assignment of `a3` is in error.

## Problem: Array ordering for coordinates

by:
Ok, I'm now using maple 11, previously i was using maple 8. I'm trying to define a coordinate array, in this case i do this by setting the array, Coords:=({x,y,z}); however maple 11 now seems to change the ordering of the array. giving as output: Coords := {y, z, x} How do I make it stay as x,y,z????? Why would it do this??

## The Maple T.A. Content Center

by:

Maplesoft just launched a brand new section to our website, the Maple T.A. Content Center. This is a new site that contains great content that can be used in Maple T.A. The content center co-exists alongside the Maple Application Center as a dedicated location for Maple T.A. Content.

You will find content that can be dropped in for Drill & Practice, Homework and Testing, all in different subject areas. You can also access Maple T.A. Tips & Techniques as well as Maple T.A. Documentation & How-Tos.

Users can also submit their own content to the database. Once you have submitted content, it is easy for you to edit the content through the new My Content page which also lists any Maple Applications or Books that you have contributed to Maplesoft.com.

## Interesting numeric bug

by:
The student is supposed to use the logistic differential equation given to them (with carrying capacity `.52e12`), `dsolve()` the differential equation with a specific initial condition, and then calculate the population at 3 different times. Notice what happens:
``````
[> restart;
[> my_deq := (diff(P(t), t))/P(t) = .789*(1-P(t)/(.52*10^12));

d
-- P(t)
dt                               -11
my_deq := ------- = 0.789 - 0.1517307692 10    P(t)
P(t)

[> dsolve({my_deq,P(2290)=.83*10^10});
``````

## Editing before any replies

Why is it not possible to edit the root-post of a thread before anyone has replied to it? I ask, of course, because sometimes, despite proofreading, I overlook typos or bad grammar (being Danish, the latter is quite often a bit difficult to avoid), or because I simply want to add additional material that comes to mind after having posted.

## Recent posts

In the column "Replies" of "all recent posts" it is indicated whether there have been submitted new posts to the topic since the last login/visit. Could such a thing be implemented also for the "my recent posts"? If affirmative, I think it would make it easier not to overlook any post which needed ones attention.
 First 206 207 208 209 210 211 212 Last Page 208 of 291
﻿