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

@Carl Love Could `curves,rest` be split out simply just with selectremove of that specfunc type (using a list as originally, not a Vector)?

@Carl Love I suspect that one of the key aspects is that you and I switched it from Re(Int(...)) to Int(Re(...)).

And that can be made faster (even still allowing adaptive plotting). The first version I gave took about 8 seconds. The one below takes under 2 seconds on my Maple 18 (Intel i7, 64bit Windows) even without relaxing the requested accuracy of the numeric integration.

restart:

FF := Q-1+(1/5)*K*dp^3*h^5+(1/3)*dp*h^3+h+h1*h:
DDP:=[solve(FF,dp)]:
h:=1+phi*cos(2*Pi*x):
h1:=2*Pi*alpha*beta*phi*cos(2*Pi*x):
beta:=1:alpha:=0: phi:=1/2:
dpdx:=evalf[15](radnormal(DDP[1])):

#dpp:=q->Int(unapply(Re(eval(dpdx,[K=-0.1,Q=q])),x),0..1,epsilon=1e-5):
dpp:=q->Int(unapply(Re(eval(dpdx,[K=-0.1,Q=q])),x),0..1):

plot(dpp,-1..1,axes=box,color=[blue]);

And a little more can be shaved off by instead using the commented line above which imposes a laxer tolerance on the numeric integration, getting it down to about 1.5 seconds on my machine.

This works for me in both Maple 17.02 and 18.00.

restart:                                                 

M := 2: alpha := 1/2:                                    

U := sum(sum(binomial(n-1, i)*x^(n-i-alpha)*(-a*n)^i*c[n]
             *GAMMA(n-i+1)/GAMMA(n-i-alpha+1),           
             i = 0 .. n-1), n = ceil(alpha) .. M):       

radnormal(convert(U,elementary));                        

                                                        1/2
                        (6 a c[2] - 4 x c[2] - 3 c[1]) x
                   -2/3 -----------------------------------
                                         1/2
                                       Pi

@itsme This might produce the same edited version of Grid:-Map (in 17.02 or 18.01 perhaps) that you suggested, using anames('user').

HackGridMap :=
   FromInert(subsop([5,1,1,2,1]
             =subs(_Inert_LOCAL(1)=_Inert_LOCAL(7),
                   op([5,1],
                      ToInert(proc() local var;
                                var:={anames('user'),
                                      '`grid/mapcmd`'};
                              end proc))),
             ToInert(eval(Grid:-Map)))):

@Michael The second argument to `subs`, which you have as m mod(4) , is evaluated to m even before `subs` gets to do the substitution.

@sarra Your line,

   alpha:=(n,m)->beta[1];

makes the same mistake made here (and in at least once other repost of your this issue that you made). It should be,

   alpha:=unapply(beta[1],[n,m]);

instead.

 

@Alejandro Jakubi I get simplify-with-siderels as you used it to be about twice as fast as applyrule as I gave it, for many repetitions of the given example if using `forget` between each iteration.

It may also be worth noting that the purely syntactic replacement done by `applyrule` won't automatically match anything in, say, (d+x)*(d-x) to be d^2.

I think that whether one wants just syntactic substitution, or targeted simplification, or to handle just the numerator, etc, can be key to these kinds of tasks even though the user may not always realize what all the implications are. How should the various related tasks be documented by example, I wonder?

@Carl Love The time() command reports the total for all threads, and that can greatly exceed the wall-clock time reported by time[real]().

The output that you ought to have seen is (actually),

> n:=5;

                                    n := 5

> error "bad argument: %1", n; 

Error, bad argument: 5

Note the `5` appearing in the emitted error message. The %1 is a placeholder for the first parameter used in the formatting of the error message.

Here's another example,

> n:=5:

> error "%-1 argument does not match %-3 argument: %2 <> x", 13, n, 7;

Error, 13th argument does not match 7th argument: 5 <> x

acer

@Joe Riel If c23 is not zero then isn't Matrix([[0,c12,c13], [0,1,c23], [0,0,1]]) defective?

@Kitonum One question of interest involves what is it about some more general C that determines B.A uniquely. I suspect that for symmetric 3x3 C of rank r, and for 3xr A and rx3 B such that C=A.B, then B.A may be unique if the nonzero eigenvalues of C are all the same value. Markiyan (and I) would like to see that supported by a proof (or disproved, in which case necessary conditions might still be of interest).

For example, B.A does not seem to uniquely determined by 3x2 A and 2x3 B such that A.B=C for C=Matrix([[1.,1,2],[1,1,2],[2,2,2]]) which is also symmetric, of rank 2, and diagonalizable. (note. That C has two distinct nonzero eigenvalues.)

@Markiyan Hirnyk I'm not sure that I understand the English of your commented questions 1) and 2). If you are asking about B.A being uniquely determined by your C then that is interesting. I suspect that it is a consequence of the properties of the (Moore-Penrose) pseudoinverse of C, possibly combined with symmetric C having just one repeated value for its nonzero eigenvalues. I would like to see a deft proof of it.

@Markiyan Hirnyk One can consider the diagonalization of symmetric C instead, where C has dimensions m-by-m.

Let r=Rank(C). Take A=X and B=E.X^%T where E is the r-by-r diagonal Matrix of nonzero eigenvalues of C, and where X is the m-by-r Matrix whose columns are the orthonormal eigenvectors corresponding to those nonzero eigenvalues of C.

Then it should hold that C = X.E.Transpose(X) = A.B as well as that X.Transpose(X)=IdentityMatrix(m).

Then B.A = E.Transpose(X).X = E.

I used the singular value decomposition of C before, with X=U, in part because Maple returns that with S the singular values already sorted, so its easier to construct E with only nonzero eigenvalues. (That relates to C being symmetric.) 

So then one can note (by computation) that your 3-by-3 symmetric Matrix C with rank=2 is diagonalizable and has a repeated eigenvalue of value 9 (with multiplicity 2).

@xcyborg Aren't you closing the bracket too early in that first `printf` call? Don't you want M(t,t+1) to be the seventh value after the format string? Ie, the eighth argument.

First 359 360 361 362 363 364 365 Last Page 361 of 594