Carl Love

## 26513 Reputation

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

## Try this...

@RezaZanjirani Try this to get the side-by-side plots:

plots:-display(
plots:-densityplot~(
`<|>`(DiffrP||(1..3)), 0..1, 0..1, title=~ `<|>`("diffrP"||(1..3)),
labels= [alpha, delta], labeldirections= ["horizontal", "vertical"],
)
);

There is some subtle and undocumented difference between 2021 and 2023 that caused the error. It's too minor to fuss about.

Regarding what you call "the traditional way": I don't see how plotting where certain functions are positive or negative can tell you which is the max.

Regarding multiple conditions: It's easy: Assign numbers, 1, 2, 3, etc., to the various combinations of conditions that you want. Then plot that number with densityplot.

## I don't see any difference...

@C_R I don't see any difference in the two strings you just posted.

## I don't see it...

I don't see any conjugation bar over any occurence of n or m in your worksheet. Please point out exactly where you see one.

## Sequencing with ||...

The || opertaor allows even shorter syntax for sequencing:

`&#`||(945..969)||`;`;

## mo, mi, and mn are needed in larger stru...

@mmcdara momi, and mn are needed when the name is part of a larger MathML structure, even if no modifiers are wanted.

## How to handle sin(ln(y))?...

How do you want to handle something like sin(ln(y))?

## Mathematical equivalence...

@MaPal93 I asked because if the solutions are equivalent, then it should be possible to verify that the first two are independent of gamma. One way is to take the derivative with respect to gamma and substitute a variety numeric values for the other variables, and gamma=1. Then use evalf, and you should get values close to 0.

## ~...

@nm You could just use

inttrans:-laplace~([ode_sys], t, s)

## An equivalent without subs...

@Ronan Continuing my last Reply: Here's my original code and an equivalent version that doesn't use subs:

```#Original:
(LmR,Eq0):= subs~(
_M=~ [(E,A)-> ((lhs-rhs)~(E)[], A[]), (E,A)-> (E[], (A =~ 0)[])],
(S::{set,list}({`=`,thistype}(algebraic)))->
`if`(S::set,`{}`,`[]`)(_M(selectremove(type, S, `=`)))
)[]:

#Equivalent without subs:
LmR:= (S::{set,list}({`=`,thistype}(algebraic)))->
`if`(S::set,`{}`,`[]`)(
((E,A)-> ((lhs-rhs)~(E)[], A[]))(selectremove(type, S, `=`))
#####################
):
Eq0:= (S::{set,list}({`=`,thistype}(algebraic)))->
`if`(S::set,`{}`,`[]`)(
((E,A)-> (E[], (A =~ 0)[]))(selectremove(type, S, `=`))
###############
)
:
```

Note the parts of the separated procedures that are highlighted in blue. Those parts are the only parts that differ in the two procedures; the identical remaining parts are redundant. My programming philosophy places high value on removing such redundancies to whatever extent possible. That is why I used subs.

## Unassigned global...

When making a substitution with subs into a procedure, the target of the substitution must be an unassigned global variable. Using unevaluation quotes or :- won't work. By convention, variables beginning with an underscore shouldn't be assigned. Note that _M also occurs in the arrow procedure that is the final argument of the subs. That second _M is replaced by one of the two arrow procedures equated to _M in the first argument of subs.

Those globalness restrictions for subs when its last argument is a procedure are not well documented, and I don't know if they're all still true in Maple 2023.

## Spam vs. Followup Questions...

I wasn't the one who deleted some other version of this Question, nor did I even see that version. However, the Moderator who deleted it did not consider it to be spam. There are other reasons that Questions get deleted by Moderators, the most common of which is that it was considered to be a close followup to a recent Question posted by the same author. In those cases it should be posted in the toriginal thread.

As a Moderator, I wish that we had the capability to simply move an out-of-place Question to the correct thread. Unfortunately MaplePrimes lacks that capability.

## Mathematically equivalent solutions?...

Are the different "strategies" that are used in your worksheet intended to produce solutions that are mathematically equivalent but for which that equivalence is difficult to verify due to the enormous complexity? Or, are they different ways of approximating the true complete solution and thus not 100% mathematically equivalent?

## Post the code...

It goes without saying that it's impossible to Answer your Question if you don't post the code. As a worksheet showing a timed example would likely be best.

## Differences between map and appended ~...

@mmcdara Here's an example to show the multi-argument capability of ~, which would be quite awkward  to duplicate with map:

f~([a,b], X*Y, [c,d], [1,2]);
[f(a, X Y, c, 1), f(b, X Y, d, 2)]

Here is, I believe, the only situation where ~ and map are equivalent: Let be an object of one of the four basic container types that I mentioned in my last Reply. Let a1, a2, ..., ak be a sequence (possibly empty) of additional arguments, none of which are of any of those container types. Then map(f, La1a2, ..., ak= f~(L, a1, a2, ..., ak). (Both map and ~ can be overloaded by object methods, which can alter those rules somewhat.)

Regarding map(f, Lversus map(x-> f(x), L): They produce the same result, but the former is more efficient, and can be much more efficient some cases, such as when f is a builtin command. In most cases (whether or not map is involved), (x-> f(x)) can be replaced by simply f, and it's more efficient to do so.

## "without using parametric"?...

@nm Are you saying that in some earlier version of Maple, solve needed the parametric option to solve that pair of linear equations? I find that hard to believe. Indeed, one can get the solutions symbolically for uninstantiated initial conditions:

sol:= <c1,c2>^+.(<3,-1> +~ exp(4*t))/4/exp(t):
ICsol:= solve(eval([y(t) = sol, D(y)(t) = diff(sol,t)], t= t0), [c1,c2]);
simplify(eval(ICsol, [t0, y(t0), D(y)(t0)]=~ [4, -3, -17]));

 5 6 7 8 9 10 11 Last Page 7 of 689
﻿