ecterrab

10352 Reputation

20 Badges

16 years, 72 days

MaplePrimes Activity


These are answers submitted by ecterrab

So the unexpected "division by zero" is fixed and the fix distributed within the Physics Updates v.1048.

Details: not a bug in dsolve but in the interaction between solve and simplify, as you can see entering tracelast after receiving that error message.

To the side, I see it got mentioned the difference between passing the solving variables as a list or as a set. There is a difference and this is intentional - and useful - design. In brief, when triangularizing a nonlinear system of equations, that is deriving, one at a time, a sub-system of equations that involves only one of the unknowns, to solve for it and eliminating it from the rest of the original system, it matters what unknown you try to eliminate first. I imagine everybody understands that so I won't expand.

So, when you pass the second argument as [Xc(t), Sy(t)], dsolve calls PDEtools:-casesplit with that ordering and, accordingly,  casesplit (check its help page) constructs first a subsystem that involves only Sy(t), dsolve receives that, solves for it and eliminates Sy(t), remaining to solve a system that involves only Xc(t). Of course, for this to work all the intermediate steps (calls to solve, series, int, simplify, etc. etc.) need to perform successfully.

In this particular example, for your choice  [Xc(t), Sy(t)] not all the intermediate operations are successful, so the system cannot be solved, while for  [Sy(t), Xc(t)] the intermediate operations are all doable and the system is solved to the end.

So how do you know "which ordering is better?" Generally speaking: there is no answer for that. But, experience accumulated allowed me to construct a very detailed approach to estimating what would be the best ordering for solving non-linear systems (differential or not) when using dsolve, pdsolve or PDEtools:-Solve. And that is the routine used by default when you pass the solving variables as a set, not a list. That is why you see the system solved when passing { Xc(t), Sy(t) }. Of course, this very tricky approach coded will not work all the time (I wrote it, that statement is not a guess), or otherwise, the choice of best ordering would be systematic, and we know it is not. For those cases, you can play around passing the solving variables as a list.

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

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

1 2 3 4 5 6 7 Last Page 1 of 45