# Items tagged with mathmath Tagged Items Feed

### PDEs and Boundary Conditions - new developments...

September 03 2015 Maple
7
1

The PDE & BC project , a very nice and challenging one, also one where Maple is pioneer in all computer algebra systems, has restarted, including now also the collaboration of Katherina von Bülow.

Recapping, the PDE & BC project started 5 years ago implementing some of the basic methods found in textbooks to match arbitrary functions and constants to given PDE boundary conditions of different kinds. At this point we aim to fill gaps, and the first one we tackled is the case of 1st order PDE that can be solved without boundary conditions in terms of an arbitrary function, and where a single boundary condition (BC) is given for the PDE unknown function, and this BC does not depend on the independent variables of the problem. It looks simple ... It can be rather tricky though. The method we implemented is a simple however ingenious use of differential invariants  to match the boundary condition.

The resulting new code, the portion already tested, is available for download in the Maplesoft R&D webpage for Differential Equations and Mathematical Functions (the development itself is bundled within the library that contains the new developments for the Physics package, in turn within the zip linked in the webpage).

The examples that can now be handled, although restricted in generality to "only one 1st order linear or nonlinear PDE and only one boundary condition for the unknown function itself", illustrate well how powerful it can be to use more advanced methods to tackle these tricky situations where we need to match an arbitrary function to a boundary condition.

To illustrate the idea, consider first a linear example, among the simplest one could imagine:

 >
 (1)
 >
 (2)

Input now a boundary condition (bc) for the unknown such that this bc does not depend on the independent variables ; this bc can however depend on arbitrary symbolic parameters, for instance

 >
 (3)

With the recent development, this kind of problem can now be solved in one go:

 >
 (4)

Nice! And how do you verify this result for correctness? With pdetest , which actually also tests the solution against the boundary conditions:

 >
 (5)

And what has been done to obtain the solution (4)? First the PDE was solved regardless of the boundary condition, so in general, obtaining:

 >
 (6)

In a second step, the arbitrary function  got determined such that the boundary condition  is matched. Concretely, the mapping _F1 is what got determined. You can see this mapping reversing the solving process in two steps. Start taking the difference between the general solution (6) and the solution (4) that matches the boundary condition

 >
 (7)

and isolate here

 >
 (8)

So this is the value  that got determined. To see now the actual solving mapping _F1, that takes for arguments  and  and returns the right-hand side of (8), one can perform a change of variables introducing the two parameters  and  of the _F1 mapping:

 >
 (9)
 >
 (10)
 >
 (11)

So the solving mapping _F1 is

 >
 (12)

Wow! Although this pde & bc problem really look very simple, this solution (12) is highly non-obvious, as is the way to get it just from the boundary condition  and the solution (6) too. Let's first verify that this mapping is correct (even when we know, by construction, that it is correct). For that, apply (12) to the arguments of the arbitrary function and we should obtain (8)

 >
 (13)

Indeed this is equal to (8)

 >
 (14)

Skipping the technical details, the key observation to compute a solving mapping is that, given a 1st order PDE where the unknown depends on  independent variables, if the boundary condition depends on  arbitrary symbolic parameters , one can always seek a "relationship between these parameters and the differential invariants that enter as arguments in the arbitrary function _F1 of the solution", and get the form of the mapping _F1 from this relationship and the bc. The method works in general. Change for instance the bc (3) making its right-hand side be a sum instead of a product

 >
 (15)
 >
 (16)
 >
 (17)

An interesting case happens when the boundary condition depends on less than  parameters, for instance:

 >
 (18)
 >
 (19)

As we see in this result, the additional difficulty represented by having few parameters got tackled by introducing an arbitrary constant _C1 (this is likely to evolve into something more general...)

 >
 (20)

Finally, consider a nonlinear example

 >
 (21)
 >
 (22)

Here we have 2 independent variables, so for illustration purposes use a boundary condition that depends on only one arbitrary parameter

 >
 (23)

All looks OK, but we still have another problem: check the arbitrary function _F1 entering the general solution of pde when tackled without any boundary condition:

 >
 (24)

Remove this RootOf to see the underlying algebraic expression

 >
 (25)

So this is a pde where the general solution is implicit, actually depending on an arbitrary function of the unknown  The code handles this problem in the same way, just that in cases like this there may be more than one solution. For this very particular bc (23) there are actually three solutions:

 >
 (26)

Verify these three solutions against the pde and the boundary condition

 >
 (27)

:)

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

### Nth order derivatives and Faa di Bruno formula...

August 28 2015
4
0

In connection with recent developments for symbolic sequences, a number of improvements were implemented regarding symbolic differentiation, that is the computation of  order derivatives were n is a symbol, the simplest example being the  derivative of the exponential, which of course is the exponential itself. This post is about these developments, done in collaboration with Katherina von Bülow, and available for download as usual from the Maplesoft R&D web page for Differential Equations and Mathematical functions (the update itself is bundled with the official updates of the Maple Physics package).

It is important to note that Maple is pioneer in having an actual implementation of symbolic differentiation, something that works for real, since several releases.  The development, however, was somewhat stuck because we were unable to compute the symbolic  derivative of a composite function . A formula for this problem is actually known, it is the Faà di Bruno formula, but, in order to implement it, first we were missing the incomplete Bell functions , that got implemented in Maple 15, nice, but then we were still missing differentiating symbolic sequences, and functions whose arguments are symbolic sequences (i.e. the number of arguments of the function is n, a symbol, of unknown value at the time of differentiating). All this got implemented now within the new MathematicalFunctions:-Sequence package, opening the door widely to these improvements in  differentiation.

The symbolic differentiation code works as mostly all other computer algebra code, by mapping complicated problems into a composition of simpler problems all of which are tractable; what follows is then an illustration of these basic cases.

Among the simplest new case that can now be handled there is that of a power where the exponent is linear in the differentiation variable. This is actually an easy problem

 >
 (1)

More complicated, consider the  power of a generic function; the corresponding symbolic derivative can be mapped into a sum of symbolic derivatives of powers of  with lower degree

 >
 (2)

In some cases where  is a known function, the computation can be carried on furthermore. For example, for  the result can be expressed using Stirling numbers of the first kind

 >
 (3)

The case of sin and cos are relatively simpler, but then assumptions on the exponent are required in order to proceed further ahead from (2), for example

 >
 (4)

The case of functions of arbitrary number of variables (typical situation where symbolic sequences are required) is now handled properly. This is the pFq hypergeometric function of symbolic order p and q

 >
 (5)

The case of the MeijerG function is more complicated, but in practice, for the computer, once it knows how to handle symbolic sequences, the more involved problem becomes computable

 >
 (6)

Not only the mathematics of this result is correct: the object returned is actually computable to the end (if you provide the values of n, p, m and q), and the typesetting is actually fully readable, as in textbooks, including copy and paste working properly; all this is new.

The  derivative of a number of mathematical functions that were not implemented before, are now also implemented, covering the gaps, for example:

 >
 (7)
 >
 (8)
 >
 (9)
 >
 (10)

In the same way the fundamental formulas for the  derivative of all the 12 elliptic Jacobi functions  as well as the four elliptic JacobiTheta functions,  the LambertW , LegendreP  and some others are now all implemented.

Finally there is the "holy grail" of this problem: the  derivative of a composite function  - this always-unreachable implementation of Faa di Bruno formula. We now have it :)

 >
 (11)

Note the symbolic sequence of symbolic order derivatives of lower degree, both of of f and g, also within the arguments of the IncompleteBellB function. This is a very abstract formula ... And does this really work? Of course it does :). Consider, for instance, a case where the  derivatives of  and  can both be computed by the system:

 >
 (12)

This is the  derivative expressed using Faa di Bruno's formula, in turn expressed using symbolic sequences within the IncompleteBellB  function

 >
 (13)

These results can all be verified. Take for instance

 >
 (14)

Compute now the inert functions: on the left-hand side this is just the (now explicit) 3rd order derivative, while on the right-hand side we have a sum of IncompleteBellB  functions, where the number of arguments, expressed in (13) using symbolic sequences that depend on the summation index k and the differentiation order n, now in (14) depend only on , and get transformed into explicit sequences of arguments when the summation is performed and k assumes integer values

 >
 (15)

Take left-hand side minus right-hand side

 >
 (16)
 >

:)

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

### How to combine Greek letters and math in labels?...

August 13 2015
2 1

Hi,

I am trying to use implicit plot. The plot is OK but I want to put labels such as what Latex produces :

$\frac{\Omega}{\omega_n}$ for x axis and $a_0 \mathrm{(m)}$ for y axis

How can I apply this in my maple code as below:

plot1:=implicitplot(a3, Omega_r=1.5..2.5, a=0.00000001..0.1, labeldirections=[horizontal, horizontal], axes=boxed, labels=["W/w_n",typeset("a_0 (m)")], labelfont=[SYMBOL]):

What I have put as bold does not work for me, it is making everything in Greek :) . I want combination of Greek and math.

Thasnks,

Bahareh

### MathematicalFunctions:-Sequences...

July 24 2015
6
2

Symbolic sequences enter in various formulations in mathematics. This post is about a related new subpackage, Sequences, within the MathematicalFunctions package, available for download in Maplesoft's R&D page for Mathematical Functions and Differential Equations (currently bundled with updates to the Physics package).

Perhaps the most typical cases of symbolic sequences are:

1) A sequence of numbers - say from n to m - frequently displayed as

2) A sequence of one object, say a, repeated say p times, frequently displayed as

3) A more general sequence, as in 1), but of different objects and not necessarily numbers, frequently displayed as

or likewise a sequence of functions

In all these cases, of course, none of n, m, or p are known: they are just symbols, or algebraic expressions, representing integer values.

These most typical cases of symbolic sequences have been implemented in Maple since day 1 using the $ operator. Cases 1), 2) and 3) above are respectively entered as , , and or To have computer algebra representations for all these symbolic sequences is something wonderful, I would say unique in Maple. Until recently, however, the typesetting of these symbolic sequences was frankly poor, input like or  just being echoed in the display. More relevant: too little could be done with these objects; the rest of Maple didn't know how to add, multiply, differentiate or map an operation over the elements of the sequence, nor for instance count the sequence's number of elements. All this has now been implemented. What follows is a brief illustration.  > First of all, now these three types of sequences have textbook-like typesetting:  >  (1)  >  (2) For the above, a$p works the same way

 >
 (3)

Moreover, this now permits textbook display of mathematical functions that depend on sequences of paramateters, for example:

 >
 (4)
 >
 (5)

More interestingly, these new developments now permit differentiating these functions even when their arguments are symbolic sequences, and displaying the result as in textbooks, with copy and paste working properly, for instance

 >
 (6)

It is very interesting how much this enhances the representation capabilities; to mention but one, this makes 100% possible the implementation of the Faa-di-Bruno  formula for the nth symbolic derivative of composite functions (more on this in a post to follow this one).

But the bread-and-butter first: the new package for handling sequences is

 >
 (7)

The five commands that got loaded do what their name tells. Consider for instance the first kind of sequences mentione above, i.e

 >
 (8)

Check what is behind this nice typesetting

 >
 $(n .. m) All OK. How many operands (an abstract version of Maple's nops command):  >  (9) That was easy, ok. Add the sequence  >  (10) Multiply the sequence  >  (11) Map an operation over the elements of the sequence  >  (12)  >  $(f(j), j = n .. m)

Map works as map, i.e. you can map extra arguments as well

 >
 (13)

All this works the same way with symbolic sequences of forms  , and . For example:

 >
 (14)
 >
 $(a, p)  >  (15)  >  (16)  >  (17) Differentation also works  >  (18)  >  (19)  >  (20) For a symbolic sequence of type 3)  >  (21)  >  (22)  >  (23)  >  (24) The following is nontrivial: differentiating the sequence , with respect to should return 1 when (i.e the running index has the value k), and 0 otherwise, and the same regarding m and k. That is how it works now:  >  (25)  >  $(piecewise(k = i, 1, 0), i = n .. m)
 >
 (26)
 >
 (27)
 >

### How to solve the following equation in Maple?...

March 07 2015
1 2

I have the following mathematical expression

where a=0.2, b=0.09, c=0.57, p=0.3 and q=1-p=0.7, Now i want to find the value of n for which the value of the expression will be 1, i.e., for what value of n , A_n will be 1?

### Maximizing Planck's Intensity Function...

February 08 2015
1 1

I am attempting to maximize Planck's intesnity function for any given temperature T with respect to lambda. The function is as follows:

My initial attempt was to simply take the derivative of this function with respect to labda, set it equal to zero, and then solve for lamda. Theoretically this should give me the value of lambda that maximizes the intesity with respect to the constants / values h, c, k, and T (where T is temperature).

However doing this in maple just leads to the result "warning, solutions may have been lost".

Does anyone know how I can go about maximizing this?

Thanks!

### how to seq and sum over a range of subscript...

January 27 2015
1 11

we always have subscript variable in the math book, but how could this be natral done in maple

I want to get a seq aaa3

seq(a[i],i=1..3)

but how could I get a  aij

seq(a[i_j],i=1..3);

and

seq(a[ij],i=1..3);  both was not right

### How do you insert a left bracket containing multip...

December 21 2014
2 1

Is there a way with Maple 18 to place a bracket as shown below to contain two DE's? I am not trying to solve them. Only for note-taking purposes. If there is can you please share how to do it?

### Automatic simplification and a new Assume (as in "...

December 09 2014
6
6

Hi
Two new things recently added to the latest version of Physics available on Maplesoft's R&D Physics webpage are worth mentioning outside the framework of Physics.

• automaticsimplification. This means that after "Physics:-Setup(automaticsimplification=true)", the output corresponding to every single input (literally) gets automatically simplified in size before being returned to the screen. This is fantastically convenient for interactive work in most situations.

• Add Physics:-Library:-Assume, to perform the same operations one typically performs with the  assume command, but without the side effect that the variables get redefined. So the variables do not get redefined, they only receive assumptions.

This new Assume implements the concept of an "extended assuming". It permits re-using expressions involving the variables being assumed, expressions that were entered before the assumptions were placed, as well as reusing all the expressions computed while the variables had assumptions, even after removing the variable's assumptions. None of this is possible when placing assumptions using the standard assume. The new routine also permits placing assumptions on global variables that have special meaning, that cannot be redefined, e.g. the cartesian, cylindrical or spherical coordinates sets, or the coordinates of a coordinate spacetime system within the Physics package, etc.

Examples:

 >

This is Physics from today:

 >
 (1.1)
 • Automatic simplification is here. At this point automaticsimplification is OFF by default.
 >
 (1.2)

Hence, for instance, if you input the following expression, the computer just echoes your input:

 >
 (1.3)

There is however some structure behind (1.3) and, in most situations, it is convenient to have these structures
apparent, in part because they frequently provide hints on how to proceed ahead, but also because a more
compact expression is, roughly speaking, simpler to understand. To see this
automaticsimplification in action,
turn it ON:

 >
 (1.4)

Recall this same expression (you could input it with the equation label (1.3) as well)

 >
 (1.5)

What happened: this output, as everything else after you set  and with no
exceptions, is now further processed with simplify/size before being returned. And enjoy computing with frankly
shorter expressions all around! And no need anymore for "simplify(%, size)" every three or four input lines.

Another  example, typical in computer algebra where expressions become uncomfortably large and difficult to
read: convert the following input to 2D math input mode first, in order to compare what is being entered with the
automatically simplified output on the screen

 >
 (1.6)

You can turn automaticsimplification OFF the same way

 >
 (1.7)
 • New  facility; welcome to the world of "extended assuming" :)

Consider a generic variable, x. Nothing is known about it

 >

Each variable has associated a number that depends on the session, and the computer (internally) uses this
number to refer to the variable.

 >
 (1.8)

When using the assume  command to place assumptions on a variable, this number, associated to it, changes,
for example:

 >
 >
 (1.9)

Indeed, the variable x got redefined and renamed, it is not anymore the variable x referenced in (1.8).

 >
 Originally x, renamed x~:   is assumed to be: RealRange(Open(0),Open(1/2*Pi))

The semantics may seem confusing but that is what happened, you enter x and the computer thinks x~, not x
anymore.This means two things:

1) all the equations/expressions, entered before placing the assumptions on x using assume, involve a variable x
that is different than the one that exists after placing the assumptions, and so these previous expressions
cannot
be reused
. They involve a different variable.

2) Also, because, after placing the assumptions using assume, x refers to a different object, programs that depend
on the
x that existed before placing the assumptions will not recognize the new x redefined by assume .

For example, if x was part of a coordinate system and the spacetime metric depends on it, the new variable x
redefined within assume, being a different symbol, will not be recognized as part of the dependency of  This
posed constant obstacles to working with curved spacetimes that depend on parameters or on coordinates that
have a restricted range. These problems are resolved entirely with this new
Library:-Assume, because it does not
redefine the variables. It only places assumptions on them, and in this sense it works like
assuming , not assume .
As another example, all the
Physics:-Vectors commands look for the cartesian, cylindrical or spherical coordinates
sets
in order to determine how to proceed, but these variables disappear if you use
assume to place assumptions on them. For that reason, only assuming  was fully compatible with Physics, not assume.

To undo assumptions placed using the assume command one reassigns the variable x to itself:

 >
 (1.10)

Check the numerical address: it is again equal to (1.8)

 >
 (1.11)

·All these issues get resolved with the new Library:-Assume, that uses all the implementation of the existing
assume command but with a different approach: the variables being assumed do not get redefined, and hence:
a) you can reuse expressions/equations entered before placing the assumptions, you can also undo the
assumptions and reuse results obtained with assumptions. This is the concept of an
extended assuming. Also,
commands that depend on these assumed variables will all continue to work normally, before, during or after
placing the assumption, because
the variables do not get redefined.

Example:

 >

So this simplification attempt accomplishes nothing

 >
 (1.12)

Let's assume now that

 >
 (1.13)

The new command echoes the internal format representing the assumption placed.

a) The address is still the same as (1.8)

 >
 (1.14)

So the variable did not get redefined. The system however knows about the assumption - all the machinery of the
assume command is being used

 >
 Originally x, renamed x:   is assumed to be: RealRange(Open(0),Open(1/2*Pi))

Note that the renaming is to the variable itself - i.e. no renaming.

Hence, expressions entered before placing assumptions can be reused. For example, for (1.12), we now have

 >
 (1.15)

To clear the assumptions on x, you can use either of Library:-Assume(x=x) or Library:-Assume(clear = {x, ...}) in
the case of many variables being cleared in one go, or in the case of a single variable being cleared:

 >
 >

The implementation includes the additionally functionality, for that purpose add the keyword
anywhere in the calling sequence. For example:

 >
 (1.16)
 >
 Originally x, renamed x:   is assumed to be: RealRange(Open(0),infinity)
 >
 (1.17)
 >

In summary, the new Library:-Assume command implements the concept of an extended assuming, that can be
turned ON and OFF at will at any moment without changing the variables involved.

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

### substitution a sequnce of numbers in a function...

November 18 2014
0 6

Hi all

Assume that we have a function, say f(t) and we want to substitute t in it where t is:

t=[0,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]

by subs or other better command, how can we do it?

best wishes

Ph.D Candidate

Applied Mathematics Department

### differentiation...

October 21 2014
0 5

Hi all

I want to produce following c_nm's(which are differentiation based formula) . assume that N and M are known and f(t) is arbitrary. also n=1,2,...,N and m=0,1,..,M-1

how can we do this?

regards

Ph.D Candidate

Applied Mathematics Department

### Help! Maple 18 wont write essential math symbols: ...

September 22 2014
1 2

Just got Maple 18 on academic license. I've used Maple 15, 16 and 17 before this.

It wont write simple math symbols as + - * and :=

I have tried both document- and worksheet, reinstalling and so on...

What is the problem?

Thanks

### Right clicking does nothing...

September 22 2014
1 3

I am using Maple 12 in Win 64. I have some difficulties in evaluating expressions in Maple. For example simply writing cos(x) then differentiating it w.r.t x. After writing cos(x) in 2D Math mode, I do right click for selecting diff but it does not work. The pointer turns in to busy mode and nothing comes to select. Also, I tried this operation in the tutorial file teaching differentiation, however problem persists.

 1 2 3 4 5 6 7 Last Page 1 of 36
﻿