ecterrab

13431 Reputation

24 Badges

19 years, 356 days

MaplePrimes Activity


These are answers submitted by ecterrab

In short, there is nothing wrong with Physics:-Vectors regarding your example. Just remove the line "with(LinearAlgebra)" and everything works as expected.

Details. Physics:-Vectors includes a command, `&x`, that represents the cross product. That command is loaded when you load Physics:-Vectors. In your worksheet, however, after that, you are also loading LinearAlgebra, which also has a command `&x` to represent the cross product. Since the last package loaded is LinearAlgebra, when you input `&x` you are invoking LinearAlgebra:-`&x`, not Physics:-Vectors:-`&x`. Take a closer look at the error message you received (in the worksheet you posted) and you see it: the message comes from LinearAlgebra:-`&x`, which doesn't understand the algebraic-vector-notation used in Physics:-Vectors. 

The main difference between these two packages: in Physics:-Vectors, the vectors are algebraic structures, additions of coefficients times unit vectors, as we do when working with vectors with paper and pencil. These objects are of type algebraic, so if V_ is a vector, then type(V_, algebraic) returns true. On the other hand, in LinearAlgebra everything is a Matrix also presented as a Vector structure (internally, a Matrix with only 1 line), none of these objects are of type algebraic. They are of type rtable (check the documentation about that).

Now, with objects of type algebraic you do all sorts of algebraic operations (simplify, factor, expand, etc.). It is not the same with objects of type rtable. Additionally, with objects of type algebraic, in Physics:-Vectors you can represent a non-projected vector, as in V_, with all its properties understood by the system, while with rtables you cannot: only projected vectors can be represented. Abstract vectors are at the core of Vector Analysis. Examples of their usefulness are in the first section, on Vector Analysis, of the help page ?Physics,Examples.

 

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@snpa 
Thanks for the worksheet. I see the problem. The code assumed x and y were scalars in one place, which is not the case in general. That is now fixed and the fix included in the latest Maplesoft Physics Updates v.1038, available for everybody using the current Maple 2021.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

NOTE ADDED Aug/19: This issue in the MapleCloud, described below (Aug/18), is now fixed.

======================================================================
The problem is not that. The problem is in MapleCloud. When the command Physics:-Versions tries to get the version on the MapelCloud it gets this:

> PackageTools:-GetProperty(5137472255164416,"X-CloudVersion");
Error, (in JSON:-JSONParse) invalid JSON

 

This problem is not restricted to the Physics Updates. For example, the MapleCloud package "MagicPuzzles" has ID 5755630338965504 and you get the same Error:

> PackageTools:-GetProperty(5755630338965504,"X-CloudVersion");
Error, (in JSON:-JSONParse) invalid JSON

 

This problem has been reported before and is tracked so that it gets fixed. In particular, the simple instruction Physics:-Version(latest) fails to install the latest version because of this problem, though as said in the title when you click "Updates" in the MapleCloud toolbar to update "Physics Updates", it does get installed.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

The _Cn with n nonnegative integer are of type suffixed(_C, nonnegint)

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

The Latex translation of Maple expressions requires you using the maple.sty latex file - i.e. for you to put \usepackage{maple} in your .tex file and place maple.sty in the directory where you have the .tex file being compiled. That maple.sty file is distributed with the Maple system, found in the /etc/ directory of your Maple installation.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft.

As @aroche said this is now fixed. The fix is available to everybody using Maple 2021 within the Maplesoft Physics Updates v.1001 and newer.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

The type And(algebraic, satisfies(u -> not has(u, I))) gets every possible algebraic object, symbolic, numeric, etc. which does not include the imaginary unit. If what you need s a bit more restricted, you can add the restrictions within the And(...).

As usual you can assign this structure creating a type, say as in 

`type/foo` := And(algebraic, satisfies(u -> not has(u, I)));

Then use it as usual, e.g. type(x, foo).

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft.

 

That is the type, Or(function, identical(x)).

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

 

This option also works with systems of differential equations, possibly including inequations, to indicate dependency that is undesired, and the algorithm implemented is not restricted to the polynomial case: it works too in the presence of mathematical functions of the (undesired) variables (exp, BesselJ, etc.)

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Given the infinitesimals, as you show in the worksheet you posted, the command PDEtools:-InfinitesimalGenerator computes the infinitesimal generator (the object you show in your worksheet), and PDEtools:-Eta_k computes the infinitesimal prolongations (your question). Take a look at the corresponding help pages, and if you find something more specific that you need help on, post again as a reply here?

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

That is an incorrect display. Something to fix; I'm tracking it in the database of issues.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

In your System_problem.mw you show a system (sys) and you want to solve it "assuming a::real, b::real, c::real, b <> c, a^(2) - b^(2) + c^(2) > 0". These assumptions are of three different types: "real", `<>` ("different") and `<` ("smaller"), and taking them into account in one step is not as fast, or lead to a reliable result. If you tackle the problem in three steps, however, the problem is tractable systematically. This is similar to what @mmcdara suggested, but different and including the "real".

Step 1 is to take your sys and include in it the "different" (not the "smaller" which would require using a different algorithm); i.e: 

sys2 := [op(sys), b <> c, a^2 - b^2 + c^2 <> 0]

sol4cons := convert({solve(sys2, vars)}, radical)     # this is solved fast

Now that most of the problem (the easily tractable part) is resolved, you can include the "smaller" via 

sol4cons2 := map(u -> solve(u union {0 < a^2 - b^2 + c^2}, vars), sol4cons);

This one is also performed by solve with ease; steps 1 and 2 are indeed straightforward.

To complete, step 3 is about the "real" assumptions. For that, the idea is easy to understand: replace, in sol4cons2, each of a, b, c by its real and imaginary parts using, e.g. a = Re(a) + I * Im(a), then take the Real and Imaginary parts of each solution-set, next you union the resulting Re and Im sets, and substitute Im(a) = 0, Im(b) = 0, Im(c) = 0. Since this step 3 requires more manipulations I paste here an image showing what I get for the first solution set in sol4cons2, starting with the input line that produces sol4cons2

System_problem_(reviewed).mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

The dsolve command uses many strategies, it would be too long to explain them here. But one thing is easy: instead of using y(0) = 0, you can use y(0) = U, solve for _C1 (solve will now return something - I call it remain), take _C1 = limit(remain, U=0) and you get the value _C1 = infinity you were looking for. This is equivalent to extend solve to, somehow, return infinity. Then take the limit(sol, _C1 = infinity) and you get the solution y(x) = 0.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

 

Download ugly_ode.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@nm 

I just saw a question you posted, that seems to have been deleted (?); so I am answering here, it looks like a different but perhaps close to the deleted question.

First, I feel the same way as Carl, both about subsindets (great command) and the set applyrule, match, patmatch, typematch (not really working fine). Although subsindets requires types that sometimes are kinda cumbersome. For Physics I wrote an internal subroutine that replaces to some point those match commands ... It's been some years I'm considering making it complete and transforming that into a full replacement for patmatch.

Anyway, In your deleted question you asked about matching exp(anything)*anything*sqrt(anything) and in the context of subsindets you need a type for that; this is one possibility

> `type/F` := u -> u::`&*`(anything $ 3) and andmap(membertype, [exp(anything), anything, radical], [op(u)])

 So suppose you want to apply some procedure G to expressions of this type, then this works

> subsindets(expression, F, G);

Naturally, in [exp(anything), anything, radical] you can exclude the second operand, which I put it there to illustrate the general case only, where it is can be something more specific. 

Also, instead of creating a type by assigning `type/F`, you may prefer to use a nested type structure built with satisfies; it works the same way, e.g.:

> And(`&*`(anything $ 3), satisfies(u -> andmap(membertype, [exp(anything), radical], [op(u)])))

And use it as in

> subsindets(expression, %, G);


Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft.

First 9 10 11 12 13 14 15 Last Page 11 of 55