Maple 2017 Questions and Posts

These are Posts and Questions associated with the product, Maple 2017

I'm using the differential operator D to differentiate variables and look at the structure of the equations, i.e. turn things like

D[1]u-vt+v^2=0 into

D[1,2](u)-D[2](v)*t+v*D[1](t)+2*v*D[2](v)=0

However, it is assumed that this is a commutative operator, i.e. D[1,2]=D[2,1]. Can I use an option to have it not commute, or should I look into using the DETools package?

Thanks,

Mike

Hello,

 

Assume we have the following "intervals" (I am not sure what is its formal name in Maple)

 

C :=[0,1/11],[1/11,1/9],[1/9, 1/7],[1/3,1/2],[1/2,1]

 

How can we get the "union" of these intervals? That is to say, obtain  [0,1/7],[1/3,1] 

 

Many thanks in advance for your comments and suggestions.

 

 

I am implementing the Extended Euclides Algorithm in Maple for arbitrary domains.

This is my function so far:

EEA:=proc(ED,a,b)
    description
    "Extended Euclidean Algorithm"
    "INPUT: an Euclidean Domain ED and two elements from said domain"
    "OUTPUT: r,s,t such that r = gcd(a,b) = s*a + t*b ";
    local r_0, r_1, r_aux, s_0, s_1, s_aux, t_0, t_1, t_aux, q;
    # Domain checks
    # TODO: check that ED is an euclidean domain
    if not ED[Type](a) then error "1st argument must be of type ED" end if;
    if not ED[Type](b) then error "2nd argument must be of type ED" end if;
    
    # Initialization
    r_0 := a; r_1 := b; # gcd series
    s_0 := 1; s_1 := 0; # 1st cofactor series
    t_0 := 0; t_1 := 1; # 2nd cofactor series

    # Loop
    while r_1 <> 0 do;
        print("All is fine before the Quo");
        print(r_0); print(r_1);
        q := ED[Quo](r_0, r_1);
        print("All is fine after the Quo");
        
        r_aux := r_0 - q * r_1;
        r_0 := r_1; r_1 := r_aux;
        
        s_aux := s_0 - q * s_1;
        s_0 := s_1; s_1 := s_aux;

        t_aux := t_0 - q * t_1;
        t_0 := t_1; t_1 := t_aux;
    od;

    # Result
    return r_0, s_0, t_0;
    end proc:

Where ED is a Domain object passed as a parameter to the function.

When I call the function with certain arguments, it goes once through the loop and then in the second iteration crashes between the second and third print statement.

Concretely, upon making the call:

with(Domains): GI := Gaussian(Z); a := GI[Input](-87+47*I): b := GI[Input](-90+43*I): r, s, t := EEA(GI, a, b); evalb(a*s+b*t = r)

I get the following output:

              

        "All is fine before the Quo"
                              -87 + 47 _i
                              -90 + 43 _i
                      "All is fine after the Quo"
                      "All is fine before the Quo"
                              -90 + 43 _i
                                3 + 4 _i
    Error, (in E[Domains:-Rem]) cannot determine if this expression is true or false: 0 <= -90*`domains/Gaussian/badge0`(-87, 47)-43*`domains/Gaussian/badge0`(1, 0)*`domains/Gaussian/badge0`(-90, 43)

From this we should infer that calling `Gaussian(Z)[Quo]` on arguments `-90 + 43 _i` and `3 + 4 _i` should produce this error, right?

Well, think again, because when I try reproducing that from the notebook it decides to stop crashing. Calling:

    with(Domains): GI:=Gaussians(Z): a := GI[Input](-90+43*I); b := GI[Input](3+4*I); GI[Quo](a, b);

Produces the output:

                            a := -90 + 43 _i
                b := 3 + 4 _i
               -4 + 20 _i

What is going on? Why does it crash inside the function but not in the workbook?

Hello!

Assume we have the first N positive integres, 1,..,N, and we assing to these numbers a (discrete) probability distribution p1,...,pN. Of course, p1+...+pN=1.

Then, How can we select a number in {1,..,N} according to the given probability distribution? That is, the number 1 can be chosen with probability p1, 2 with a probability p2, etc.

Many thanks in advance for your comments.

My goal is to generate incremental values of a function to plot using dataplot. Why does the first example generate numeric values in the Vector and the second example does not?

fenq := f -> 2.1^(f+1):
pf := Vector(5, fenq)
                             [  4.41   ]
                              [  9.261  ]
                         pf := [ 19.4481 ]
                              [40.84101 ]
                             [85.766121]
fseqn := (Se, f) -> Se^(f+1):
psf := Vector(5, fsenq(2.1, j))
 

I can plot the first data set using dataplot(pf). I cannot plot the second data set.

The command print placed within a while loop does not produce any printout. How do I  make MAPLE to produce  it?

I am trying to animate two variables in a 3D plot. Basically I would like to combine these two animations into one simultaneous animation:

animate(plot3d, [[y, x, (1/3)*Pi], x = 0 .. 2*Pi, y = 0 .. R, coords = spherical, scaling = constrained], R = 0 .. 5)

and

animate(plot3d, [[y, x, (1/3)*Pi], x = 0 .. p, y = 0 .. 5, coords = spherical, scaling = constrained], p = 0 .. 2*Pi)

so that both animations start and end simultaneously. Is this possible?

Thanks in advance.


 

M := `<,>`(`<|>`(1, 2, 3), `<|>`(4, 5, 6), `<|>`(7, 8, 9))

Matrix(%id = 18446745804653824710)

(1)

b := `<|>`(10, 11, 12)

Vector[row](%id = 18446745804653819654)

(2)

M+b

Error, (in rtable/Sum) invalid input: dimensions do not match: Matrix(1 .. 3, 1 .. 3) cannot be added to Vector[row](1 .. 3)

 

``

Of course the above addition will throw an error because M and b have different dimensions. But if broadcasting was allowed, then the row vector b is added to each row in the matrix M. For example, in Python:

 

 

Is there a similar feature in Maple?


 

Download question.mw

Hi,

      I need to compute something involved with the pseudo differential operators.

https://en.wikipedia.org/wiki/Pseudo-differential_operator

Specifically, I need to calculate the inverse of a pseudo differential operator, the multiplication of two pseudo differential operators, and the n-th root of a pseudo differential operator. 

I don't know whether Maple could handle these. 

Thanks.

Hi. I hope this question is not a duplicate of my previous question. Fundiff function results in dirac terms in an equation. Are there commands that simply differentiates a term that is a function of (t) in an equation without involving diracs?

How can I compute MatrixInverse, MatrixMultiply and eigenvalues(eigenvectors) faster? are there any procedures or commands that can be used instead of those three command mentioned before to speed up calculations?

1.mw

In the above document, digits must be 30.

Say I have three (3d if it matters) plot objects, which I will call A,B,C.

I need to plot A and B on the same graph and C on a different graph.

To plot objects on different graphs I would normally use an array of plots, and to plot objects on the same graph, I would use a set of plots. So what comes natural to me is this:

V:=Array(1..2):

V[1]:={A,B}:
V[2]:=C:

display(V)

However, this results in

Error, (in plots:-display) element 1 of the rtable is not a valid plot structure

 The problem is in the first element V[1] - Maple wants a plot, and not a set of plots, as each element of the array.

Another attempt which fails is the following:
 

display({A,B},C)

Here Maple will only plot {A,B} and ignore C.

I have had limited success with

 
display({A,B}), display(C)

which in fact works for the purpose stated above - it will produce the plots of {A,B} and C side by side.

However, when I try to put the above command within a procedure depending on some parameter, and use the Explore parameter to visualize the plots in dependence of the parameter, this does not work anymore. Maple will not produce any plot and will produce a wall of text within the Explore display.

 

For istance, 

with(plots); with(plottools)
display(circle([0, 0], 1)), display(circle([0, 0], 1))


Will produce the pictures side by side as desired. But:

P := proc (a)
display(circle([0, 0], 1)), display(circle([0, a], 1))
end proc:
Explore(P(a), parameters = [a = -1 .. 1])


Will result in a wall of text within the Explore window that begins like this:

 

 

So, is there a way to produce the plots I need which is compatible with the Explore command for a procedure? Ideally I need the two graphs ({A,B} and C) side by side within the same Explore window so that when I vary the parameters, both plots change accordingly. 

Thanks in advance.

Hi. I have an equation that consists lots of sines and cosines but I'm not sure how to differentiate it with respect to time. Whenever I do, I get zero. How do I communicate to Maple that theta changes with time so that it can perform the operation?

Is there any way to transfer the equation to MATLAB and perform it there by any chance? I don't know MATLAB though.

Thanks in advance.

Y = (-2*k^3+6*k^2+sqrt(k^8-12*k^7+64*k^6-198*k^5+448*k^4-636*k^3+369*k^2)-7*k-15)/((k^3-3*k^2+5*k-15)*(1+k))

Hello,

I have created my own costume package inspired from an already existing one but this package relies and uses many functions from the original package which I used to create mine. The question: is there an easy way to automatically import all the needed functions and commands from the original package without having to write the name of the original package followed by the name of each function or command ( which is really laborious and hard to complete) ?

Thank you

2 3 4 5 6 7 8 Last Page 4 of 32