Carl Love

## 26508 Reputation

11 years, 186 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

## It works...

The Submit Software Change Request feature of MaplePrimes works. You may have simply experienced some temporary server problem or Internet problem.

## Mental solution; no Maple...

My mental solution without Maple:

rel(3) is obviously true; rel(2) can be verified by elementary arithmetic. For n > 3, divide both sides by ((n-3)*2)^(1/(n-1)). The equation becomes (n-3)^1 * 2^1 = (n-1)*2^1 - 4, which reduces to 2*n-6 = 2*n-6.

## Close-to-original workaround...

Here's a workaround that's as close to the "spirit" of the original command as I think is possible. It uses subs to perform simultaneous substitutions by making the first argument to subs a list.

subs(op(expr)=~ [a,b,c,d], expr)

(As always, my posting of a "workaround" is unrelated to whether I think there's a bug. In this case, I do think that there's a bug.)

## Workaround using pairs option...

Here's my workaround to find the index of the maximum entry in a table:

T:= table(['rand()'\$2^18] =~ ['rand()'\$(2^18-1), 2^64]):
P:= [indices](T, pairs):
j:= lhs(P[max[index](rhs~(P))]);

j := 65671522612
T[j];
18446744073709551616
2^64;
18446744073709551616

This works exactly the same if the table has a multi-index.

## op...

You need

map(myf@op, mylist)

The @op converts the inner lists to argument sequences before passing them to myf.

The transformation that you propose has already been implemented in the reverse direction, the right side of your equation becoming the left side. In other words, the following happens automatically:

diff(inttrans:-fourier(U(x,t), x, s), t);  lprint(%);
fourier(diff(U(x,t),t),x,s)

I'm not writing that to say that what you want can't be done; I'm just saying that we need to take it into account when implementing your proposal. If it's not taken into account, your transformed result (i.e., diff@fourier) will automatically revert to its original (i.e., fourier@diff). It is for this reason that my implementation below uses the inert Diff rather than the usual diff.

map2(
fourier,
[diff, Diff](U(x,t),t),
(* => *) Diff(inttrans:-fourier(U(_x,t), _x, s), t),
x, s, {U(x,t), t}
):
#There's no response if this command is accepted.

Test it:

inttrans:-fourier(diff(U(x,t),t), x, s);  lprint(%);
Diff(fourier(U(_x,t),_x,s),t)

I changed x to _x in the result to show that it's not really the same x. This is akin to @sand15's xi. Since they're bound variables, I don't think it makes any practical difference.

Unfortunately, this only implements your transform for the specific function name U. I may be able to figure out something more general later..

## Automatic selection of elimination varia...

There are eight groups of three elimination variables that can be used, all of which yield the desired polynomial. The process shown in the following worksheet finds all of them quickly and automatically.

 > restart:

Peng-Robinson_eos

In the following computation, the variables in each numerator are never separated, so we can reduce the number of variables by considering each numerator as a single variable.

 > eq4:= P = RT/(v-b) - aT/(v*(v+b)+b*(v-b));

 > elims:= {(A,B,Z) =~ P/RT *~ (aT/RT, b, v)};

So there are potentially five variables that we can eliminate:

 > Vs:= indets(rhs~(elims));

But since there are only three elimination equations, we need to pick three variables. The possible groups of three are

 > V3:= [combinat:-choose(Vs, nops(elims))[]];

Use solve on each group of three variables:

 > sols:= V3 =~ map2({solve}, elims, V3);

Obviously, we can't use the one whose solution set is empty. The one with RootOf could also be problematic, so we'll exclude it also, at least for now.

 > ok_sols:= ((lhs=op@rhs)~@remove)(     (r-> has(r, RootOf) or nops(r) <> 1)@rhs,     sols );

All eight of the remaining combinations yield the desired residual polynomial:

 > for V in lhs~(ok_sols) do     sol[V[]]:= eliminate({eq4,elims[]}, V)[2][] od;

 > (collect(sol[aT,b,v], Z) = 0) &where subs(RT= R*T, elims);

Verify that the substitutions return the original eq4:

 > solve(eval(op(1,%), op(2,%)), P);

 > convert(%[3], parfrac, v);

 >

## Too many variables for numeric...

AFAIK, pdsolve(..., numericcan only handle PDE systems with 2 differentiation variables. You have X, R, and t.

## subsindets, specindex...

Here are two ways:

subsindets(expr, specindex(a), x-> b[op(x)])

Or, if you know that all the a's that you want have exactly 1 index:

subsindets(expr, a[anything], x-> b[op(x)])

## Narrow the y-range...

How do you expect it to react when you give it a y-range that's out-of-bounds (into complex numbers) for the function? Narrow the y-range to -1.53..1.53.

The command FunctionAdvisor will give you a huge amount of information about a special function. Try

The notations Ei[a](x) and Ei(a, x) seem to be used interchangeably, and

Ei(x) = Ei(0, x) = Ei[0](x) = exp(-x)/x.

## Slick index-free variation...

Here's another way, just to show the possibilities. I often prefer index-free methods, which let me treat matrices and vectors as whole mathematical objects in their own right rather than "poking inside" them.

I construct a matrix of products of powers of X and by taking the outer product of a vector of powers of and a vector of powers of Y. Then I take the elementwise product of that with m. Then use add, which can be used without indices.

(X,Y):= (2,3):  (r,c):= op(1, m) -~ 1:

-11.518

I will readily admit that the above, done on a large scale, will increase your garbage collection time.

## annotation option and Typesetting packag...

I've done this with respect to your Solusi5, but it can be done for any of your plots.

```Colors:= [red, blue, green]:
F:= [A, l, S](t):  tF:= [t, F[]]:
plots:-display(
plots:-odeplot(
Solusi5, `[]`~(t, F), t= 0..5, numpoints= 1000,
color= Colors, legend= [A5, I5, S5]
),
annotation= (typeset @ xcoordinate)(
proc(t) option remember; uses T= Typesetting;
(T:-mtable @ op @ (T:-mtr @ T:-mtd @ T:-mtext)~)(
sprintf~("%a = %a", tF, evalf[5](eval(tF, Solusi5(t)))),
mathcolor=~ [black, Colors[]], mathsize= 14
)
end proc
)
);
```

This will initially appear to be a plot just like your version. The difference will become apparent when you drag your mouse over the curves. Instead of the usual box with the x and y coordinates, you will get a box with a column of numbers. The top line gives the value of t at the cursor; the next 3 lines give the values of A, l, and for that value of t. Each of these lines is the same color as its corresponding curve.

There are no Maple help pages for the Typesetting package operators that I used: mtablemtrmtdmtextmathsize, and mathcolor. These are MathML operators which you can find some help for on many independent webpages; then you need to convert them to Maple syntax. There are Maple help pages for typeset and annotation, which aren't part of the Typesetting package. The definition of xcoordinate is on the annotation help page. The sprintf is a standard Maple command, and very similar to the sprintf in C and other languages. The @ is the function composition operator (help page ?@). The ~ is the elementwise operator (help page ?operators,elementwise). The `[]` is the list-building operator in prefix form (a tiny amount of help at ?use).

Let me know if you'd like this format changed in any way.

## select, hastype, specfunc...

Like this:

select(hastype, A01 + _z, specfunc(tanh))

Edit: I added + _z to avoid the problem that acer mentioned.

## assuming...

This quickly returns a fairly simple elliptic expression:

int(1/sqrt((a-t)*(t-b)*(t-c)*(t-d)), t= b..a) assuming d<c, c<b, b<a;

You shouldn't make assumptions about a variable of integration, t in this case; it's done automatically.

 4 5 6 7 8 9 10 Last Page 6 of 382
﻿