tomleslie

13776 Reputation

19 Badges

14 years, 57 days

MaplePrimes Activity


These are answers submitted by tomleslie

made an error. Like the following excerpt from the pdsolve/numeric help page states (emphasis added

The solver has two modes of operation.
The first mode of operation uses the default method, which is a centered implicit scheme, and is capable of finding solutions for higher order PDE or PDE systems. The PDE systems must be sufficiently close to a standard form for the method to find the numerical solution.
The second mode of operation is strictly educational, and allows specification of a particular method to solve a PDE. This mode is restricted to a single PDE.

You may want to ask the question - what does "close to a standard form" actually mean - I have no idea.

Persuading solve() to return only those solutions which you wantcan be a bit of a "black art".

The (usual) first approach, is to restrict the domain of the problem, by using assumptions ( in your case beta>0, beta<1). Then restrict the range of the problem, by adding inequalities (in your case xi>0, xi<1) to the equation to be solved. You should be aware that either/both of these approaches can fail: sometimes Maple will provide a warning message stating that it "may" be ignoring assumptions on variables; also Maple's only has a rather limited capability to deal with inequalities in the system to be solved.

However this approach appears to work in your case, see the attached.

  restart;
#
# Set assumptions restricting domain
#
  assume(beta>0, beta<1):
  interface(showassumed=0):
  eq[1]:=(1/6)*beta^3+(1/2)*xi^2*beta-(1/2)*beta^2-(1/2)*xi^2+(1/3)*beta = 0:
  eq[2]:=(1/6)*beta*(beta^2+3*xi^2-6*xi+2) = 0:
#
# Include inequalities to restrict range of xi
#
  left:=solve([ eq[1], xi>0, xi<1],xi)[];
  right:=solve([ eq[2],xi>0,  xi<1], xi)[];
  plot( [ rhs(left), rhs(right)],
        beta=0..1,
        color=[red, blue],
        legend=["left", "right"],
        labels=['beta', xi]
      );

xi = (1/3)*(-3*beta^2+6*beta)^(1/2)

 

xi = 1-(1/3)*(-3*beta^2+3)^(1/2)

 

 

 

Download solve.mw

there is often more than one way. See the attached for an alternative

  restart;
  with(plots):
  ic:=[seq(j, j=0..1, 0.1)]:
  display( [ seq
             ( odeplot
               ( dsolve
                 ( { diff(x(t),t)=y(t),
                     diff(y(t),t)=-x(t),
                     x(0)=1,
                     y(0)=ic[j]
                   },
                   numeric
                 ),
                 [[t, x(t)], [t, y(t)]],
                 t=0..10,
                 color=[red, blue]
               ),
               j=1..numelems(ic)
             )
           ]
         );

 

 

 

 

 

Download odeIC.mw

 

will import from a text file containing this

t[s]; scanId; m/z; I[A]; pTot[mbar]
2.00;0;0; 0.000000e+000; 0.000000e+000
4.00;0;0; 0.000000e+000; 0.000000e+000
441.00;0;0; 0.000000e+000;1,29E+00
443.00;0;0; 0.000000e+000;1,29E+00
453.00;0;0; 0.000000e+000;1,26E+00
455.00;0;0; 0.000000e+000;1,24E+00
463.00;1; 0.390625;8,14E-05;1,23E+00
464.00;1; 0.40625;1,23E-04;1,43E+00
464.00;1; 0.421875;1,73E-04;1,43E+00
464.00;1; 0.4375;2,27E-04;1,43E+00
464.00;1; 0.453125;2,77E-04;1,43E+00

to a matrix. Obviously you will have to change 'fname', the location of the data file, to something appropriate for your installation

  restart;
  interface(rtablesize=20):
  with(StringTools):
  fname:="C:/Users/TomLeslie/Desktop/data.txt":
  T[0]:=Split( readline(fname), ";"):
  j:=1:
  line:=readline(fname):
  while line <> 0 do
        T[j]:=parse~( map2( Subs, ["E"="e", ","="."], Split(line, ";")));
        line:=readline(fname):
        j:=j+1;
  od:
  M:=Matrix([seq(T[k],k=0..j-1)]);

Matrix(12, 5, {(1, 1) = "t[s]", (1, 2) = " scanId", (1, 3) = " m/z", (1, 4) = " I[A]", (1, 5) = " pTot[mbar]", (2, 1) = 2.00, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0., (2, 5) = 0., (3, 1) = 4.00, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0., (3, 5) = 0., (4, 1) = 441.00, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0., (4, 5) = 1.29, (5, 1) = 443.00, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0., (5, 5) = 1.29, (6, 1) = 453.00, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0., (6, 5) = 1.26, (7, 1) = 455.00, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0., (7, 5) = 1.24, (8, 1) = 463.00, (8, 2) = 1, (8, 3) = .390625, (8, 4) = 0.814e-4, (8, 5) = 1.23, (9, 1) = 464.00, (9, 2) = 1, (9, 3) = .40625, (9, 4) = 0.123e-3, (9, 5) = 1.43, (10, 1) = 464.00, (10, 2) = 1, (10, 3) = .421875, (10, 4) = 0.173e-3, (10, 5) = 1.43, (11, 1) = 464.00, (11, 2) = 1, (11, 3) = .4375, (11, 4) = 0.227e-3, (11, 5) = 1.43, (12, 1) = 464.00, (12, 2) = 1, (12, 3) = .453125, (12, 4) = 0.277e-3, (12, 5) = 1.43})

(1)

 

Download readData.mw

the attached produces an output file whose contents are pasted below

{{a, b}, {b, c}}
{{d, e}, {e, f}}
{{d, f}, {e, f}}
{{a, h}, {h, i}}
{{a, i}, {h, i}}
{{d, e}, {d, f}}
{{a, h}, {a, i}}
{{c, d}}
{{a, b}, {a, c}}
{{a, c}, {b, c}}

Is that what you want? - Obviously you will have to change the file path to somethhing appropriate for your machin

restart;
M:=Vector[column](10, [{{a, b}, {b, c}}, {{d, e}, {e, f}},
{{d, f}, {e, f}}, {{a, h}, {h, i}}, {{a, i}, {h, i}},
{{d, e}, {d, f}}, {{a, h}, {a, i}},{{c, d}}, {{a, b}, {a, c}}, {{a, c}, {b, c}}]):
Export("C:/Users/TomLeslie/Desktop/test.csv", M):

 

Download toCSV.mw

but if you isolate all the first derivatives on to the lhs of the odes, then the dsolve(...,numeric) process executes in negligible time.

See the attached

sys := {diff(a[0](t), t)-(diff(a[1](t), t))+diff(a[2](t), t)-(diff(a[3](t), t))+diff(a[4](t), t)-(diff(a[5](t), t)) = 0, diff(b[0](t), t)+diff(b[1](t), t)+diff(b[2](t), t)+diff(b[3](t), t)+diff(b[4](t), t)+diff(b[5](t), t) = 0, diff(a[0](t), t)-.8090169943*(diff(a[1](t), t))+.309016994*(diff(a[2](t), t))-16*a[2](t)+.3090169950*(diff(a[3](t), t))+77.66563145*a[3](t)-.809016994*(diff(a[4](t), t))-187.3312629*a[4](t)+1.000000002*(diff(a[5](t), t))+289.4427191*a[5](t) = 0, diff(a[0](t), t)-.3090169938*(diff(a[1](t), t))-.8090169951*(diff(a[2](t), t))-16*a[2](t)+.8090169933*(diff(a[3](t), t))+29.66563140*a[3](t)+.3090169967*(diff(a[4](t), t))+27.33126306*a[4](t)-1.000000000*(diff(a[5](t), t))-110.5572808*a[5](t) = 0, diff(a[0](t), t)+.3090169938*(diff(a[1](t), t))-.8090169951*(diff(a[2](t), t))-16*a[2](t)-.8090169933*(diff(a[3](t), t))-29.66563140*a[3](t)+.3090169967*(diff(a[4](t), t))+27.33126306*a[4](t)+1.000000000*(diff(a[5](t), t))+110.5572808*a[5](t) = 0, diff(a[0](t), t)+.8090169943*(diff(a[1](t), t))+.309016994*(diff(a[2](t), t))-16*a[2](t)-.3090169950*(diff(a[3](t), t))-77.66563145*a[3](t)-.809016994*(diff(a[4](t), t))-187.3312629*a[4](t)-1.000000002*(diff(a[5](t), t))-289.4427191*a[5](t) = 0, diff(a[1](t), t)+4*(diff(a[2](t), t))+9*(diff(a[3](t), t))+16*(diff(a[4](t), t))+25*(diff(a[5](t), t))-3*(diff(b[1](t), t))+12*(diff(b[2](t), t))-27*(diff(b[3](t), t))+48*(diff(b[4](t), t))-75*(diff(b[5](t), t)) = 0, diff(b[0](t), t)-.8090169943*(diff(b[1](t), t))+.309016994*(diff(b[2](t), t))-48*b[2](t)+.3090169950*(diff(b[3](t), t))+232.9968944*b[3](t)-.809016994*(diff(b[4](t), t))-561.9937886*b[4](t)+1.000000002*(diff(b[5](t), t))+868.3281572*b[5](t) = 0, diff(b[0](t), t)-.3090169938*(diff(b[1](t), t))-.8090169951*(diff(b[2](t), t))-48*b[2](t)+.8090169933*(diff(b[3](t), t))+88.99689421*b[3](t)+.3090169967*(diff(b[4](t), t))+81.99378917*b[4](t)-1.000000000*(diff(b[5](t), t))-331.6718425*b[5](t) = 0, diff(b[0](t), t)+.3090169938*(diff(b[1](t), t))-.8090169951*(diff(b[2](t), t))-48*b[2](t)-.8090169933*(diff(b[3](t), t))-88.99689421*b[3](t)+.3090169967*(diff(b[4](t), t))+81.99378917*b[4](t)+1.000000000*(diff(b[5](t), t))+331.6718425*b[5](t) = 0, diff(b[0](t), t)+.8090169943*(diff(b[1](t), t))+.309016994*(diff(b[2](t), t))-48*b[2](t)-.3090169950*(diff(b[3](t), t))-232.9968944*b[3](t)-.809016994*(diff(b[4](t), t))-561.9937886*b[4](t)-1.000000002*(diff(b[5](t), t))-868.3281572*b[5](t) = 0, diff(a[0](t), t)+diff(a[1](t), t)+diff(a[2](t), t)+diff(a[3](t), t)+diff(a[4](t), t)+diff(a[5](t), t)-(diff(b[0](t), t))+diff(b[1](t), t)-(diff(b[2](t), t))+diff(b[3](t), t)-(diff(b[4](t), t))+diff(b[5](t), t) = 0}; newsys := solve(sys, indets(sys, specfunc(diff)))

ics := {a[0](0) = 0.7499999990e-1, a[1](0) = .1500000001, a[2](0) = .1500000002, a[3](0) = .1500000000, a[4](0) = .1499999999, a[5](0) = 0.7499999987e-1, b[0](0) = .9750000000, b[1](0) = 0.5000000005e-1, b[2](0) = -0.5000000005e-1, b[3](0) = 0.5000000000e-1, b[4](0) = -0.4999999998e-1, b[5](0) = 0.2499999996e-1}
 
sols := CodeTools:-Usage(dsolve(`union`(newsys, ics), numeric)); plots:-odeplot(sols, [[t, a[2](t)], [t, b[2](t)]], t = 0 .. 1)

 

NULL

``

NULL

Download odd_ode.mw

command which acts in the way you describe (ie imports as a string) is readline(). Whilst this command is useful in some contexts, it is a bit "clunky" for general use.

It is probably better to save "executable code" as an "mpl" file, which is plaintext, human-readable (same as Maple's 1D input) and can be modified in your favourite text editor

"mpl" files can either be created from a worksheet within Maple using File->Export As from the menus, or created with an external text editor, or a mixture of both

"mpl" files can be loaded into a new worksheet with a simple "read" command. Code in the file will be read/executed. Consideer the "toy" example shown in the attached, where I have used File->Export As on the code I provided for this problem

https://www.mapleprimes.com/questions/235455-Brianch0n-Theoreme-With-Hexagon,

to create the mpl file. Rather annoylngly this site does not permit the uploading of "mpl", for which the workaround is to "zip" them like this hexplot3.zip. Once you unzip this file, it can be read/executed as shown in the worksheet below

 

  restart;
#
# OP will have to change the file path in the following
# depnding on where (s)he, saved the "mpl" file
#
# Code in the file will read/execute with the following
# command, and produce a geometric construction, which
# happens to be a solution I provided for the problem
# posed here
#
# https://www.mapleprimes.com/questions/235455-Brianch0n-Theoreme-With-Hexagon
#
# The execution takes a few seconds, so wait
#
  read "C:/Users/TomLeslie/Desktop/hexplot3.mpl";

 

 

Download toyRead.mw

 

the attached fulfils what you were trying to achieve - but at least it executes!

  restart;
  with(plots):
  local gamma:
  line := proc (x1, y1, x2, y2)
                options operator, arrow;
                (x-x1)*(y2-y1)-(y-y1)*(x2-x1)
          end proc:
  R := 3:
  ang := [0, (1/3)*Pi, 3*Pi*(1/4)+.2, 7*Pi*(1/6)+.4, 8*Pi*(1/5), 13*Pi*(1/7)]:
  for i to 6 do
      P || i := [R*cos(ang[i]), R*sin(ang[i])]
  end do:
  pts := [seq(P || i, i = 1 .. 6)]:
  for i to 6 do
      tang || i := x*P || i[1]+y*P || i[2] = R^2
  end do:
  sol:=solve({tang1,tang3},{x,y}):
  Q13:=[subs(sol,x),subs(sol,y)]:
  sol := solve({tang1, tang2}, {x, y}):
  Q1 := [subs(sol, x), subs(sol, y)]:
  sol := solve({tang2, tang3}, {x, y}):
  Q2 := [subs(sol, x), subs(sol, y)]:
  sol := solve({tang3, tang4}, {x, y}):
  Q3 := [subs(sol, x), subs(sol, y)]:
  sol := solve({tang4, tang5}, {x, y}):
  Q4 := [subs(sol, x), subs(sol, y)]:
  sol := solve({tang5, tang6}, {x, y}):
  Q5 := [subs(sol, x), subs(sol, y)]:
  sol := solve({tang1, tang6}, {x, y}):
  Q6 := [subs(sol, x), subs(sol, y)]:
  ptQ := [seq(Q || i, i = 1 .. 6)]:
  line14 := line(Q1[1], Q1[2], Q4[1], Q4[2]):
  L14 := implicitplot(line14, x = -10 .. 10, y = -10 .. 10, color = red):
  line25 := line(Q2[1], Q2[2], Q5[1], Q5[2]):
  L25 := implicitplot(line25, x = -10 .. 10, y = -10 .. 10, color = red):
  line36 := line(Q3[1], Q3[2], Q6[1], Q6[2]):
  L36 := implicitplot(line36, x = -10 .. 10, y = -10 .. 10, color = red):
  sol := solve({line14, line25}, {x, y}):
  I1 := [subs(sol, x), subs(sol, y)]:
  lineP23 := line(P2[1], P2[2], P3[1], P3[2]):
  lineP56 := line(P5[1], P5[2], P6[1], P6[2]):
  sol := solve({lineP23, lineP56}, {x, y}):
  gamma := [subs(sol, x), subs(sol, y)]:
  lineP12 := line(P1[1], P1[2], P2[1], P2[2]):
  lineP45 := line(P4[1], P4[2], P5[1], P5[2]):
  sol := solve({lineP12, lineP45}, {x, y}):
  beta := [subs(sol, x), subs(sol, y)]:
  lineP34 := line(P3[1], P3[2], P4[1], P4[2]):
  lineP16 := line(P1[1], P1[2], P6[1], P6[2]):
  sol := solve({lineP16, lineP34}, {x, y}):
  alpha := [subs(sol, x), subs(sol, y)]:
  pl:= line(alpha[1], alpha[2], gamma[1], gamma[2]):
#  hexa := seq(implicitplot(tang||i, x = -20 .. 20, y = -20 .. 20, linestyle=3,color = blue),i=1..6);
#  hexa:=plot([seq([P||i,P||(i mod 6)+1],i=1..6),color=green); 
  hexa:=plot([seq([`||`(P,i), `||`(P, irem(i,6)+1)],i=1..6)],thickness=4,color=green):
  hex:=plot([[Q1,Q2],[Q2,Q3],[Q3,Q4],[Q4,Q5],[Q5,Q6],[Q6,Q1]],thickness=4,color=green):
  tp := textplot({seq([op(pts[i]), cat("P", i)], i = 1 .. 6)}, 'align' = {'above', 'left'}):
  tpq := textplot({seq([op(ptQ[i]), cat("Q", i)], i = 1 .. 6)}, 'align' = {'above', 'left'}):
  TP:=textplot([[I1[],"I"],[alpha[],"alpha"],[beta[],"beta"],[gamma[],"gamma"]],'align' = {'above', 'left'}):
  slopes:=[seq(((dx,dy)->dy/dx)((pts[i]-pts[(i mod 6)+1])[]),i=1..6)]:
  lines:=zip((pt,slope)->y=slope*(x-pt[1])+pt[2],pts,slopes):
  plotpts:=plot(pts,style=point,colour=red,symbol=solidcircle,symbolsize=5):
  plotptQ:=plot(ptQ,style=point,colour=black,symbol=solidcircle,symbolsize=5):
  plotlines:=plot(rhs~(lines),style=line,linestyle=3,colour=magenta):
  cir:=implicitplot(x^2+y^2=R^2,x=-R..R,y=-R..R,color=black):
  PL:=implicitplot(pl,x=-1..15,y=-15..6,color=blue,thickness=3):
  display( plotpts,plotptQ,plotlines,hex,cir,L14,L25,L36,PL,tp,tpq,TP,
           axis = [gridlines = [4, color = blue]],
           view=[-6..10,-15..6],
           scaling=constrained,
           axes=none,
           size=[800,800]
         );

 

 

 

Download hexplt.mw

You state

This is something that has been a problem using Maple for decades.

Is it at all possible to create indexed variables ?

It has always been possible to create "indexed variables" - and you have a large choice.

Depending on what you want to do with these variables, you can create them as lists, tables, arrays, vectors, or matrices. So which of these have you (but no-one else) had a problem creating (for decades!?!)

to come across such a grabled worksheet - quantities defined and never used, quantities defined multiple times, no dinction made between functions and indexed variables etc, etc.

In the attached I have removed a lot of stuff you definitely don't need and made a lot of wild guesses about your intentions at various points. I suggest you read it very carefully because the chances of all of my "wild guesses" being correct iare not very good!

Still - at least it executes.

restart:
N[t]:=0.7: N[b]:=0.6:
Gr:=2.0: G[1]:=0.5: j[1]:=0.4: Pr:=2.5:
R:=1.3: Sc:=0.4:g[1]:=0.5:

F[0]:=0: F[1]:=1: F[2]:= A/2:
delta[-1]:=0: delta[0]:=1: delta[1]:=0:
Theta[0]:=1: Theta[1]:=B:
Phi[0]:=1: Phi[1]:=C:

for k from 2 to 20 do
    delta[k]:=0:
od:

for k from 0 to 3 do
    F[k + 3] := ( add((k - m + 1)*F[k - m + 1]*(m + 1)*F[m + 1], m = 0 .. k)*(1 + G[1]) + Gr*Theta[k] - add(F[k - m]*(m + 1)*(m + 2)*F[m + 2], m = 0 .. k) + (k + 1)*F[k + 1]*(M^2 + j[1]))/((k + 1)*(k + 2)*(k + 3)):
end do:

for k from 0 to 3 do
    Theta[k + 2] := -Pr*(N[t]*add(add(delta[l - 1]*(m - l + 1)*Theta[m - l + 1]*(k - m + 1)*Theta[k - m + 1], l = 0 .. m), m = 0 .. k) + add(F[k - m]*(m + 1)*Theta[m + 1], m = 0 .. k) + N[b]*add((k - m + 1)*Theta[k - m + 1]*(m + 1)*Phi[m + 1], m = 0 .. k) + Delta*Theta[k] - g[1]*add(Theta[k - m]*(m + 1)*F[m + 1], m = 0 .. k))/((1 + (4*R)/3)*(k + 1)*(k + 2)):
end do:

for k from 0 to 3 do
    Phi[k + 2] := -(Sc*add(F[k - m]*(m + 1)*Phi[m + 1], m = 0 .. k) + N[t]*(k + 1)*(k + 2)*Theta[k + 2]/N[b])/((k + 1)*(k + 2)):
end do:

f := add(F[i]*eta^i, i = 0 .. 3);
theta := add(Theta[i]*eta^i, i = 0 .. 3);
phi := add(Phi[i]*eta^i, i = 0 .. 3);

eta+(1/2)*A*eta^2+(.6500000000+(1/6)*M^2)*eta^3

 

1+B*eta+(.2286585366-.2743902439*B*C-.4573170732*Delta)*eta^2+(-.1067073171*B^2-0.7621951220e-1*B-.1829268293*(.2286585366-.2743902439*B*C-.4573170732*Delta)*C-.1829268293*B*(-.2667682926+.3201219512*B*C+.5335365855*Delta)-.1524390244*Delta*B+0.7621951220e-1*A)*eta^3

 

1+C*eta+(-.2667682926+.3201219512*B*C+.5335365855*Delta)*eta^2+(-0.6666666667e-1*C+.1244918700*B^2+0.8892276423e-1*B+.2134146342*(.2286585366-.2743902439*B*C-.4573170732*Delta)*C+.2134146342*B*(-.2667682926+.3201219512*B*C+.5335365855*Delta)+.1778455285*Delta*B-0.8892276423e-1*A)*eta^3

(1)

sol := RealDomain[solve]( { eval( diff(eval(f, [M = 1.1, Delta = 0.5]), eta), eta=3) = 1,
                            eval( theta, [M = 1.1, Delta = 0.5, eta=3]) = 0,
                            eval( phi, [M = 1.1, Delta = 0.5, eta=3]) = 0
                          }
                        )[3][];

A = -7.665000000, B = .5781083557, C = -3.491704928

(2)

d1 := diff( eval(f, [sol, M = 1.1, Delta = 0.5]), eta):
d2 := diff( eval(f, [sol, M = 1.6, Delta = 0.5]), eta):
d3 := diff( eval(f, [sol, M = 2.2, Delta = 0.5]), eta):
d4 := diff( eval(f, [sol, M = 2.6, Delta = 0.5]), eta):
plot([d1, d2, d3, d4], eta = 0 .. 7);

 

  s1 := eval(theta, [sol, Delta = 0.5] ):
  s2 := eval(theta, [sol, Delta = 1.0] ):
  s3 := eval(theta, [sol, Delta = 1.5] ):
  s4 := eval(theta, [sol, Delta = 2.0] ):
  plot([s1, s2, s3, s4], eta = 0 .. 7);

 

NULL

Download SSGuess.mw

learn the difference between square brackets and round brackets!! ie [] and ().

Square brackets, ie '[]',  are used to access elements of indexable quantities, such as tables, vectors, arrays, lists etc. They should never be used for simple grouping of terms in a mathematical expression.

Round brackets, ie '()' are used for grouping of terms in a mathematical expression, or applying a function to an argument.

So, for example, delta(v) and delta[v] mean two entirely different things to Maple

You appear to be using these two different kinds of parentheses more-or-less interchangeably - which you can't!

In the attached I have *guessed* your intentions with respect to the parentheses problem, and fixed too many other syntax errors to list. At least this worksheet executes, although it producesw "answers" in terms of Theta[-3],Theta[-2],and Theta[-1], none of whihc have been defined. This may (or may not?) be related to the use of the same summation index 'w' at two levels of a nested sum (highlighted inred in the attached), which *looks* very suspicious to me.

restart; _local(gamma, delta, Zeta)

Theta[0] := 1; Theta[1] := Gamma; delta[0] := 1; for w to 30 do delta[w] := 0 end do; delta[-1] := 0; beta := 2; N[cc] := 1; N[rc] := .5; Q[int] := .2; gamma := .3; M := .5; `&Theta;__a` := .2

for v from 0 to 3 do Theta[v+2] := solve((v+1)*(v+2)*Theta[v+2]+N[cc]*`&Theta;__a`*delta[v]+N[cc]*`&Theta;__a`*delta[v-1]+N[rc]*`&Theta;__a`^4*delta[v]+N[rc]*`&Theta;__a`^4*delta[v-1]+Q[int]*gamma*delta[v]-M*Theta[v]/(1-`&Theta;__a`)-Q[int]*gamma*`&Theta;__a`*delta[v]-Q[int]*gamma*delta[v-1]*`&Theta;__a`+M*`&Theta;__a`*delta[v]/(1-`&Theta;__a`)+M*`&Theta;__a`*delta[v-1]/(1-`&Theta;__a`)-M*add(delta[w-1]*Theta[v-w], w = 0 .. v)/(1-`&Theta;__a`)+Q[int]*gamma*add(delta[w-1]*Theta[v-w], w = 0 .. v)+Q[int]*delta[v-1]+beta*add(add(delta[Zeta-1]*(w-Zeta+1)*Theta[w-Zeta+1]*(v-w+1)*Theta[v-w+1], Zeta = 0 .. w), w = 0 .. v)-N[cc]*Theta[v]-N[cc]*add(delta[w-1]*Theta[v-w], w = 0 .. v)+beta*add(Theta[v-w]*(w+1)*(w+2)*Theta[w+2], w = 0 .. v)+beta*add(add(delta[Zeta-1]*Theta[w-Zeta]*(v-w+1)*(v-w+2)*Theta[v-w+2], Zeta = 0 .. w), w = 0 .. v)+beta*add(Theta[v-w]*(w+1)*Theta[w+1], w = 0 .. v)+(v+1)*Theta[v+1]+beta*add((v-w+1)*Theta[v-w+1]*(w+1)*Theta[w+1], w = 0 .. v)-N[rc]*add(add(add(Theta[w]*Theta[Zeta-w]*Theta[w-Zeta]*Theta[v-w], w = 0 .. Zeta), Zeta = 0 .. w), w = 0 .. v)-N[rc]*add(add(add(add(delta[l-1]*Theta[w-l]*Theta[Zeta-w]*Theta[w-Zeta]*Theta[v-w], l = 0 .. w), w = 0 .. Zeta), Zeta = 0 .. w), w = 0 .. v)+Q[int]*delta[v]+add(delta[w-1]*(v-w+1)*(v-w+2)*Theta[v-w+2], w = 0 .. v), Theta[v+2]) end do

.2585333333-.5000000000*Gamma-.3333333333*Gamma^2

 

.3345888889*Gamma-0.8617777778e-1+0.2777777778e-1*Gamma^2*Theta[-1]+.3333333333*Gamma^2+.2222222222*Gamma^3

 

-.2017870370*Gamma+0.9283261726e-3*Theta[-2]-0.2083333334e-1*Gamma^2*Theta[-1]-0.1388888889e-1*Gamma^3*Theta[-1]-0.3590740740e-2*Theta[-2]*Gamma+0.1078395062e-2*Theta[-2]*Gamma^2+0.4629629629e-2*Theta[-2]*Gamma^3+0.1543209876e-2*Theta[-2]*Gamma^4-.2547277778*Gamma^2-.1851851852*Gamma^4+0.6838637555e-1-.3333333333*Gamma^3+0.7181481481e-2*Gamma*Theta[-1]

 

.1484151115*Gamma-0.5569957035e-3*Theta[-2]+0.2816114230e-2*Theta[-2]*Gamma-0.8494753091e-3*Theta[-2]*Gamma^2-0.4676893004e-2*Theta[-2]*Gamma^3-0.4320987653e-2*Theta[-2]*Gamma^4-0.3590740740e-2*Gamma*Theta[-1]+0.1805555556e-1*Gamma^3*Theta[-1]+0.1549580248e-1*Gamma^2*Theta[-1]+.1730259259*Gamma^2+.3703703703*Gamma^4+.3183703705*Gamma^3-0.4824327753e-1+0.6944444445e-3*Gamma^3*Theta[-1]^2+0.1265432099e-1*Gamma^4*Theta[-1]-0.1337448559e-2*Theta[-2]*Gamma^5-0.4805687819e-3*Theta[-3]*Gamma+0.4541489394e-3*Theta[-3]*Gamma^2+0.2165144033e-2*Theta[-3]*Gamma^4+0.1539650206e-2*Theta[-3]*Gamma^3+0.4115226337e-3*Theta[-3]*Gamma^6+0.1234567901e-2*Theta[-3]*Gamma^5+.1728395062*Gamma^5+0.1196913580e-3*Theta[-2]*Gamma^2*Theta[-1]-0.2314814815e-3*Theta[-2]*Gamma^3*Theta[-1]-0.1543209877e-3*Theta[-2]*Gamma^4*Theta[-1]+0.1028806584e-3*Theta[-3]*Gamma^5*Theta[-1]+0.6430041153e-5*Theta[-3]*Gamma^4*Theta[-1]^2-0.3989711935e-4*Theta[-3]*Gamma^2*Theta[-1]+0.1549022634e-3*Theta[-3]*Gamma^3*Theta[-1]+0.1543209877e-3*Theta[-3]*Gamma^4*Theta[-1]+0.6188841153e-4*Theta[-3]

(1)

``

Download TSD.mw

 

in Maple 2022.

I used leftclick in Maple to select something for cop, followed by rightclick to bring up the context menu, then Copy As->Image on this menu. This allowed me to produce the attached MSWord document with a couple of images from the attached Maple document.

test.mw

test.docx

are shown in the attached - but the original code is so confusing, it is difficult for me to be sure whther or not the 'fixes' are correct.

At least the code now executes without error.

However, your final expression 'e5', contains the five unknowns {k[f], k[nf], m[0], m[1],m[2]} and you can't solve a single equation for five unknowns - so I was unable to make any further progress

part.mw

Some relevant excerpts from the helprom the help

.......exit from the innermost repetition (for/while/do) statement within which it occurs.

If break is followed by an integer N, then execution exits the Nth innermost repetition statement. The statement break 1 is equivalent to just break

It is an error if a break appears in a context other than within a repetition statement........or there are fewer than N enclosing repetition statements.

You only have one enclosing "repetition statement" (aka for-loop), so 'break 2' will always give an error.

It is not clear (to me at least) why you state that

If I don't include the integer, I am able to run the procedure, but it does not function like I would like it to

So exactly how would you like it to function?

 

the variable 'm0' occurs in the expressions you want to plot, but has nowhere been assigned.

I would have fixed this except that 'm0' is equated to (but not assigned to) various different quantities in your worksheet, and I have no idea which value(s) you actually want

First 8 9 10 11 12 13 14 Last Page 10 of 207