Carl Love

Carl Love

28110 Reputation

25 Badges

13 years, 120 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@abbeykabir Enclose the equations with curly braces { } when passing to fsolve. It probably will use Newton's Method and the Jacobian.

Here's an example. I can't cut-and-paste your equations, so I generated random similar examples.

'randpoly([y[k] $ k= 1..5], degree= 3, sparse) + randpoly([y[k] $ k= 1..5], degree= 1)' $ 5;


fsolve({%});


@abbeykabir Enclose the equations with curly braces { } when passing to fsolve. It probably will use Newton's Method and the Jacobian.

Here's an example. I can't cut-and-paste your equations, so I generated random similar examples.

'randpoly([y[k] $ k= 1..5], degree= 3, sparse) + randpoly([y[k] $ k= 1..5], degree= 1)' $ 5;


fsolve({%});


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;

First 629 630 631 632 633 634 635 Last Page 631 of 710