Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello,

How i use maple to get the formal solution of this non autonomous system :

dsys := {diff(x(t), t) = (a*p*S/h + (-o - u))*x(t) + f(t)*p*S*y(t)/h, diff(y(t), t) = a*(1 - p)*S*x(t)/h + (f(t)*(1 - p)*S/h - b)*y(t)}

I tried dsolve(dsys) but maple consider the set of solution with x(t) y(t) and f(t), but f(t) is a parameter of the system. I search a solution for x(t) and y(t).

Thank you

I easily found the roots of the following equations,

s:=solve(x^3+x^2-2*x-1,x)

I accidentally discovered that  2*cos((2*Pi)/7) is also the root of this equation. 

simplify(eval(x^3+x^2-2*x-1,x=2*cos((2*Pi)/7)))

0

It’s easy to know that 2*cos((2*Pi)/7) is equivalent to the third root found above

s1:=fsolve(x^3+x^2-2*x-1,x);
2*cos((2*Pi)/7.)

         s := -1.801937736, -0.4450418679, 1.246979604

                          1.246979604

 

Maybe I don’t like the use of imaginary units, and I prefer  2*cos((2*Pi)/7) .

In the case that I don’t know that  2*cos((2*Pi)/7) is the solution of the equation, can I make a certain transformation without using the imaginary unit to represent the real number. For example, trigonometric functions, exponential functions, etc.

I tried to use the following functions, all failed.

s:=solve(x^3+x^2-2*x-1,x);
convert(s[3],cos);
identify(s[3])

 

What is interesting is the following phenomenon. Even if Zeta function does not look great:

s1:=fsolve(x^3+x^2-2*x-1,x):
identify(s1[3])

 

 

For this example, can all roots be transformed into trigonometric expressions by maple.

 

 

Can someone please tell me why is my output not ''-cos(x) '' but this:

And how can I set up the worksheet to give me the outputs I want?

Few months ago, someone was kind enough to send me an email letting me know that in Maple 2021 the following new change will be in Object

I am attending a workshop on OOP.  In Maple 2021, one will be able 
to invoke a method of an instance of an object with the  syntax:  object_name:-method_name

However, I am not able to get the above to work in Maple 2021. And I looked at the help pages and see no such example. This is what I tried

restart;
module person()
    option object;
    local name := "me";   

    export get_name::static := proc( self::person, $ )
        self:-name;
    end;

    export set_name::static := proc( self::person, name, $ )
        self:-name:=name;
    end;

end:

p:=Object( person ); #create object

p:-get_name();

Error, invalid input: person:-get_name uses a 1st argument, self (of type person), which is missing

What changes are needed in the above code to be able to use  obj:-method()  syntax?

Or is it possible that this change did not go into Maple 2021?


 

Hey

 

I can't find the toolbar for drawing i Maple 2021. 

Can anyone help me? I'm using Macbook.

 

I try to clik on at picture but I can't see it.

I try to insert a drawnig but I can't see it.

 

Hope someone can help me.

I would like to use the command "TensorArray"  to create the contravariant tensor.  As seen in the following simple routine, the command output seems to assign values to the contravariant tensor, but, on the last line, the contravariant value is still unassigned. 




 

 

 

Hello,

I have solved a differential equation from which I get a solution that contains special functions

BesselK(a1,b1) but also BesselK(a2,b2) and many time the same function but with different parameters

Now I would like to study asymptotics of the solution for small argument of the BesselK functions.

So I would like to replace each BesselK(x,y) (for any x and y) function by the corresponding small argument asymptotics 1/Gamma(x)*(y/2)^(-x)

Is that possbile or do I have to replace each of them manually?

Thanks in advance

 

 

Hi,

I am using Maple 13, 16 and 17 on 64 bit ubuntu 14.04LTS without 

any problems.

 

I tried to start the above Maple versions after upgrading to ubuntu 18.04LTS. Unfortunately, Maple does not start and transmits an incorrect hostid error message. The error message for Maple 16 is pasted below.

 

The command ifconfig -a produces an ethernet address 00:21:70:a6:a4:4b that is identical to the hostid given in the license.dat file.

 

I believe that the license manager flexnet is 32 bit. I used the synaptic 

manager to install lsb-base and ia32-libs (synaptic package manager refused to install lsb-core and transmitted some error messages). However, this did not help and I obtained the same hostid error message.

 

I do not know what is causing the hostid error message. Maybe some script file/s in the Maple installation can be modified such that Maple starts correctly?

 

Any assistance in getting Maple 13, 16, 17 to start on ubuntu 18.04LTS 

would be much appreciated.

 

Thank you very much for your support.
CF

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 

> ...:~/maple> maple16
> Maple initialization error, Invalid host.
> The hostid of this system does not match the hostid
> specified in the license file.
> Feature: Maple16
> Hostid: 002170a6a44b
> License path:
> /home/apps/maple16/toolbox/MapleSim/license/MapleSim.dat:/home/apps/maple16/license/license.dat:
> FLEXnet Licensing error:-9,57
> For further information, refer to the FLEXnet Licensing documentation,
> available at
> "https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.acresso.com&c=E,1,5ci9cywR8uvrXaVJ4IkoXH0TFBBbJwSK_TulrfrUDs5AyVQ4TXsHOVm5KWKAIhp4OZb9C4OAnmgylY1JC6fpbdZK9SjQLVrW012Uzxq18iDYC56NG2eDyHS8RPA,&typo=1".
.......
>

> root@<mailto:root@>...:~# ifconfig -a
> enp0s25: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
> ether 00:21:70:a6:a4:4b txqueuelen 1000 (Ethernet)
> RX packets 0 bytes 0 (0.0 B)
> RX errors 0 dropped 0 overruns 0 frame 0
> TX packets 0 bytes 0 (0.0 B)
> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
> device interrupt 22 memory 0xf6ae0000-f6b00000
>
> lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
> inet 127.0.0.1 netmask 255.0.0.0
> inet6 ::1 prefixlen 128 scopeid 0x10<host>
> loop txqueuelen 1000 (Local Loopback)
> RX packets 454 bytes 35138 (35.1 KB)
> RX errors 0 dropped 0 overruns 0 frame 0
> TX packets 454 bytes 35138 (35.1 KB)
> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

 

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 

EDIT 
x*f'(x^2)  + g'(x) = cos(x)  - 3x^3 and f(x^2) + g(x) = sin(x) -x^4. 

How to find the function f like this:
x*f'(x)  + g'(x) = cos(x)  - 3x^3 and f(x^2) + g(x) = sin(x) -x^4. 
I know that, f(x) = -1/2*x^2 + C. But, I tried. This answer incorrec. 
restart;
f := x -> -1/2*x^2 + C;
g := x -> sin(x) - 1/2*x^4 - C;
diff(f(x^2), x);
f(x^2) + g(x);
x*diff(f(x^2), x) + diff(g(x), x);

The uploaded worksheet describes a chain driven at constant speed by gears.

What math will describe its shape?

GearDrivenChain.mw

Greetings!

I am unable to evaluate an improper integral involving rational, exponential and Bessel functions. Can Maple do it? if not is there a way around.

test.mw

Would be nice if someone could add Maple 2021 to Software Change Requests list.

Right now Maple 2021 is unusable for us due to a big problem related to saving workbooks.

Yesterday, user @lcz , while responding as a third party to one of my Answers regarding GraphTheory, asked about breadth-first search. So, I decided to write a more-interesting example of it than the relatively simple example that was used in that Answer. I think that this is general enough to be worthy of a Post.

This application generates all maximal paths in a graph that begin with a given vertex. (I'm calling a path maximal if it cannot be extended and remain a path.) This code requires Maple 2019 or later and 1D input. This works for both directed and undirected graphs. Weights, if present. are ignored.

restart:

AllMaximalPaths:= proc(G::GRAPHLN, v)
description 
    "All maximal paths of G starting at v by breadth-first search"
;
option `Author: Carl Love <carl.j.love@gmail.com> 2021-Mar-17`;
uses GT= GraphTheory;
local 
    P:= [rtable([v])], R:= rtable(1..0),
    VL:= GT:-Vertices(G), V:= table(VL=~ [$1..nops(VL)]),
    Departures:= {op}~(GT:-Departures(G))
;
    while nops(P) <> 0 do
        P:= [
            for local p in P do
                local New:= Departures[V[p[-1]]] minus {seq}(p);
                if New={} then R,= [seq](p); next fi;                
                (
                    for local u in New do 
                        local p1:= rtable(p); p1,= u
                    od
                )       
            od
        ]
    od;
    {seq}(R)  
end proc
:
#large example:
GT:= GraphTheory:
K9:= GT:-CompleteGraph(9):
Pa:= CodeTools:-Usage(AllMaximalPaths(K9,1)):
memory used=212.56MiB, alloc change=32.00MiB, 
cpu time=937.00ms, real time=804.00ms, gc time=312.50ms

nops(Pa);
                             40320
#fun example:
P:= GT:-SpecialGraphs:-PetersenGraph():
Pa:= CodeTools:-Usage(AllMaximalPaths(P,1)):
memory used=0.52MiB, alloc change=0 bytes, 
cpu time=0ns, real time=3.00ms, gc time=0ns

nops(Pa);
                               72

Pa[..9]; #sample paths
    {[1, 2, 3, 4, 10, 9, 8, 5], [1, 2, 3, 7, 8, 9, 10, 6], 
      [1, 2, 9, 8, 7, 3, 4, 5], [1, 2, 9, 10, 4, 3, 7, 6], 
      [1, 5, 4, 3, 7, 8, 9, 2], [1, 5, 4, 10, 9, 8, 7, 6], 
      [1, 5, 8, 7, 3, 4, 10, 6], [1, 5, 8, 9, 10, 4, 3, 2], 
      [1, 6, 7, 3, 4, 10, 9, 2]}

Notes on the procedure:

The two dynamic data structures are

  • P: a list of vectors of vertices. Each vector contains a path which we'll attempt to extend.
  • R: a vector of lists of vertices. Each list is a maximal path to be returned.

The static data structures are

  • V: a table mapping vertices (which may be named) to their index numbers.
  • Departures: a list of sets of vertices whose kth set is the possible next vertices from vertex number k.

On each iteration of the outer loop, P is completely reconstructed because each of its entries, a path p, is either determined to be maximal or it's extended. The set New is the vertices that can be appended to the (connected to vertex p[-1]). If New is empty, then p is maximal, and it gets moved to R


The following code constructs an array plot of all the maximal paths in the Petersen graph. I can't post the array plot, but you can see it in the attached worksheet: BreadthFirst.mw

#Do an array plot of each path embedded in the graph:
n:= nops(Pa):
c:= 9: 
plots:-display(
    (PA:= rtable(
        (1..ceil(n/c), 1..c),
        (i,j)-> 
            if (local k:= (i-1)*ceil(n/c) + j) > n then 
                plot(axes= none)
            else 
                GT:-DrawGraph(
                    GT:-HighlightTrail(P, Pa[k], inplace= false), 
                    stylesheet= "legacy", title= typeset(Pa[k])
                )
            fi
    )),
    titlefont= [Times, Bold, 12]
);

#And recast that as an animation so that I can post it:
plots:-display(
    [seq](`$`~(plots:-display~(PA), 5)),
    insequence
); 

 

Hello there, 

Would you allow me to ask this (perhaps simple) question?

My goal is to express an equation as 'desired', but with no success with algsubs()/subs()/simplify(). 

Would you please show me the correct way?

 

restart:

PowerBalanceEq := 0 = e1(t) * i1(t) + e2(t) * i2(t) + e3(t) * i3(t);

0 = e1(t)*i1(t)+e2(t)*i2(t)+e3(t)*i3(t)

(1)

eq_i1 := i1(t) = solve(PowerBalanceEq, i1(t));

i1(t) = -(e2(t)*i2(t)+e3(t)*i3(t))/e1(t)

(2)

n21eq := n21 = e2(t) / e1(t);

n21 = e2(t)/e1(t)

(3)

eq_i2 := algsubs(n21eq, eq_i1);

i1(t) = -(e2(t)*i2(t)+e3(t)*i3(t))/e1(t)

(4)

eq_i3 := subs(n21eq, eq_i1);

i1(t) = -(e2(t)*i2(t)+e3(t)*i3(t))/e1(t)

(5)

eq_i4 := simplify(eq_i1, {e2(t) / e1(t) = n21});

i1(t) = (-i2(t)*n21*e1(t)-e3(t)*i3(t))/e1(t)

(6)

desired := i1(t) = -n21*i2(t) - e3(t)*i3(t)/e1(t);

i1(t) = -n21*i2(t)-e3(t)*i3(t)/e1(t)

(7)

 


Best Regards, 

In Kwon Park 

Download Q20210316.mw

How do I solve completely the diferential equation and also speed up the compilation of  the time is over 3000sec: 

eq1 := 2*m*(E + 8*Pi*epsilon/r)*f(r, t)/h^2 + R*diff(f(r, t), r $ 2)/r - diff(f(r, t), t $ 2)/(a^2*c^2) = 0;

iv1 := f(r, 0) = 0, f(R, t) = 0, D[1](f)(0, 0) = R;

Sol := pdsolve([eq1, iv1]);

Where f(r,t) is the function of variable r and t  in spherical coordinate and m, E, h, R, rb, a, and c are constants.

I also want to find the exact value of f(r,t) with the condition f(rb, 0) = 0; and diff(f(rb,t),t)=a*c for the value t=0 and if is possible the pulsation of the sinusoidal solution of f(r,t). [the solution is a combination of AiryAi ; AiryBi and sinusoidal sin(a*c*sqrt(-2*E*m - _c[1])*t/h)]. I didn't find the value of _c[1] for the 2 additional condition above.

The issue is the period of time between 2 consecutive zero of the f(r,t)=0

tks

First 420 421 422 423 424 425 426 Last Page 422 of 2216