## 30515 Reputation

18 years, 317 days

## MaplePrimes Activity

### These are replies submitted by acer

@emendes Yes, my Answer was submitted first. (I saw it alone, right after posting it.)

However, I do not care about votes, etc. Mark as "best" whichever you feel is best.

I have now seen another thread on this site in which later Answers appear at top (even without having more votes). It's a new bug in this forum itself.

## misc....

@zenterix A few ways, for fun...

 > restart;
 > T := <1,2;3,4>;

 > Q := copy(T): Q[1,2] := K: Q[2,1] := 700: Q;

 > Matrix(op(1,T),        (i,j)->`if`([i,j]=[1,2],K,                    `if`([i,j]=[2,1],700,T[i,j])));

 > Matrix(op(1,T),        (i,j)->piecewise([i,j]=[1,2],K,                         [i,j]=[2,1],700,                         T[i,j]));

 > T;

## duplicate deleted...

Duplicate Question threads on solving this polynomial system F1=eval(ode,K) may be flagged as such and deleted.

You can put your followup queries (eg. about various options to solve, other techniques, post-processing and selection amongst solutions, etc) on solving this polynomial system here.

## same topic, followup queries...

@salim-barzani I read that other mp3.mw attachment, and the .pdf file. It was a related query on the same underlying topic.

Please put such closely related followup queries in a single Question thread (or at the very least, utilize the Branch button to automatically link them). Wholly separate duplicate threads may get flagged as such and may be deleted.

ps. I have read all the (many) questions/worksheets by previous grad students asking for help on this topic on this forum, as well as all the responses.

## another duplicate...

@salim-barzani I have deleted yet another duplicate Question thread by you on this problem.

(I discussed this with the site admin a few days ago.)

## duplicate deleted...

I have deleted a duplicate Question thread of this.

If you have additional details or related queries on this example/task then please add them here instead of in a separate new Question.

## not so...

@C_R As stated, your middle paragraph's claim is not true. You wrote, "In Unit:-Simple Maple does not assume anything. The unit of x is left open and no dimensional check is performed unless x is assigned to a value."

Some dimensional checks are done even if x has no assigned value, with Units:-Simple loaded. Perhaps you instead meant to write that no dimensional test is done directly on x itself. That's not what you wrote.

Some dimensional checks are indeed done. That's why the OP's second example fails under Units:-Simple. The dimensional checks performed in that example -- on the terms to which unassigned x is added -- lead to a contradiction.

 > with(Units:-Simple):
 > (x+Unit(m))*(x+Unit(s));

Error, (in Units:-Simple:-*) the following expressions imply incompatible dimensions: {Units:-Unit(m)+x, Units:-Unit(s)+x}

## uncombined units...

@Thomas Richard Even with Units:-Simple loaded (via with(Units), or explicitly), there'll always be someone generating expressions with uncombined units.

Eg. using subs instead of the eval export.

## example...

@Thomas Richard I feel that another example is useful here, for two reasons:

1) Units:-Split does not first combine units.
2) convert(..,unit_free,t) also allows the unit to be assigned to unevaluated name t.

 > restart;
 > expr := 4*x*Unit(cm) + 3*Unit(mm);

 > A,B := Units:-Split(combine(expr,':-units')):
 > A,B;

 > S := convert(expr,':-unit_free','T'):
 > S,T;

Note that with the combine, Split merely returns the expression, and 1 (one) for the unit. (Maple 2024.0)

 > expr := 4*x*Unit(cm) + 3*Unit(mm);

 > Units:-Split(expr);

Of course, for the OP's original example no extra combine(..,units) or simplify call is needed.

Note that in general that combining also has the effect of turning the result into the base units for the current system, eg. m=meter for SI in the original example. Neither Split alone nor convert(...,unit_free) will affect the units in these (...no addition):

 > g_moon := 1.635000000*Unit(('m')/'s'^2):

 > A,B := Units:-Split(g_moon):
 > A,B;

 > S := convert(g_moon,':-unit_free','T'):
 > S,T;

These don't change to base units (...no addition).

 > foo := 1.635000000*Unit(cm/year):

 > A,B := Units:-Split(foo):
 > A,B;

 > S := convert(foo,':-unit_free','T'):
 > S,T;

ps. The Units:-Split command was introduced in Maple 2021, and is not available in earlier versions. The convert(...,unit_free) call works in all previous releases having the Units package.

## edit for M2021...

@salim-barzani See the following attachment, which behaves like dharr's f12, which he ran using Maple 2023.

f12_dharr_ac_2021.2.mw

I converted one expression to `diff` to enable a key substitution to work in Maple 2021, since you have that version.

## duplicates...

Please stop posting multiple separate Question threads for the same items.

Such duplicates get flagged as such and may be deleted.

## duplicate deleted...

I have deleted a duplicate of this.

## duplicates...

@salim-barzani Wholly separate and duplicate Question threads on this may be flagged and/or deleted.

If you want to spawn a related new Question thread on it then you could use the Branch item at the bottom of this body of this Question.

## multiple assumptions...

Now, how about handling a sequence of more than one assumption (passed together simultaneously, in a list)?

## freeze...

@emendes The coeffs command deals with (expanded) polynomials. But things like cos(w) and exp(s+w) are not polynomial in w, and neither is your expression.

The freeze command can turn expressions into names, and thaw reverts that.

So I use freeze here to turn those problematic terms into temporary names, which makes a polynomial (in your given names and the temp names) out of your expression. Then I get the coefficients of x,y,z,w and these temp names. Then I slap it all into a nice list-of-lists while thawing the temp names back to their original expressions.

The same operations as before, but spilt into more steps:

 > restart;
 > expr := alpha*((epsilon-1)*x+y-3*x*z-epsilon/3*x^3+b*sin(w)+3+exp(c+w));

 > V := indets(expr,function(satisfies(u->depends(u,{x,y,z,w})))) union {x,y,z,w};

 > # turning the function calls into names Vf := freeze~(V);

 > subs(V=~Vf,expr);

 > R := [coeffs(frontend(expand,[%]), Vf, 'S')];

 > # without reverting, via `thaw` L := [seq([S[i],R[i]],i=1..nops([S]))];

 > # reverting, via `thaw` L := [seq(thaw([S[i],R[i]]),i=1..nops([S]))];

 > # for fun L := sort(%);

 > `+`(map(`*`@op,L)[]);

 > simplify(expr - %);

 1 2 3 4 5 6 7 Last Page 1 of 559
﻿