Carl Love

Carl Love

28050 Reputation

25 Badges

12 years, 336 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@vv It agrees, like this:

`%%%%subs`(
    {x= 0, y= 0}, 
    `%%%subs`(a= a+b+x, `%%subs`(%subs(a= a+b+x, b= a-b+y), a*b))
):
(value@@4)(%);
                                   2
                            (a + b) 

(I realize that there are problems with this example!)

@vv I think that you're ignoring that the outer use also changes the a in b= a-b.

I make sense of this example via this simulation:

`%%%subs`(a= a+b, `%%subs`(%subs(a= a+b, b= a-b), a*b));
  %%%subs(a = a + b, %%subs(%subs(a = a + b, b = a - b), a b))

value(%);
              %%subs(a = a + b, %subs(b = a, a b))

value(%);
                           /            2\
                      %subs\a = a + b, a /

value(%);
                                   2
                            (a + b) 

 

@The function Show a worksheet for what you did get. B.A is definitely a 3x3 matrix, both in Maple and in math.

@The function The angle bracket constructor for row vectors uses the vertical bar character (|) as the element separator:

A:= <1 | 3 | 4>;

You can also enter it as a column vector and take its transpose:

A:= <1, 3, 4>^%T;

B:= <5, -2, 1>;

Multiplication of vectors and matrices is non-commutative (i.e., order matters), so it uses a different operator: the dot `.` rather than `*`.

A.B; B.A;

In this case, A.B will be a single number, and B.A will be a 3x3 matrix.

@ecterrab You wrote:

  • ...unwith unloads the package and forget clears remember tables from results obtained with the package, both concepts apply to any package. This is expected and what one needs to do, @Carl Love....

Look again at my 2nd example, repeated below. The result that I wanted to remove hadn't been obtained with the package, and, had I been a naive user, I would have had no reason to suspect that the result was different simply because Physics had been loaded (yet hadn't been otherwise used).

#In this example, no command from Physics is explicitly used, yet the results
#from top-level :-diff are different.
restart:	
with(Physics): 	
:-diff(:-conjugate(f(x)), x);

Of course, in actual practice there's a lengthy computation that involves diff rather than a simple call to diff as shown. Thus, a naive user would have no way of knowing what needs to be forgotten.

@Preben Alsholm Thank you. That second example  is more concerning to me because there's no way to know which commands one needs to apply forget to. The unwithing routine for Physics should have the responsibility of taking care of the forgetting.

The example that led to my discovery of this anomaly was a Question here on MaplePrimes that I was attempting to answer yesterday. The user had done with(Physics) just to use Physics:-Setup(...). Then we tried to remove some higher-degree terms from a complicated PDE containing some derivatives of conjugates of the unkown functions. After many attempts, I noticed that the result was completely different depending on whether with(Physics) had been used. Naturally, the next thing I tried was replacing diff with :-diff, to no avail.

By the way, I have no opinion about which form of the derivative of conjugate is better. I just think that there should be a way to switch from one to the other without rigamarole.

@acer Thank you. I guess that there's a bug in forget when the syntax forget(.., whatever) is used. 

The procedure `simpl/conjugate` is on the list of 130 procedures that I just posted above.

@vv For what it's worth, here is a list of 130 top-level-named procedures and appliable modules that reference either the Physics package or global `Physics/Initialized`. (Yes, I realize that many of these are members of older table-based packages and are thus in some sense not top-level names.)

restart:
kernelopts(opaquemodules= false):
interface(warnlevel= 0):
Ph:= CodeTools:-Usage(
    select(
        P-> local pn;            
            try        
                (pn:= ``||(P))::callable
                and indets(
                    ToInert(eval(`if`(pn::procedure, pn, pn:-ModuleApply))),
                    identical("Physics", "Physics/Initialized")
                ) <> {}
            catch: false
            end try,        
        index~(op~(1, {LibraryTools:-ShowContents()[]}), ..-3)
    )
): 
nops(Ph);
(p-> printf("%A\n", p))~(sort([Ph[]])):  
memory used=0.52GiB, alloc change=211.81MiB, 
cpu time=11.24s, real time=10.50s, gc time=2.25s

                              130

ODEtools/Xcommutator
ODEtools/Xgauge
ODEtools/ch
ODEtools/collect
ODEtools/equinv
ODEtools/firint
ODEtools/firint/PDE
ODEtools/first_integral
ODEtools/get_diff_vars_in_expression
ODEtools/info
ODEtools/isolate
ODEtools/odepde
ODEtools/odsolve
ODEtools/redode
ODEtools/remove/hard
ODEtools/subs/do
ODEtools/y(x)_to_y
PD/convert/compseq
PD/diff
PDEAdvisor/high_order/Fourier
PDEAdvisor/high_order/Hankel
PDEAdvisor/high_order/Laplace
PDEAdvisor/high_order/Mellin
PDEtools/U_to_u
PDEtools/difforder/do
PDEtools/isolate
PDEtools/pdesys
PDEtools/useD
PDEtools/useD/diff_to_D
PDEtools/useD/onediff
assuming
assuming/names
combine/cmbtms
combine/exp
combine/linear
combine/linear/do
combine/linear/sort
combine/power
combine/wrt
convert/D
convert/DESol
convert/eval/from_diff
dchange/diff/tr+itr
dchange/funcs
dsolve
dsolve/IC
dsolve/IC/easy
dsolve/IC/get_x_val_and_diff_ord
dsolve/IC/implicit
dsolve/PDE
dsolve/func_in_args
dsolve/general_and_particular
eval/Diff
eval/diff
evalc/abs
evalc/evalc
expand/conjugate
expand/exp/+
expand/ln
expand/power
index/PhysicsTensor
intat
intfactor/formal
is/internal
is/internal/eqns_inds
is/preproc
is/solve
latex
liesymm/convert/D
odeadv/MRL/ch
odeadv/sym_pat/[F(x)+G(y),0]
odetest
odetest/ODESolStruc
odetest/linear
odetest/series
odsolve/Riccati/symmetric
odsolve/high_order/exp_reduce/integrate
odsolve/parametric/Lie
odsolve/solvable/do
odsolve/solvable/linear_homogeneous
odsolve/sort_ODESolStruc/DESol_reduction
pdetest
pdsolve
pdsolve/BC/2nd_order/Series
pdsolve/LagrangeCharpit
pdsolve/ToMissingDependentVariable
pdsolve/checksol
pdsolve/fixedfunc
pdsolve/iPDE
pdsolve/info
pdsolve/resinco
pdsolve/sep/casesplit/do
pdsolve/strip/solve/dsys
pdsolve/sys/hint2
pdsolve/sys/info
pdsolve/sys/sequential
pdsolve/sys/sort
pdsolve/sys/sort/lex
print/Diff
print/Int
print/diff
print/int
property/ObjProperty
redode/many
sdsolve/odeset
sdsolve/ok
sdsolve/process_answer
sdsolve/sequential/sys_and_funcs
sdsolve/sysODE/islinear
signum
simpl/abs
simpl/conjugate
simplify/commonpow
simplify/conjugate
simplify/table
symgen/formal
tools/RewriteRoutinesToUsePhysicsCommands
tools/Typeset
tools/UsePhysics
tools/UsePhysicsOperators
tools/atomize_names
tools/degree
tools/df_dt
tools/map
tools/operate_on_sequence
tools/type
type/PDEtools/known_function
type/PhysicsUnitVectors
type/PhysicsVectors
value/Intat/do

 

@Ahmed111 In Maple 2022, the result depends on whether or not you use with(Physics). If you don't, the result is 0. So, in your Maple 18, it may be 0 even if you do use with(Physics). I note (see the Question that I recently posted) that Physics:-diff and regular diff treat conjugate differently, and that once either with(Physics) or Physics:-diff is used, it's impossible to get back the regular diff behavior without a restart

@Ahmed111 How do you want the derivatives of the epsilons to be handled in the linearization? For example, I could remove all terms that contain an epsilon derivative (of any order) raised to power 2 or higher.

@Rouben Rostamian  Your solution linearizes with respect to x and t, but doesn't that remove from the expression more content than the OP intended to be removed? Can we limit the linearization to the epsilons?

@MaPal93 What you are missing is that you have an extra restart command; thus, matrices K1 and K2 have been erased from memory.

I totally agree with mmcdara about Document Mode and 2D Input. Each is independently an unusable abomination, so the hideousness of the combination is essentially the product of their individual hideousnesses.

@ecterrab Why should there be a way to avoid using the name quotes that is specific to the "prime" character? It's too ad hoc. What about other non-alphanumeric characters? The tremendous number of these ad hoc solutions added in recent years will lead to Maple being unmaintainable as a software product.

By using the name quotes, the ' character can be used in names and as a differentiation operator within a single expression. 

The ASCII (keyboard) character "aposthrope" (') is not even the correct "textbook" character for a "prime" symbol. Observe the difference in these two variations of "f-prime":

`f'`, `#mrow(mi("f"), mo("&prime;"));`;

             

The one on the left is hideous---I'd never let my work be seen in public like that (with characters overlapping). The one on the right is much closer in appearance to a properly typeset textbook.        

@Ahmed111 Sorry, I missed seeing the derivatives of the epsilon functions (due to the original having used alias to suppress the (x,t) part). Yes, that certainly changes the approach to linearization required. It's a little bit more complicated, but not much more. I'll fix it.

@Ahmed111 After doing mtaylor, do

Eq3:= subs([epsilon[1]= epsilon[1](x,t), epsilon[2]= epsilon[2](x,t)], Eq2):
alias(epsilon[1]= epsilon[1](x,t), epsilon[2]= epsilon[2](x,t)):
Eq3;

 

First 74 75 76 77 78 79 80 Last Page 76 of 709