acer

32490 Reputation

29 Badges

20 years, 7 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@nerdpole Try it as,

alpha := unapply(piecewise(
    x1 < 0 or x2 < 0 or x3 < 0 or h < x1 or h < x2 or h < x3, 0,
    0.5*h  ..... )),x1,x2,x3);  

with inserting the (x1,x2,x3) -> yourself.

@nerdpole Try it as,

alpha := unapply(piecewise(
    x1 < 0 or x2 < 0 or x3 < 0 or h < x1 or h < x2 or h < x3, 0,
    0.5*h  ..... )),x1,x2,x3);  

with inserting the (x1,x2,x3) -> yourself.

@Doug Meade You could try Chapter 16 of the Maple 16 Programming Guide.

@Doug Meade You could try Chapter 16 of the Maple 16 Programming Guide.

Sorry to the audience, if it is obvious, but there is also the possibility to use a combination of `read` and .mla library archives.

The documented source code -- including comments, and structured with $include or related directives -- could be kept in a plaintext file. A simple shell script, or even a very short worksheet, could then be used to `read` the source and save it to library archive. But such a "rebuild" would only need to happen whenever the shared source code got changed. All other occasions that need to use the shared materials could simply pick it up at run time from the .mla library archive.

This is actually how I work with Maple most, by launching the commandline interface to rebuild my .mla, and launching the GUI from a terminal shell. For both of those I use the `-b` option to specify augmentation of libname (although I have several common actions and common libname amendments aliased in the shell, or in simple scripts).

I sometimes prototype procedures in the GUI. But if they become long or if I want to re-use them then I put them into plaintext files, which has yet another benefit of being very safe from corruption. And then I edit them with `vi`, which has Maple source syntax highlighting.

acer

Sorry to the audience, if it is obvious, but there is also the possibility to use a combination of `read` and .mla library archives.

The documented source code -- including comments, and structured with $include or related directives -- could be kept in a plaintext file. A simple shell script, or even a very short worksheet, could then be used to `read` the source and save it to library archive. But such a "rebuild" would only need to happen whenever the shared source code got changed. All other occasions that need to use the shared materials could simply pick it up at run time from the .mla library archive.

This is actually how I work with Maple most, by launching the commandline interface to rebuild my .mla, and launching the GUI from a terminal shell. For both of those I use the `-b` option to specify augmentation of libname (although I have several common actions and common libname amendments aliased in the shell, or in simple scripts).

I sometimes prototype procedures in the GUI. But if they become long or if I want to re-use them then I put them into plaintext files, which has yet another benefit of being very safe from corruption. And then I edit them with `vi`, which has Maple source syntax highlighting.

acer

@Markiyan Hirnyk The forward error of the purported solutions {x=1000000,y=1000000,z=1} and {x=1000000,y=3,z=2} are about 4e-6 and 2e-6, and these do not produce the minimal (absolute) value of the residuals. The exact solutions all produce the minimal absolute value of the residual -- which is zero.

@Markiyan Hirnyk The forward error of the purported solutions {x=1000000,y=1000000,z=1} and {x=1000000,y=3,z=2} are about 4e-6 and 2e-6, and these do not produce the minimal (absolute) value of the residuals. The exact solutions all produce the minimal absolute value of the residual -- which is zero.

@Markiyan Hirnyk Generating a collection of distinct exact solutions is also easily done with a triple do-loop (or it seems even a double loop, after a preliminary `solve` call).

As there are infinitely many integer-valued solutions then characterizing them in some kind of formulaic way seems like a nice goal.

I have x=1, y=-z-1 (and its symmetric equivalents follow, of course), true for all integer z except z=0 and z=-1.

But I don't see the characterization for all other "fixed" x. It might be nice to have a formulaic result giving y in terms of only z, as a (possibly infinite) union over all valid instances of x.

@Markiyan Hirnyk Generating a collection of distinct exact solutions is also easily done with a triple do-loop (or it seems even a double loop, after a preliminary `solve` call).

As there are infinitely many integer-valued solutions then characterizing them in some kind of formulaic way seems like a nice goal.

I have x=1, y=-z-1 (and its symmetric equivalents follow, of course), true for all integer z except z=0 and z=-1.

But I don't see the characterization for all other "fixed" x. It might be nice to have a formulaic result giving y in terms of only z, as a (possibly infinite) union over all valid instances of x.

@Markiyan Hirnyk It now reports {x=1000000,y=1000000,z=1} and {x=1000000,y=3,z=2} as solutions. But these are not exact solutions to (1+1/x)*(1+1/y)*(1+1/z)=2 as the stated equation to satisfy.

@Markiyan Hirnyk It now reports {x=1000000,y=1000000,z=1} and {x=1000000,y=3,z=2} as solutions. But these are not exact solutions to (1+1/x)*(1+1/y)*(1+1/z)=2 as the stated equation to satisfy.

@Markiyan Hirnyk Are some of the more solutions correct only up to floating-point evaluation at a limited precision?

@Markiyan Hirnyk Are some of the more solutions correct only up to floating-point evaluation at a limited precision?

@zook Sorry, I was looking at the bit of your Question where you made two stabs at `define` in order to get phi(x*sigma) to produce phi(x)*sigma. And then I had finger-brain malfunction when querying, and asked you about your intentions for phi(a+b) when I mean to ask about phi(a*b). Sorry.

Note that your followup's solution leaves phi(x*sigma) untouched, for unassigned `x`. It does not produce phi(x)*sigma. And also you mentioned that the following was inadequate for your needs:

restart:
define(phi,linear,phi(sigma)=sigma);
phi(4*sigma);

                                  4 sigma

Hence I took it that you really did want phi(x*sigma) to produce phi(x)*sigma (and not because sigma was stated to be constant... or so it seemed).

So, what I was trying to ask is: what you want from phi(a*b) and phi(a*4*sigma*z)?

First 391 392 393 394 395 396 397 Last Page 393 of 594