## 1565 Reputation

19 years, 227 days

## Trial...

I've just inputted this command and the return was NULL response:

 isolve({x>3/2,x<5/2},{x});

Reading from the help file "The procedure isolve solves the equations in eqns over the integers. It solves for all of the indeterminates occurring in the equations."

## It has no zeros....

Try the code below and consider what it implies:

 A := -144*z-44+12*sqrt(-12*z^3+96*z^2+24*z-15);;B := 1728*z^2+2304*z+1024+432*z^3; rationalize(B/A); q := rationalize(B/A)*A-B;evalb(rationalize(q)=0);   member(0,map(`@`(radnormal,unapply(A,z)),{solve}(B)));

## Solve attempt....

Is the following at all close to the anticipated solution?

## Recurse with index....

Try this code:

 OperandsTable := proc()local F;    F := proc(A)        local i, j, B;            j := args[2 .. -1];            if nops(A) = 1 then                B := op(1, 'A');                if type(B, '{indexed, list, set, `*`, `+`, `^`, function, relation, boolean, `::`, `..`, `.`, uneval}') then                    j = eval(B, 1), procname([op(0, B)], j, 0), seq(procname([op(i, B)], j, i), i = 1 .. nops(B))                else j = eval(B, 1)                end if            else j = op('A'), seq(procname([op(i, 'A')], j, i), i = 1 .. nops(A))            end if        end proc;    table([F(['args'])])end proc;

An example:

 K:=OperandsTable('map((x->x)=SetPartitions,[op](5..6,remove(has,combinat[partition](10),1)))'):eval(K[],1);leafsindices:=remove(proc(L,S) hastype(S,[op(L),anything]) end,{indices}(K)\$2):leafs:=map((S,T)->eval(T[op(S)],1),leafsindices,K);leafs_parameters:=map((S,T)->`if`( op(-1,S)=0 , NULL, eval(T[op(S)],1)),leafsindices,K);leafs_operand0:=map((S,T)->`if`( op(-1,S)=0 , eval(T[op(S)],1), NULL),leafsindices,K);all_operand0indices:=select(S->evalb(nops(S)>0 and op(-1,S)=0),{indices}(K)):all_operand0:=map((S,T)->eval(T[op(S)],1),all_operand0indices,K);

Let me know if there is anything amiss.

## A tiny bit of programming....

Two versions of same but with small distinctions:

 F := proc(N::nonnegint, lo::nonnegint, hi::nonnegint) local q, A, i; A := 'irem(q, 2, 'q')'; irem(N, 2^lo, 'q'), [seq(eval(A), i = lo .. hi)], q end proc;

or this:

 F  := proc(N::nonnegint, range::(nonnegint .. nonnegint))local q, A, i;    A := unapply('irem(q, 2, 'q'), i'); irem(N, 2^lhs(range), 'q'), map(A, [`\$`(range)]), qend proc;

So F(8,0..7)[2]; gives [0, 0, 0, 1, 0, 0, 0, 0]

and F(11+5*256+7*256*256,8..15); gives 11, [1, 0, 1, 0, 0, 0, 0, 0], 7

## Lookup ?listlist...

Lookup ?member. This function is intended to compare expressions. In your example you are looking for matrices. The difference here is a matrx is a storage and identified by a reference and not its contents. On the other hand type listlist is an expression.

This code will match matrices only if the expressions of the elements are a match. This maybe sufficient for matrices of constants. Otherwise lookup ?iszero, ?Normalizer and test the difference.

fl:=a->convert(a,listlist):Jfl:=map(fl,J):
for i to 1 do for j to 2 do a := J[i].J[j]; member(fl(a), Jfl, 'k'); print(i, j, k, a, whattype(a)) end do end do;

## I do not know this is easier, but it is ...

I do not know this is easier, but it is more transparent.

A := (Cq = Cao*k1*t/(1+k1*t)/(1+k2*t));
X := {A}, {Cq}(t), {Cq};
Aextremas := `@`(S -> collect(S, RootOf, distributed, factor), evala, proc () _EnvExplicit := false;
[solve](args) end proc)({A, D(Cq) = 0} union implicitdiff(X, t) union implicitdiff(X, t, t), {t} union map2(`@@`, D, {`\$`(0 .. 2)})(Cq));
map(allvalues, Aextremas);

## Lookup ?member...

Plainly:

A:=[2,4,6,8,10,12];
m:=proc(x,L) local i; if member(x,L,'i') then i else NULL end if end proc;
m(4,A);
m(3,A);

## Points for using internet....

 A := p(x) = 1/3 *x^ 3 - 6/10 *x^ 2 - 187/100* x + 1;As := map(unapply, A, x);(proc(f::function, r::range)local g, x, x0, y0, S, V;    _EnvExplicit := true;    S := map(allvalues, [solve]({g(x) = f(x0), g(x) = y0, D(f)(x0) = 0}, {x0, g(x), y0}));    S := select(type, S, set(anything = realcons));    V := map((S, x0, y0, g) -> subs(S, [[x0, y0], g]), S, x0, y0, g(x));    V := map2(map2, op, [1, 2], V);    traperror(print(plots[display](        plots[pointplot](V[1], color = red, symbol = box),         plot(V[2], x = r, color = black),        plot(f, r, color = black, thickness = 3, adaptive = true, args[3 .. -1]))));    V, fend proc)(rhs(As), -3 .. 3, view = [-3 .. 3, -5 .. 5], axes = boxed, scaling = constrained);

gives:

.

## AFAIK thre is no way to sort those. Mapl...

AFAIK thre is no way to sort those. Maple will display sum terms according to "in-memory address" ordering and you can not change that. You can always try this:

Look up ?extrema

## Simply put you are trying to compute thi...

Simply put you are trying to compute this:

 vars:=a,b;Aexpr:=a*b;f:=unapply(Aexpr,vars);A:=a=.123456789,b=.123456789;B:=map(`@`([proc(r) local k; (rhs-lhs)(r)*k+lhs(r), k, k=0..1 end proc], `@`(op,shake)), subs([A], [vars]));S:=`@`(f,op,map2)(op,1,B),`@`({op},map2)(op,2,B),`@`({op},map2)(op,3,B);minimize(S)..maximize(S);;

## Symbolic-algebraic method:...

 asimplify := proc(Expr, Terms::{list, set}, EliminationTerms::{list, set}, Assumptions::{function, procedure}, Execution::{function, procedure})local X, Zs, Ze, ZS, Ot, Oe, i, T1, Z;    Ot := [op](Terms);    Oe := [op](EliminationTerms);    T1 := {Non}(map(identical, {op}(Oe)));    Zs := [seq(cat(Z, i), i = 1 .. nops(Ot))];    Zs := `@`(assume, op, zip)(Assumptions, Zs, Ot), eval(Zs);    ZS := zip((a, b) -> a = b, Zs, Ot);    Ze := Ot - Zs;    X := frontend(Execution@simplify, [Expr, Ze, map(op, [Oe, Zs])], [T1, {}]);    X := subs(ZS, X)end proc;asimplify(f_minus,[a(t)-b],[a(t)],(n,x)->(n,real),x->simplify(convert(x,signum)));

Please test the above code. Let me know the cases that dont work.

## Use simplify....

 restart:f:=abs(a)*abs(1,a); assume(a,real),simplify(convert(f,signum));

Try the above.

## Similar to this...

posting:
http://www.mapleprimes.com/questions/207267-Coefficients-Of-Differential-Polynomial#comment223370

Try with:

function_coeffs := proc(A, v::set(name))
local S, T;
S := indets(A, {function});
S := select(has, S, v);
T := {Non(map(identical, S))};
frontend(proc(A, S) local V; [coeffs](collect(A, S, distributed), S, 'V'), [V] end proc, [A, S union v], [T, {}])
end proc;

eq := (-Omega^2*a*A[2]-Omega^2*m*B[1]+Omega*A[1]*c[1]+B[1]*k[1])*cos(Omega*t)+(Omega^2*a*B[2]-Omega^2*m*A[1]-Omega*B[1]*c[1]+A[1]*k[1])*sin(Omega*t) = 0;

function_coeffs(lhs(eq),{t});

gives:

[-Omega^2*a*A[2]-Omega^2*m*B[1]+Omega*A[1]*c[1]+B[1]*k[1], Omega^2*a*B[2]-Omega^2*m*A[1]-Omega*B[1]*c[1]+A[1]*k[1]], [cos(Omega*t), sin(Omega*t)]

 First 17 18 19 20 21 Page 19 of 21
﻿