Carl Love

Carl Love

28025 Reputation

25 Badges

12 years, 312 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

Your #2 is quite clever, but the syntax requires it to be 2..nops(L2) rather than 2:nops(L2).

Your #2 is quite clever, but the syntax requires it to be 2..nops(L2) rather than 2:nops(L2).

Indeed, this more general rule will work:

applyrule(a::algebraic^c::algebraic*b::algebraic^c::algebraic= (a*b)^c, %);

Yet combine(%, power, symbolic) does not work. (Why?)

Indeed, this more general rule will work:

applyrule(a::algebraic^c::algebraic*b::algebraic^c::algebraic= (a*b)^c, %);

Yet combine(%, power, symbolic) does not work. (Why?)

Yet there are the symbolic options to simplify, sqrt, and combine(..., power). One should be able to achieve what the Asker wants under those options, throwing caution to the wind, so to speak. I can't understand why the following does not work:

1/sqrt(x)*1/sqrt(y);
combine(%, power, symbolic);

But the applyrule seems to work easily.

Yet there are the symbolic options to simplify, sqrt, and combine(..., power). One should be able to achieve what the Asker wants under those options, throwing caution to the wind, so to speak. I can't understand why the following does not work:

1/sqrt(x)*1/sqrt(y);
combine(%, power, symbolic);

But the applyrule seems to work easily.

If we add a prettyprinting procedure to Markiyan's code, we can get output that looks more like the original formula without altering any of the computational aspects:

`print/binomial`:= (n,k)-> 'C'[n]^k:

theo(a1,a2,N1,N2);

If we add a prettyprinting procedure to Markiyan's code, we can get output that looks more like the original formula without altering any of the computational aspects:

`print/binomial`:= (n,k)-> 'C'[n]^k:

theo(a1,a2,N1,N2);

Since expressions are assumed to be equated to 0 by solve, and since the solution variables are assumed to be all the indeterminates, you could simply do

solve(map(coeffs, {f,g}, [x,y]));

Since expressions are assumed to be equated to 0 by solve, and since the solution variables are assumed to be all the indeterminates, you could simply do

solve(map(coeffs, {f,g}, [x,y]));

@casperyc Actually, having just run both NullSpace(GaussianElimination(M)) and NullSpace(M), I see no benefit to the preliminary step.

@casperyc Actually, having just run both NullSpace(GaussianElimination(M)) and NullSpace(M), I see no benefit to the preliminary step.

@PatrickT wrote:

The use of thisproc inside subsindets is very neat.

At first it seems recursive, but essentially it is not: The recursive call can only ever proceed one step. You could just as well write the procedure like below. This is probably a little faster, and is how I would've written it were I not working from your code. This also avoids the redundancy of rebuilding the format for each float.

Round3:= proc(x, n::nonnegint:= 1)
local format:= cat("%.", n, "f");
     subsindets(x, float, f-> parse(sprintf(format, f)))
end proc;

@PatrickT wrote:

The use of thisproc inside subsindets is very neat.

At first it seems recursive, but essentially it is not: The recursive call can only ever proceed one step. You could just as well write the procedure like below. This is probably a little faster, and is how I would've written it were I not working from your code. This also avoids the redundancy of rebuilding the format for each float.

Round3:= proc(x, n::nonnegint:= 1)
local format:= cat("%.", n, "f");
     subsindets(x, float, f-> parse(sprintf(format, f)))
end proc;

@Markiyan Hirnyk I (or my guess at least) stand corrected. You should make it an Answer so that I can vote up. I wonder why the intermediate step of GaussianElimination makes a difference. I would think that NullSpace would do that anyway.

First 628 629 630 631 632 633 634 Last Page 630 of 708