dharr

Dr. David Harrington

7720 Reputation

22 Badges

20 years, 234 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@Adam Ledger Do you have a file "F:/test.txt" already existing on your system?

Try FileTools[Status]("F:/test.txt");

If you get file or directory doens't exist, then it is a problem with finding the file. If it can find it, it will give you the permissions for that file.

displayprecision=4 on Maple 2015 gives 4 decimal places, and in Maple 2017.3 gives 4 significant places as you say. But the 2017.3 help page for interface (and the options menu setting) say that it should give 4 decimal places. So it seems as though the behaviour in 2017 is an anomaly compared with earlier and later versions and not as intended.

I don't have a fix, other than precede every output you want formatted by evalf[4](...).

@shimaa sadk 

I didn't attempt to understand the algorithm, so really don't understand what you want. You can leave the range 0..infinity and it will be slower. If you can make a narrower range estimate it might go faster.

[0,-1,x^3,0,sin(x), (1/2)*Pi,undefined,20,undefined,20,undefined,50,undefined,50,undefined]

0 for less than -1

x^3 between -1 and 0

sin(x) between 0 and Pi/2

undefined between Pi/2 and 20

undefined between 20 and 20, i.e., at 20: the undefined for x>Pi/2 apparently wins over the 5 at x=20 to resolve the conflict

undefined between 20 and 50 (from the x>Pi/2)

undefined between 50 and 50, i.e., at 50

undefined above 50

This does highlight that keeping 5 on your list may not be right if you want to remove all the undefined parts since Maple thinks it is undefined at x=20 and not 5. I guess the message is to be careful not to have two possible values at a point.

@Carl Love @tomleslie

 zip also works with different lengths, so zip(`+`,a,b,0) rather than a+~b

@sand15 See the Bits package for bitwise operations.

If you insert a table, for example 3x3, and put some math containers in the cells, then you (or the user) can select and drag to resize in a way in which the row heights automatically resize and there is some retention of the relative positions of the embedded components. Doesn't seem to resize column widths, though the user can move the cell boundaries to do this. I haven't played much with this, so there may be table/component options which help you with this. You can hide the table borders using table/properties/Interior (or Exterior) borders, so your user doesn't see them, but they still help with alignment.

Using a for loop to sum the terms backwards (smallest to largest) gives essentially the same error as 'add', i.e., an error of 1e-15.

In general, I expect Maple to have some algorithm, specified or not, that gives an answer within 1 or 2 in the last digit consistent with Digits. Since we know summing forward is problematic, I would trust that Maple has thought of that.

KahanSum2.mw

@Markiyan Hirnyk My implication, as stated in my earlier comment and my use of the word "partly", is that this is one term of the "standard solution" given by the OP. This is Maple's standard response for product separation of variables solutions, and only in some cases does it go further to produce the sum. I guess the user is expected to work it up as required.

@Markiyan Hirnyk  I agree it is not the general solution, but is a solution for the bc given. I agree _C4 is superfluous and there is no _C3, but that is what is produced!

@nm  This was version 2017.3. kernelopts(version) reports `Maple 2017.3, X86 64 WINDOWS, Sep 27 2017, Build ID 1265877` and Physics:-Version() reports "C:\Program Files\Maple 2017\lib\update.mla", `2017, September 27, 12:53 hours`.

I was looking for the solution for the specific boundary condition you gave, and one term of the Fourier series works here. If you try pdsolve without the b.c. but with the hint, then you are given the two odes to solve, which I assume can be worked up to one term of the Fourier series; the general solution is a sum of these which I think you won't get without more bc/ic conditions. The "What's new" help under PDEs suggests general series solutions can be obtained for some pdes.

@nyarko 

it has the form sqrt(a^2+b^2), so there isn't an obvious answer here, If you think about a and b as the adjacent and opposite sides of a right triangle, then the sqrt is the length of the hypotenuse, which could be written a/cos(theta), where theta = arctan(b/a), but this is hardly a simple form.

@_Maxim_ I agree - it is very confusing. At least I can now understand how to make it work it all cases, for lists. I agree also that is doesn't seem to be documented. I had only ever used the multiple range notation for rtables, so had never attempted it for lists before.

Basically, a[1..3] being equivalent to a[[1,2,3]] rather than a[1,2,3] is already strange.

@_Maxim_  Took me a while to figure this out, since I at first couldn't explain m[1..2,2].

restart;

Consider first selecting multiple non-sequential elements from a list

a:=[q,w,e,r,t];

[q, w, e, r, t]

(1)

We cannot select elements 1,2 and 4 by 1,2,4 becuase that is reserved for nesting.

a[1,2,4];

Error, invalid subscript selector

 

But we can do this by

a[[1,2,4]];

[q, w, r]

(2)

Now the case in point

m := [[1, 2], [3, 4]];

[[1, 2], [3, 4]]

(3)

 m[[1,2]][2] first finds m[[1,2]], which is elements 1 and 2 in the list (the whole list) and then takes its second element

m[[1,2]];
m[[1,2]][2];

[[1, 2], [3, 4]]

 

[3, 4]

(4)

Accessing nested ones can be done by

m[1][2];
m[2][2];

2

 

4

(5)

or by the equivalent notation

m[1,2];
m[2,2];

2

 

4

(6)

And the range is 1..2 as the first selector means both of these  

m[1..2,2];

[2, 4]

(7)

Similarly for the second selector

m[1,1..2];
m[1][1];
m[1][2];

[1, 2]

 

1

 

2

(8)

 


 

Download indices.mw

@David1 An Array has 4 operands: indexing function, dimension ranges, contents, options, which you can see by

op(sols)  or individually by op(1,sols) etc,

though there is no indexing function in this case.

First 69 70 71 72 73 74 75 Page 71 of 78