Christian Wolinski

MaplePrimes Activity


These are answers submitted by Christian Wolinski

g & h can access z because you passed the variable to them in the parameters.

You are trying to solve EQ rather than eq:

eq := sqrt(x^2-10*x+1) = sqrt(-8*x^2+9*x-1);
EQ := (lhs, rhs)(map(Im=0, eq)), eq;
sol__eq := [solve]({eq}, {x});
sol__EQ := [solve]({EQ}, {x});
map((radnormal@subs), sol__eq, [EQ]);
map2(map, is, %);

 

`type/thatsum`:='`+`'(anything);
f:=x->mul([op](x));
applyrule((A::thatsum)='f(A)', [a+b,c+d,a+b+c,c+e+f+g+h]);
applyrule((A::'''`+`'''(anything))='f(A)', [a+b,c+d,a+b+c,c+e+f+g+h]);

 

minimize(expr, a=0..infinity, b=0..infinity, c=0..infinity, d=0..infinity, location);

Gives the same 4 solutions.

As pointed out already SolveTools:-SemiAlgebraic may be of use here. First convert to elementary polynomials turning expr into (2*e2+2-e1^2)^2-(e1-1)^2+3+4*e4:

E := (2*e2+2-e1^2)^2-(e1-1)^2+3+4*e4,
[a+b+c+d = e1, a*b+a*c+a*d+b*c+b*d+c*d = e2, a*b*c+d*b*c+d*a*b+d*a*c = e3, a*b*c*d = e4];
S := SolveTools:-SemiAlgebraic([E[1], e1>0, e2>0, e4>0]);

N := zip(proc(L,n) if L[1]="H" then n fi end, L, [$1..nops(L)]);
applyop('NULL', {op}(N), L);
remove(has, S, N);

A poorly posed radical form. Maple will answer the following:

int(rationalize(f), u);

map(convert, Generators(g1), disjcyc);
PermutationGroup(%);


The following has the same outcome:
PermutationGroup(Generators(g1));
 

Also see:
g1;
map(convert, Generators(g1), disjcyc);
g2 := PermutationGroup(%);
g3 := PermutationGroup(Generators(g1));
g4 := PermutationGroup(g1);
evalb(g1 = g1), evalb(g1 = g2), evalb(g1 = g3), evalb(g1 = g4); #we are comparing objects

 

Your comparison is not elementwise:

(a, b, c, d) := (1, -1, 1, -1);
c := NULL; d := 1, -1;
if (a, b, c, d) = (1, -1, 1, -1) then
    print("foo");
end if;

If it is a polynomial in x you are working with then use:
convert(series(P, x, n+1), polynom);

However, if P contains other series as coefficients then those too will be converted.

Matrix(3, 1, proc(k, c) local i, j, r, C, R; r:=Row(DOFe, k); Matrix(6, 6, unapply('`if`(member(i, r, 'R') and member(j, r, 'C' ), (KTe[k, 1])[R, C], 0), i, j'))  end);
 

The above code requires Matrix initialization be executed sequentially, which I think it is.

restart;
with(ListTools);
with(LinearAlgebra);

assign(
KTe = Matrix(3, 1),
KTe[1,1] = Matrix(4, 4, [[216, -288, -216, 288], [-288, 384, 288, -384], [-216, 288, 216, -288], [288, -384, -288, 384]]),
KTe[2,1] = Matrix(4, 4, [[216, 288, -216, -288], [288, 384, -288, -384], [-216, -288, 216, 288], [-288, -384, 288, 384]]),
KTe[3,1] = Matrix(4, 4, [[500, 0, -500, 0], [0, 0, 0, 0], [-500, 0, 500, 0], [0, 0, 0, 0]]),
DOFe = Matrix(3, 4, [[1, 2, 3, 4], [3, 4, 5, 6], [5, 6, 1, 2]])
);

KG := Matrix(3, 1): for k from 1 to 3 do nn:=Row(DOFe,k); KG1 := Matrix(6, 6); for i from 1 to 4 do for j from 1 to 4 do KG1[nn[i],nn[j]]:=(KTe[k,1])[i,j]; end do; end do; KG[k,1]:=KG1; end do:

print('KG' = KG);
 

C := proc(E, T)
   if type('E, T') then 1 elif hastype('E, T') then add(map(procname, [op]('E'), 'T')) else 0 fi;
end;

L := ifactors(10^128+3, easyfunc);
remove(type, L[2], [prime, posint]);

add~(combinat:-choose([a, b, c], 2));
 

1 2 3 4 5 6 7 Last Page 3 of 21