MaplePrimes Questions

I expected plot with an undefined name to do nothing, but,

plot(asdf);

actually plots y=x!

How to create a hyperplane which perpendicular to groebner basis

Hello,

I am trying to write a procedure to see, which (di)-graphs are isomorphic (here represented by there 3*3 adjecency-matrices). When I try the procedure for all 3*3-matrices with entries in {0,1} (there are 512 of them), I get the following error:
"Error, (in GraphTheory:-IsIsomorphic) invalid subscript selector"

Can you possibly say, what I am doing wrong? My code is the following:

getIso3 := proc(liste)
  local i,k,M1,c,d:
  c := 0:
  M1 := [[liste[1]]]:
  for i from 2 to numelems(liste) do
    for k from 1 to numelems(M1) do
        if IsIsomorphic(Digraph([a,b,c], liste[i]),Digraph([a,b,c],M1[k][1])) then
          M1[k] := [op(M1[k]), liste[i]]:
          c := 1:
        end if:
    end do:
    if c=0 then
      M1 := [op(M1), [liste[i]]]:
    else
      c := 0:
    end if:   end do: 
  return(M1):
end proc:

 

My input is a list (JJ) of 512 3*3 matrices constructed the following way :

all9Perm := proc(list)
  local P,i,m,n,A:
  P := list:
  for i from 0 to 9 do
    m:= i:  n:= 9-i:
    A := combinat:-permute([1$n, 0$m]):
    P := [op(P), op(1..numelems(A),A)]:
  od:
  return(P):
end proc:
K := []:
L := all9Perm(K):
listoflistsToListofmatrices := proc(liste)
  local M,i:
  M := []:
  for i from 1 to numelems(liste) do
      M := [op(M), Matrix([
          [ liste[i][1] , liste[i][2] , liste[i][3] ],
          [ liste[i][4] , liste[i][5] , liste[i][6] ],
          [ liste[i][7] , liste[i][8] , liste[i][9] ]])
          ]:
  end do:
  return(M):
end proc:
JJ := listoflistsToListofmatrices(L):

 

When I run this procedure on some of the 512 matrices it does work, but it crashes somewhere around matrix 350. I have try so split the list of the 512 matrices, and I am able to run the procedure on these splits, but this is very inconvenient :-)

I hope you can help me. Also if this can be done in an easier way - I am new to programming and recieve help with a smile.

Yours, Tomas.

tord := plex(x, y, z);
G := Basis([hello1, hello2, hello3], tord);
ns, rv := NormalSet(G, tord);
Error, (in Groebner:-NormalSet) The case of non-zero-dimensional varieties is not handled
is this error due to version of maple?
which version do not have this error?
 

I wonder how to solve symbolically for like following coupled ODEs in Maple? 

On the other hand, I want to write the code for step by step solution of this problem. But I didn't find algorithm of the solution on the some books. Do you know some books including solving coupled ODEs ?

 

How to solve delay differential equation by method of steps in MAPLE software. 

In Mathematica, there is a command "LinearRecurrence" that lists a sequence generated by a linear recurrence.
For example, 
LinearRecurrence[{-3, 1}, {7, 2}, 10]
will produce the first ten numbers in the sequence defined by a0=7, a1=2; a_n = -3 an-1 + an-2.

Is there anything similar in Maple? 
If not, what would be the easiest way to do the same?

UPDATE: Two answers show how to do this example with rsolve, but it seems that this solution does not help in general for recurrence of high order.

Thank you.


 

restart

with(student)

``

G := S(t)*L(t)

S(t)*L(t)

(1)

m := 10

S[lambda] := sum(S[b]*lambda^b, b = 0 .. m); L[lambda] := sum(L[b]*lambda^b, b = 0 .. m); G[lambda] := subs(S(t) = S[lambda], G); G[lambda] := subs(L(t) = L[lambda], G[lambda]); G := G[lambda]; s := expand(G, lambda); ft := unapply(s, lambda); for i from 0 while i <= m do A1[i] := ((D@@i)(ft))(0)/factorial(i); print(A[i] = A1[i]) end do

A[0] = S[0]*L[0]

 

A[1] = L[0]*S[1]+L[1]*S[0]

 

A[2] = L[0]*S[2]+L[1]*S[1]+L[2]*S[0]

 

A[3] = L[0]*S[3]+L[1]*S[2]+L[2]*S[1]+L[3]*S[0]

 

A[4] = L[0]*S[4]+L[1]*S[3]+L[2]*S[2]+L[3]*S[1]+L[4]*S[0]

 

A[5] = L[0]*S[5]+L[1]*S[4]+L[2]*S[3]+L[3]*S[2]+L[4]*S[1]+L[5]*S[0]

 

A[6] = L[0]*S[6]+L[1]*S[5]+L[2]*S[4]+L[3]*S[3]+L[4]*S[2]+L[5]*S[1]+L[6]*S[0]

 

A[7] = S[5]*L[2]+S[2]*L[5]+S[1]*L[6]+S[0]*L[7]+S[4]*L[3]+S[3]*L[4]+S[6]*L[1]+S[7]*L[0]

 

A[8] = S[2]*L[6]+S[0]*L[8]+S[8]*L[0]+S[4]*L[4]+S[1]*L[7]+S[3]*L[5]+S[6]*L[2]+S[5]*L[3]+S[7]*L[1]

 

A[9] = S[6]*L[3]+S[9]*L[0]+S[4]*L[5]+S[2]*L[7]+S[3]*L[6]+S[8]*L[1]+S[0]*L[9]+S[1]*L[8]+S[7]*L[2]+S[5]*L[4]

 

A[10] = S[0]*L[10]+S[10]*L[0]+S[1]*L[9]+S[6]*L[4]+S[7]*L[3]+S[3]*L[7]+S[2]*L[8]+S[4]*L[6]+S[9]*L[1]+S[5]*L[5]+S[8]*L[2]

(2)

s[n+1] := (1-f)*alpha*(int(v__n, t = 0 .. t))-beta*c*(int(A__n, t = 0 .. t))-(`&theta;__1`+a+Pi)*(int(s__n, t = 0 .. t))

v[n+1] := `&theta;__1`*(int(s__n, t = 0 .. t))-((1-f)*alpha+f*`&theta;__2`+a+Pi)*(int(v__n, t = 0 .. t))

e[n+1] := `&beta;c`*(int(A__n, t = 0 .. t))-(delta+a+Pi)*(int(e__n, t = 0 .. t))

i[n+1] := delta*(int(e__n, t = 0 .. t))-(eta+a+Pi)*(int(i__n, t = 0 .. t))

r[n+1] := eta*(int(i__n, t = 0 .. t))+`f&theta;__2`*(int(v__n, t = 0 .. t))-(a+Pi)*(int(r__n, t = 0 .. t))

for n from 0 to 4 do  end do

``

(1-f)*alpha*v__n*t-beta*c*s__0*i__0*t-(`&theta;__1`+a+Pi)*s__n*t

(3)

"for n:=0, n=1, n=2, n=3, n=4:  `s__1, ``s__2__`, `s__3, ``s__4`,  `i__1`, `i__2, ``i__3`, `i__4`,   `r__1`, `r__2`, `r__3, ``r__4`:"

Error, unterminated for loop

"for n:=0, n=1, n=2, n=3, n=4:  `s__1, ` `s__2__`, `s__3, __3__, s__4`, `i__1__`, `i__2, ` `i__3`, `i__4`, `r__1`, `r__2`, `r__3, ` `r__4`:"

 

"and s(t)=`s__1_`+`s__2 __`+ `s__3, `+`s__4`,"

i(t) = i__1+`i__2, `+i__3+i__4, r(t) = r__1+r__2+r__3_+r__4

"but A[n]:=(1)/(n!) [((&DifferentialD;)^(n))/(&DifferentialD; lambda^(n)) ((&sum;)`s__k`lambda^(k))((&sum;)`i__k`lambda^(k)) ]() ? ()|() ? (lambda=0)"

Error, missing numerator

Typesetting:-mambiguous(Typesetting:-mrow(Typesetting:-mi("but", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-msub(Typesetting:-mi("A", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mi("n", fontstyle = "italic", mathcolor = "#c800c8", mathvariant = "italic", placeholder = "true"), subscriptshift = "0"), Typesetting:-mo("&Assign;", accent = "false", fence = "false", largeop = "false", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "false", rspace = "0.2777778em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mfrac(Typesetting:-mn("1", mathvariant = "normal"), Typesetting:-mrow(Typesetting:-mi("n", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&excl;", accent = "false", fence = "false", largeop = "false", lspace = "0.1111111em", mathvariant = "normal", movablelimits = "false", rspace = "0.1111111em", separator = "false", stretchy = "false", symmetric = "false")), bevelled = "false", denomalign = "center", linethickness = "1", numalign = "center"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-msup(Typesetting:-mo("&DifferentialD;", accent = "unset", fence = "unset", largeop = "unset", lspace = "0.0em", mathvariant = "normal", movablelimits = "unset", rspace = "0.0em", separator = "unset", stretchy = "unset", symmetric = "unset"), Typesetting:-mi("n", fontstyle = "italic", mathvariant = "italic"), superscriptshift = "0"), Typesetting:-mrow(Typesetting:-mo("&DifferentialD;", accent = "unset", fence = "unset", largeop = "unset", lspace = "0.0em", mathvariant = "normal", movablelimits = "unset", rspace = "0.0em", separator = "unset", stretchy = "unset", symmetric = "unset"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-msup(Typesetting:-mi("&lambda;", fontstyle = "normal", mathvariant = "normal"), Typesetting:-mi("n", fontstyle = "italic", mathvariant = "italic"), superscriptshift = "0")), bevelled = "false", denomalign = "center", linethickness = "1", numalign = "center"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mo("&sum;", accent = "unset", fence = "unset", largeop = "true", lspace = "0.0em", mathvariant = "normal", movablelimits = "true", rspace = "0.1666667em", separator = "unset", stretchy = "true", symmetric = "unset"), Typesetting:-mrow(Typesetting:-mi("k", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&equals;", accent = "false", fence = "false", largeop = "false", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "false", rspace = "0.2777778em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mn("0", mathvariant = "normal")), Typesetting:-mn("4", mathvariant = "normal"), accent = "false", accentunder = "false"), Typesetting:-mi("`s__k`"), Typesetting:-msup(Typesetting:-mi("&lambda;", fontstyle = "normal", mathvariant = "normal"), Typesetting:-mi("k", fontstyle = "italic", mathvariant = "italic"), superscriptshift = "0")), mathvariant = "normal"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mo("&sum;", accent = "unset", fence = "unset", largeop = "true", lspace = "0.0em", mathvariant = "normal", movablelimits = "true", rspace = "0.1666667em", separator = "unset", stretchy = "true", symmetric = "unset"), Typesetting:-mrow(Typesetting:-mi("k", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&equals;", accent = "false", fence = "false", largeop = "false", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "false", rspace = "0.2777778em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mn("0", mathvariant = "normal")), Typesetting:-mn("4", mathvariant = "normal"), accent = "false", accentunder = "false"), Typesetting:-mi("`i__k`"), Typesetting:-msup(Typesetting:-mi("&lambda;", fontstyle = "normal", mathvariant = "normal"), Typesetting:-mi("k", fontstyle = "italic", mathvariant = "italic"), superscriptshift = "0")), mathvariant = "normal"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false")), open = "&lsqb;", close = "&rsqb;", mathvariant = "normal"), Typesetting:-mfrac(Typesetting:-mambiguous(Typesetting:-merror("?"), Typesetting:-merror("missing numerator")), Typesetting:-mphantom(Typesetting:-mrow(Typesetting:-mi("x", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&equals;", accent = "unset", fence = "unset", largeop = "unset", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "unset", rspace = "0.2777778em", separator = "unset", stretchy = "unset", symmetric = "unset"), Typesetting:-mi("a", fontstyle = "italic", mathvariant = "italic")), constraints = "height-only"), bevelled = "false", denomalign = "center", linethickness = "0", numalign = "center"), Typesetting:-mo("&verbar;", accent = "unset", fence = "unset", largeop = "unset", lspace = "0.1111111em", mathvariant = "normal", movablelimits = "unset", rspace = "0.1111111em", separator = "unset", stretchy = "true", symmetric = "unset"), Typesetting:-mfrac(Typesetting:-mphantom(Typesetting:-mi("f(x)", fontstyle = "italic", mathvariant = "italic"), constraints = "height-only"), Typesetting:-mrow(Typesetting:-mi("&lambda;", fontstyle = "normal", mathvariant = "normal"), Typesetting:-mo("&equals;", accent = "false", fence = "false", largeop = "false", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "false", rspace = "0.2777778em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mn("0", mathvariant = "normal")), bevelled = "false", denomalign = "center", linethickness = "0", numalign = "center")))

 

NULLI have tried to do the above but got the error messages. I tried changing the L in that computation above to i to enable me get the desired result but i couldn't.

> Please how can I generate the values S1,S2,S3,S4; i1,i2,i3,i4 and r1,r2,r3,r4 and finally do

S(t)=S1 + S2 + S3 + S4; i(t)= i1+i2+i3+i4 ; and r(t)=r1,r2,r3,r4  using Maple?

NULL

``

``


 

Download Adomian.Elisha2.mw

Dear All,

The following code plots the bifurcation diagram for a three-dimensional continuous dynamical system as a variable Re varies. However, the resulting plot (by pointplot command) is rather ugly, comparing with other bifurcation diagrams, see attached. Could anyone point me out how to improve its looking?

``

restart:
with(plots): with(DEtools): with(plottools):with(LinearAlgebra):
doSol:=proc( R )
             local t_start:=2500,
                   t_end:=5000,
                   b:=-3,
                   c:=3,
                   v1:=1,
                   f:=-4,
                   v2:=2.0,
                   omega:=0.1*sqrt(R),
                   epsilon:=evalf(1/R),
                   k:=0.1,
                   kH:=(c+1)/(b-1),
                   sys, evs, w, M, T, i, tt, solA, N_alpha,
                   r_center, z_center, Zshift, alpha, alpha1,
                   alpha2, del_alpha, m, Z, Rshift, RR;
             sys:=diff(u1(t),t)=v1*u1(t)-(omega+k*u2(t)^2)*u2(t)-(u1(t)^2+u2(t)^2-b*z(t)^2)*u1(t),
                  diff(u2(t),t)=(omega+k*u1(t)^2)*u1(t)+v1*u2(t)-(u1(t)^2+u2(t)^2-b*z(t)^2)*u2(t),
                  diff(z(t),t)=z(t)*(kH*v1+c*u1(t)^2+c*u2(t)^2+z(t)^2)+epsilon*z(t)*(v2+f*z(t)^4):
             solA:=dsolve({sys, u1(0)=0.6, u2(0)=0.6, z(0)=0.1},
                          {u1(t),u2(t),z(t)},
                          numeric, method=rkf45, maxfun=10^7,
                          events=[[[u1(t)=0, u2(t)>0], halt]]
                         );
             evs:=Array():
             evs(1,1..4):=Array([t,u1(t),u2(t),z(t)]);
             interface(warnlevel=0):

             for i from 2 do
                 w:=solA(t_end):
                 if   rhs(w[1])<t_end
                 then evs(i,1..4):=Array(map(rhs, w));
                      solA(eventclear);
                 else break;
                 fi
             od:

             interface(warnlevel=3):
             M:=DeleteRow(convert(evs,matrix),1):

             T:=M[..,1]:

             for i from 1 do
                 tt:=T[i]:
                 if   tt>=t_start
                 then break;
                 end if;
             end do:

             RR:=M[i..,3]: Z:=M[i..,4]:

             N_alpha:=numelems(RR):

             r_center:=add(RR[i],i=1..N_alpha)/N_alpha:
             z_center:=add(Z[i],i=1..N_alpha)/N_alpha:

             Zshift:=Z-~r_center: Rshift:=RR-~z_center:

             alpha:=(arctan~(Zshift/~Rshift)+(Pi/2)*sign~(Rshift))/~(2*Pi)+~0.5:

             return alpha;
  end proc:

i_start:=125: i_end:=250: i_delta:=0.1:

M:=[seq( [j, doSol(j)], j=i_start..i_end, i_delta)]:

S:=seq([Vector(numelems(M[i,2]),fill=M[i,1]),M[i,2]], i=1..numelems(M),1):
display(seq( pointplot(S[i],
             symbolsize=1,
             symbol=point) ,
             i=1..numelems(M)),
             axes=boxed,
             view=[i_start..i_end,0..1],
             size=[650,400],
             axesfont= ["TimesNewRoman", 16],
             labels=["Re",phi[n]],
             labelfont = ["TimesNewRoman", 16],
             labeldirections=[horizontal, vertical]);

``


 

Bifurcation_diagram.mw

Thank you.

Very kind wishes,

Wang Zhe

When I right click on an expression, I only some times get the context menu (under Maple 2016 in document mode, in Win 10).

Any suggestions - Anyone else having this problem? - I know how to use the long forms, but this is for students - for a brief exposure to Maple.

hi

how i can remove this error?

thanks

Error, (in pdsolve/numeric/process_IBCs) initial/boundary conditions can only contain derivatives which are normal to the boundary, got (D[1](H))(x, 0)
 

RR-steady.mw


 

 

"restart;beta:=1:k:=2:L:=1: W(t):=(Heaviside(t-1)-Heaviside(t-1.1)); theta:=3:   hR:=1 :hD(x):=hR+tan(theta)*(L-x) :W0:=2: f(x):=sqrt((hR^(2)+(W0)/(k)*(L^(2)-x^(2)))):t:=5:M:=2:theta:=20:"

proc (t) options operator, arrow; Heaviside(t-1)-Heaviside(t-1.1) end proc

(1)

PDE1 := diff(H(x, y), x, x)+diff(H(x, y), y, y)+2*W(t)/k = 0

diff(diff(H(x, y), x), x)+diff(diff(H(x, y), y), y) = 0

(2)

bcs1 := {H(L, y) = hR^2, (D[1](H))(0, y) = 0};

{H(1, y) = 1, (D[1](H))(0, y) = 0}

(3)

bcs2 := {H(x, M) = hD(x)^2, (D[1](H))(x, 0) = 0}

{H(x, 2) = (1+tan(20)*(1-x))^2, (D[1](H))(x, 0) = 0}

(4)

pdsolve(PDE1, `union`(bcs1, bcs2), numeric)

Error, (in pdsolve/numeric/process_IBCs) initial/boundary conditions can only contain derivatives which are normal to the boundary, got (D[1](H))(x, 0)

 

``


 

Download RR-steady.mw

Hi,

I want to fit a curve to the function that you can see in the picture "maple4.png" (in the appendix) to determine two parameters. This works in Maple 2.
Unfortunately Maple 18 shows me an error. Can you help me with this problem?
 
 
 
 
 
Best regards

 

Hi everybody,

I have to solve a system  of 3 equations in 3 unknowns.
One equation is linear while the others are not because of some  sinh(cste*unknown) term.
More of this the unknowns must verify some constraints of inequality type (but always very simple ; for instance “unknown <= value”).

solve fails because of the sinh terms
fsolve fails due to the inequalities


What Maple procedure do you advise me to use to solve this system ?
(at this stage I think advices could be sufficient ; if I keep coming up against the problem I will submit you a more detailed question)


Thanks in advance

 

Hello,

I'm trying to send data from Excel to Maple through Excel Add-in.

However, in Excel,  I can only create variables. I want to send these variables to Maple and access them in Maple.

I want to know how to send variables from Excel to Maple.

I look forward your tips.

Thank you!

I have a list of functions which looks like this:

RR:={F[l, m-2, n-1], F[l, m+2, n], F[l, m+2, n-1], F[l-1, m+1, n-2], ...}

I wish to remove the first and second arguments from the functions, so only leaving the third argument containing the n's. I then wish to group these remaining terms together to shorten the list. i.e.

RR:={F[n-1], F[n], F[n-2]}

I have used the 'subsop' command with 1 and 2 specified as NULL in a loop, but I was wondering if there is a better way to do it? I like to avoid loops where possible and use some inbuilt Maple magic to make it tidier and (usually) more efficient.

-Yeti

 

First 997 998 999 1000 1001 1002 1003 Last Page 999 of 2434