tomleslie

13876 Reputation

20 Badges

15 years, 172 days

MaplePrimes Activity


These are answers submitted by tomleslie

which I have fixed in the attached (I also removed some stuff which you didn't seem to be using)

  restart;
  d1 := 1; d2 := 1; AA := 0.2e-2; BB := 0.79e-1; L := 1;
  PDE1:= diff(u(x, t), t) = d1*(diff(u(x, t), x, x))-u(x, t)*v(x, t)^2+AA*(1-u(x, t));
  PDE2:= diff(v(x, t), t) = d1*(diff(v(x, t), x, x))+u(x, t)*v(x, t)^2-BB*v(x, t);

  IBC1:= u(0, t) = 1, u(1, t) = 1,
         u(x, 0) = 1-(1/2)*sin(Pi*(x-L)/(2*L))^100;
  IBC2:= v(0, t) = 0, v(1, t) = 0,
         v(x, 0) = (1/4)*sin(Pi*(x-L)/(2*L))^100;     

  pds:= pdsolve( [PDE1,PDE2], [IBC1,IBC2], numeric, time = t, range = 0 .. 1);

  p1:= pds:-plot(t = 0, numpoints = 50);

  p2:= pds:-plot(t = 1/8, numpoints = 50, color = blue);

  p3:= pds:-plot(t = 1/4, numpoints = 50, color = green);

1

 

1

 

0.2e-2

 

0.79e-1

 

1

 

diff(u(x, t), t) = diff(diff(u(x, t), x), x)-u(x, t)*v(x, t)^2+0.2e-2-0.2e-2*u(x, t)

 

diff(v(x, t), t) = diff(diff(v(x, t), x), x)+u(x, t)*v(x, t)^2-0.79e-1*v(x, t)

 

u(0, t) = 1, u(1, t) = 1, u(x, 0) = 1-(1/2)*sin((1/2)*Pi*(x-1))^100

 

v(0, t) = 0, v(1, t) = 0, v(x, 0) = (1/4)*sin((1/2)*Pi*(x-1))^100

 

_m708780480

 

 

 

 

 

Download pdeProb.mw

  1. Open the file 1.mw as a worksheet in whatever is your normal method for opening Maple worksheets
  2. Don't execute anything, don't do anything other than use the menu operation File->Export As dialogue. When presented with the "Export As" pop-up, choose any directory you want, and any filename you want, but ensure that the "Files of Type" field is set to Maple Input (.mpl)
  3. Having save the file 1.mw as a .mpl change the read statement in the 2.mw file to correspond with the filepath and filename chosen in (2) above
  4. I have performed this operation on your files. I chose to "Export" your file 1.mw to my Desktop withe the name 1.mpl, and hence I change the read statement in the file 2.mw to read C:/Users/TomLeslie/Desktop/1.mpl. Obviously yu will have to chnage this to correspond with thefilepath/filename whihc ou chose in (2) above
  5. The attached shows the file 2.mw running correctly after these adjustments

restart:                 
with(Optimization):      
with(MTM):               
interface(warnlevel=0):  

#read "1.mw";
read "C:/Users/TomLeslie/Desktop/1.mpl":

 

BO:=[2,1,4,3,8];
OW:=[4,8,4,2,1];

[2, 1, 4, 3, 8]

 

[4, 8, 4, 2, 1]

(1)

with(BWM):   # call BWM package
BWM(BO,OW);  # use BWM function to solve given problem

"the number of the criteria", 5

 

"the best criterion", C[2]

 

"the worst criterion", C[5]

 

"the value of the best-worst comparison", 8

 

"the Euclidean BWM results are as follows:"

 

        
 w1=.216334313277441        
 w2=.443058029942151        
 w3=.154326427504539        
 w4=.132526090111623        
 w5=.0537551391642455        
 xi=1.716258440        
 consistency index=11.61895004        
 the consistency ratio=xi/consistency index=.1477120079        
 Total Deviation=.300418064406966

 

"the linear Chebyshev BWM results are as follows:"

 

        
 w1=.246153845963213        
 w2=.43076923146822        
 w3=.123076922981606        
 w4=.153846153210709        
 w5=.0461538463762519        
 xi=.615384604582054e-1        
 max xi=.256880733528126        
 the actual consistency ratio=xi/max xi=.2395604358        
 Total Deviation=.92413885935391

 

 


 

Download run2.mw

it sounds as if there are a couple of things you need to change

  1. Maple input: From the menus, use Tools->Options->Display and toggle the "Input Display" field to Maple Notation. Then check "Apply Globally" at the bottom of this pop-up. Thius should give you old-fashioned, plaintext, Maple Input in the current and all subsequent Maple sessions
  2. Maple Input Font: From the menus, use Format->Input Styles. In the Style Management pop-up, scroll down the available styles to "Maple Input" - it is generally two or three from the bottom (may be version dependent?). Select (ie right-click) the "Maple Input" field, then click "Modify". At this point you will get a new pop-up headed "Character style" where you can select the font family, font size, etc etc. My default setting here is "Times New Roman", 14pt, bold, and the color is one of the "brownish" ones, which I find restful. Just play with the settings in this pop-up and go back to the main worksheet to examine the result - after a couple of adjustments you ought to be able to get the font-style you want

where solve() is used to generate all roots - and results are presented in both rational and floating-point forms.

It *ought* to work for any value of the parameter 'n' in the expression cos( n * arccos(x) )

  restart;
#
# procedure which finds the "roots" of the
# expression cos(n*arccos(x)), for any (integer)
# supplied value of 'n'
#
  getSol:= proc( n::integer )
                 local Z, expr, j, sol1, sol2, sol3, sol4;
                 expr:= cos(n*arccos(x));
                 sol1:= solve( expr,
                               allsolutions=true
                             ):
                 sol2:= subs( `minus`( indets(sol1, 'name'),
                                       {Pi}
                                     )[]
                              = Z,
                              sol1
                            );
                 sol3:= [ { seq
                            ( simplify
                              ( eval
                                ( sol2,
                                  Z = j
                                ),
                                trig
                              ),
                              j = -n .. n-1
                            )
                          }[]
                        ]:
                 sol4:= evalf(sol3);
                 return expr,
                        sol2,
                        sol3,
                        sol4;
           end proc:
#
# Return values for each of the following are
#
# 1. the expression being solved
# 2. the general (ie closed-form) solution
# 3. the distinct (rational) roots
# 4, the distinct (floating point) roots
#
  getSol( 2 );
  getSol( 3 );
  getSol( 4 );
  getSol( 5 );

cos(2*arccos(x)), cos((1/4)*Pi+(1/2)*Pi*Z), [-(1/2)*2^(1/2), (1/2)*2^(1/2)], [-.7071067810, .7071067810]

 

cos(3*arccos(x)), cos((1/6)*Pi+(1/3)*Pi*Z), [0, -(1/2)*3^(1/2), (1/2)*3^(1/2)], [0., -.8660254040, .8660254040]

 

cos(4*arccos(x)), cos((1/8)*Pi+(1/4)*Pi*Z), [-cos((1/8)*Pi), -cos((3/8)*Pi), cos((1/8)*Pi), cos((3/8)*Pi)], [-.9238795325, -.3826834325, .9238795325, .3826834325]

 

cos(5*arccos(x)), cos((1/10)*Pi+(1/5)*Pi*Z), [0, -cos((1/10)*Pi), -cos((3/10)*Pi), cos((1/10)*Pi), cos((3/10)*Pi)], [0., -.9510565163, -.5877852522, .9510565163, .5877852522]

(1)

 

``

``

``

``

``

``

``

``

``

``

``

Download egtRoots.mw

using the geometry() package with triangles, circumcircles, incircles, circumcentres inceentres etc.

See the attached

  restart;
  with(geometry):
  _EnvHorizontalName:=x:
  _EnvVerticalName:=y:
#
# Define a list of sidelengths
#
  sideLength:=[3,5,7]:
#  sideLength:=[3,4,5]:
   
#
# Define three points which will become the triangle
# For the moment one can specify
#
# 1. the first triangle vertex is at the origin
# 2. the second triangle vertex is along the +ve x-axis
# 3. the third triangle vertex is in the positive y-plane
#
  point(A, [0, 0]):
  point(B, [x__b, 0]):
  point(C, [x__c, y__c]):
#
# Specify the lengths of the sides of the triangles
# and assign appropriate values to the unknown
# coordinates used in the definition of the vertices
#
  sol:= assign
        ( solve
          ( [ x__b > 0,
              y__c > 0,
              distance(A,B)=sideLength[1],
              distance(A,C)=sideLength[2],
              distance(B,C)=sideLength[3]
            ]
          )
        ):
#
# Construct the triangle from these three points
#
  triangle(T1, [A, B, C]):

#
# Produce the circumcircle of the triangle, and
# draw both
#
  circumcircle(C1, T1):
  draw( [ T1(color=red),
          C1(color=blue)
        ],
        axes=normal
      );
#
# Translate the circumcircle to the origin.
# Apply the same translation to the triangle
#
  dsegment( ds1,
            point(P1, coordinates(center(C1))),
            point(OO, [0,0])
          ):
  translation(C2, C1, ds1):
  translation(T2, T1, ds1):
  draw( [ T2(color=red),
          C2(color=blue)
        ],
        axes=normal
      );
#
# Get the coordinates of translated triangle
#
  map(coordinates, DefinedAs(T2));

 

 

[[-3/2, -(13/6)*3^(1/2)], [3/2, -(13/6)*3^(1/2)], [-4, (1/3)*3^(1/2)]]

(1)

#
# Observe that rotations, reflections etc are also "solutions".
#
# Successively rotate the triangle by Pi/8, and draw the results
#
  draw( [ C2(color=blue),
          seq
          ( rotation( cat(TR, j),
                      T2,
                      j*Pi/4,
                      clockwise
                    ),
            j=0..7
          )
        ],
        axes=normal
      );
#
# Now with a few reflections
#
  draw( [ C2(color=blue),
          T2,
          reflection( TF1,
                      T2,
                      line(x_axis, y=0 )
                    ),
          reflection( TF2,
                      T2,
                      line(y_axis, x=0 )
                    ),
          reflection( TF3,
                      TF2,
                      line(x_axis, y=0 )
                    )
        ]
      );
#
# Get the coordinates of (some of) these triangles
#
  map(coordinates, DefinedAs(TR3));
  map(coordinates, DefinedAs(TR6));
  map(coordinates, DefinedAs(TF1));
  map(coordinates, DefinedAs(TF3));

 

 

[[(3/4)*2^(1/2)-(13/12)*3^(1/2)*2^(1/2), (3/4)*2^(1/2)+(13/12)*3^(1/2)*2^(1/2)], [-(3/4)*2^(1/2)-(13/12)*3^(1/2)*2^(1/2), -(3/4)*2^(1/2)+(13/12)*3^(1/2)*2^(1/2)], [2*2^(1/2)+(1/6)*3^(1/2)*2^(1/2), 2*2^(1/2)-(1/6)*3^(1/2)*2^(1/2)]]

 

[[(13/6)*3^(1/2), -3/2], [(13/6)*3^(1/2), 3/2], [-(1/3)*3^(1/2), -4]]

 

[[-3/2, (13/6)*3^(1/2)], [3/2, (13/6)*3^(1/2)], [-4, -(1/3)*3^(1/2)]]

 

[[3/2, (13/6)*3^(1/2)], [-3/2, (13/6)*3^(1/2)], [4, -(1/3)*3^(1/2)]]

(2)

#
# Produce the incircle of the triangle, Draw both
# of these. NB center of the incircle is the incenter
#
  incircle(C3, T1):
  draw([T1(color=red), C3(color=blue)], axes=normal);
#
# Translate the centre of the incircle to the
# origin. Apply the same translation to the triangle
#
  dsegment( ds2,
            point(P1, coordinates(center(C3))),
            point(OO, [0,0])
          ):
  translation(C4, C3, ds1):
  translation(T3, T1, ds1):
  draw( [ T3(color=red),
          C4(color=blue)
        ],
        axes=normal
      );
#
# Get the coordinates of translated triangle
#
  map(coordinates, DefinedAs(T3));

 

 

[[-1/2, -(1/2)*3^(1/2)], [5/2, -(1/2)*3^(1/2)], [-3, 2*3^(1/2)]]

(3)

#
# Observe that rotations, reflections etc are also "solutions".
#
# Successively rotate the triangle by Pi/8,, and draw the results
#
  draw( [ C4(color=blue),  seq( rotation( cat(TIR, j), T3, j*Pi/4, clockwise), j=0..7)], axes=normal);
#
# Now with a few reflections
#
  draw( [ C4(color=blue),
          T3,
          reflection( TF4,
                      T3,
                      line(x_axis, y=0 )
                    ),
          reflection( TF5,
                      T3,
                      line(y_axis, x=0 )
                    ),
          reflection( TF6,
                      TF5,
                      line(x_axis, y=0 )
                    )
        ]);
#
# Get the coordinates of (some of) these triangles
#
  map(coordinates, DefinedAs(TIR3));
  map(coordinates, DefinedAs(TIR6));
  map(coordinates, DefinedAs(TF4));
  map(coordinates, DefinedAs(TF6));

 

 

[[(1/4)*2^(1/2)-(1/4)*3^(1/2)*2^(1/2), (1/4)*2^(1/2)+(1/4)*3^(1/2)*2^(1/2)], [-(5/4)*2^(1/2)-(1/4)*3^(1/2)*2^(1/2), -(5/4)*2^(1/2)+(1/4)*3^(1/2)*2^(1/2)], [(3/2)*2^(1/2)+3^(1/2)*2^(1/2), (3/2)*2^(1/2)-3^(1/2)*2^(1/2)]]

 

[[(1/2)*3^(1/2), -1/2], [(1/2)*3^(1/2), 5/2], [-2*3^(1/2), -3]]

 

[[-1/2, (1/2)*3^(1/2)], [5/2, (1/2)*3^(1/2)], [-3, -2*3^(1/2)]]

 

[[1/2, (1/2)*3^(1/2)], [-5/2, (1/2)*3^(1/2)], [3, -2*3^(1/2)]]

(4)

 

Download triFun.mw

is in the attached

plots:-shadebetween( x*exp(x^3), 0, x=0..1, view=[-1..2, -1..3]);

 

 


 

Download shplot.mw

because I can't match versions exactly, and I am pretty much exclusively 64-bit for everything.

For what it is worth

64-bit Maple 2018 - ie Maple 2018.2, X86 64 WINDOWS, Nov 16 2018, Build ID 1362973`

seems to work perfectly with

64-bit Excel 2010 -ie Microsoft Office Professional 2010, Excel version 14.0.7232.5000 (64-bit)

on a system whose OS is 64-bit Windows 7

Can't say I've ever had a problem getting the Maple plug-in to work in Excel

for example

  1. changed all function usages to indexed names - eg S[k] rather than S(k)
  2. adjusted a few summation indexes so that these no longer generate indexes outside the known range (ie 0..m) - so entries such as B(-3) cannot occur

The likelihood that all of the changes I have made are correct is close to zero, but at least the attached will produce output in the form which you seem to want

restart; _local(gamma); m := 3; A := 10; delta := .112; rho := .23; beta := 1.4; alpha := 2.1; gamma := 1.02; q := 2.3; b1 := 50; b2 := 10; b3 := 5; b4 := 20; S[0] := b1; B[0] := b2; V[0] := b3; R[0] := b4; mu := .13; i = 1; for k from 0 to m do S[k+1] := (A*delta*k-(rho+mu)*S[k]-beta*add(S[k]*B[k-j], j = 0 .. k))/(k+1); B[k+1] := -(-(mu+alpha+gamma)*B[k]+beta*add(S[k]*B[k-j], j = 0 .. k))/(k+1); V[k+1] := (rho*S[k]-(1-q)*S[k]-mu*V[k])/(k+1); R[k+1] := (gamma*B[k]-mu*R[k])/(k+1) end do; SS := add(S[kk]*T[i]^kk, kk = 0 .. m); BB := add(B[kk]*T[i]^kk, kk = 0 .. m); VV := add(V[kk]*T[i]^kk, kk = 0 .. m); RR := add(R[kk]*T[i]^kk, kk = 0 .. m)

50-718.00*T[i]-330329.7000*T[i]^2-0.5121013280e11*T[i]^3

 

10-667.50*T[i]-331544.1875*T[i]^2-0.5121053160e11*T[i]^3

 

5+75.85*T[i]-554.2002500*T[i]^2-168444.1317*T[i]^3

 

20+7.60*T[i]-340.9190000*T[i]^2-112710.2506*T[i]^3

(1)

Download fixsums.mw

The ODE can be be easily solved using Maple's built-in numerical solvers - see the attached

Now exactly why would someone want to waste time/energy writing code implementing an alternative solution method???

  restart;
  ode:=diff(u(x),x,x)-6*x*diff(u(x),x)-u(x)=4*x*2;
  bcs:= u(0)-D(u)(0)=0, u(1)=1;
  dsol:=dsolve( [ode,bcs],numeric);
  plots:-odeplot( dsol, [x, u(x)], x=0..1);

diff(diff(u(x), x), x)-6*x*(diff(u(x), x))-u(x) = 8*x

 

u(0)-(D(u))(0) = 0, u(1) = 1

 

proc (x_bvp) local res, data, solnproc, _ndsol, outpoint, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve = true then outpoint := evalf[_EnvDSNumericSaveDigits](x_bvp) else outpoint := evalf(x_bvp) end if; data := Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(21, {(1) = .0, (2) = 0.22611940656440548e-1, (3) = 0.4805407345473399e-1, (4) = 0.7776409795361368e-1, (5) = .11508217610495065, (6) = .16997059131755177, (7) = .2527653822636034, (8) = .42891150025750885, (9) = .5822265087245702, (10) = .6615060491274275, (11) = .7172327358992242, (12) = .7608905838097413, (13) = .7969555178040467, (14) = .8283913443845058, (15) = .8566238732795116, (16) = .8829278180969745, (17) = .9081153343460625, (18) = .9323177112642327, (19) = .9556422261605508, (20) = .9781779937171905, (21) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(21, 2, {(1, 1) = -.44136509939618285, (1, 2) = -.44136509939618285, (2, 1) = -.45144865171483417, (2, 2) = -.4500999124791927, (3, 1) = -.4629943512956403, (3, 2) = -.45699055016754636, (4, 1) = -.4766436842015003, (4, 2) = -.46115017303886335, (5, 1) = -.49386024106382953, (5, 2) = -.4604322658608156, (6, 1) = -.5188327016630293, (6, 2) = -.4469789874720329, (7, 1) = -.5539983237464886, (7, 2) = -.3958417272200659, (8, 1) = -.6031885641460658, (8, 2) = -.11446426749213001, (9, 1) = -.580782318866427, (9, 2) = .48867350896308764, (10, 1) = -.5208949277033289, (10, 2) = 1.0643674935550353, (11, 1) = -.4459985795056812, (11, 2) = 1.6553074703288768, (12, 1) = -.3608101546619819, (12, 2) = 2.274070215826017, (13, 1) = -.2675094931667966, (13, 2) = 2.923870586901339, (14, 1) = -.16498763232629896, (14, 2) = 3.621636980042386, (15, 1) = -0.52379033602993355e-1, (15, 2) = 4.3783503099463275, (16, 1) = 0.7352884856020045e-1, (16, 2) = 5.218968777748516, (17, 1) = .21665406001451656, (17, 2) = 6.17235316092669, (18, 1) = .3787612270903519, (18, 2) = 7.2530355991663, (19, 1) = .5618318121872969, (19, 2) = 8.47731521697116, (20, 1) = .7680848355200656, (20, 2) = 9.863483048347625, (21, 1) = 1.0, (21, 2) = 11.432065399317704}, datatype = float[8], order = C_order); YP := Matrix(21, 2, {(1, 1) = -.44136509939618285, (1, 2) = -.44136509939618285, (2, 1) = -.4500999124791927, (2, 2) = -.3316189215260013, (3, 1) = -.45699055016754636, (3, 2) = -.2103233084529918, (4, 1) = -.46115017303886335, (4, 2) = -0.6969646393771123e-1, (5, 1) = -.4604322658608156, (5, 2) = .10887188515060076, (6, 1) = -.4469789874720329, (6, 2) = .38509233203453286, (7, 1) = -.3958417272200659, (7, 2) = .8677942213823487, (8, 1) = -.11446426749213001, (8, 2) = 2.5335331937384473, (9, 1) = .48867350896308764, (9, 2) = 5.784141777108715, (10, 1) = 1.0643674935550353, (10, 2) = 8.995666678203614, (11, 1) = 1.6553074703288768, (11, 2) = 12.415307541878537, (12, 1) = 2.274070215826017, (12, 2) = 16.10822620068116, (13, 1) = 2.923870586901339, (13, 2) = 20.08930343472145, (14, 1) = 3.621636980042386, (14, 2) = 24.46293948336947, (15, 1) = 4.3783503099463275, (15, 2) = 29.30420835911774, (16, 1) = 5.218968777748516, (16, 2) = 34.78478768725839, (17, 1) = 6.17235316092669, (17, 2) = 41.11282806140452, (18, 1) = 7.2530355991663, (18, 2) = 48.410104214400576, (19, 1) = 8.47731521697116, (19, 2) = 56.8146519363379, (20, 1) = 9.863483048347625, (20, 2) = 66.48296114103478, (21, 1) = 11.432065399317704, (21, 2) = 77.59239239590622}, datatype = float[8], order = C_order); errproc := proc (x_bvp) local outpoint, X, Y, yout, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := 15; outpoint := evalf(x_bvp); X := Vector(21, {(1) = .0, (2) = 0.22611940656440548e-1, (3) = 0.4805407345473399e-1, (4) = 0.7776409795361368e-1, (5) = .11508217610495065, (6) = .16997059131755177, (7) = .2527653822636034, (8) = .42891150025750885, (9) = .5822265087245702, (10) = .6615060491274275, (11) = .7172327358992242, (12) = .7608905838097413, (13) = .7969555178040467, (14) = .8283913443845058, (15) = .8566238732795116, (16) = .8829278180969745, (17) = .9081153343460625, (18) = .9323177112642327, (19) = .9556422261605508, (20) = .9781779937171905, (21) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(21, 2, {(1, 1) = -0.605755746506533e-9, (1, 2) = -0.605755746506533e-9, (2, 1) = -0.6199220926397197e-9, (2, 2) = -0.6211599176575269e-9, (3, 1) = -0.6364324519255712e-9, (3, 2) = -0.6416183987489878e-9, (4, 1) = -0.656692510361217e-9, (4, 2) = -0.670308428404859e-9, (5, 1) = -0.6842887701860796e-9, (5, 2) = -0.715702589436757e-9, (6, 1) = -0.7334042258559102e-9, (6, 2) = -0.8151558577617144e-9, (7, 1) = -0.8570929832541501e-9, (7, 2) = -0.11404970938008149e-8, (8, 1) = -0.27370351744364286e-8, (8, 2) = -0.971693986218173e-8, (9, 1) = 0.5186752763818131e-9, (9, 2) = -0.9502954262172018e-9, (10, 1) = 0.521551238161855e-9, (10, 2) = -0.8749575730000488e-9, (11, 1) = 0.4851701075419204e-9, (11, 2) = -0.9839614347001308e-9, (12, 1) = 0.4461253967043535e-9, (12, 2) = -0.11280344593824773e-8, (13, 1) = 0.40689775277594097e-9, (13, 2) = -0.1289697422575853e-8, (14, 1) = 0.366959634945654e-9, (14, 2) = -0.14670853923798454e-8, (15, 1) = 0.325720362079104e-9, (15, 2) = -0.16611717588683695e-8, (16, 1) = 0.282034875527357e-9, (16, 2) = -0.18766548755045194e-8, (17, 1) = 0.2347412975623076e-9, (17, 2) = -0.2119472189543271e-8, (18, 1) = 0.1833917621628057e-9, (18, 2) = -0.2392829497253154e-8, (19, 1) = 0.12750636436742593e-9, (19, 2) = -0.27002645040838297e-8, (20, 1) = 0.665635608360489e-10, (20, 2) = -0.30457514373551975e-8, (21, 1) = .0, (21, 2) = -0.34337156514647978e-8}, datatype = float[8], order = C_order); if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "right" then return X[21] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(9.71693986218173e-9) elif outpoint = "errorproc" then error "this is already the error procedure" elif outpoint = "rawdata" then return [2, 21, [u(x), diff(u(x), x)], X, Y] else return ('procname')(x_bvp) end if end if; if outpoint < X[1] or X[21] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[21] end if; V := array([1 = 4, 2 = 0]); if Digits <= trunc(evalhf(Digits)) then L := Vector(4, 'datatype' = 'float'[8]); yout := Vector(2, 'datatype' = 'float'[8]); evalhf(`dsolve/numeric/lagrange`(21, 2, X, Y, outpoint, var(yout), var(L), var(V))) else L := Vector(4, 'datatype' = 'sfloat'); yout := Vector(2, 'datatype' = 'sfloat'); `dsolve/numeric/lagrange`(21, 2, X, Y, outpoint, yout, L, V) end if; [x = outpoint, seq('[u(x), diff(u(x), x)]'[i] = yout[i], i = 1 .. 2)] end proc; if not type(outpoint, 'numeric') then if outpoint = "start" or outpoint = "left" then return X[1] elif outpoint = "method" then return "bvp" elif outpoint = "right" then return X[21] elif outpoint = "order" then return 8 elif outpoint = "error" then return HFloat(9.71693986218173e-9) elif outpoint = "errorproc" then return eval(errproc) elif outpoint = "rawdata" then return [2, 21, "depnames", X, Y, YP] else error "non-numeric value" end if end if; if outpoint < X[1] or X[21] < outpoint then error "solution is only defined in the range %1..%2", X[1], X[21] end if; if Digits <= trunc(evalhf(Digits)) and (_EnvInFsolve <> true or _EnvDSNumericSaveDigits <= trunc(evalhf(Digits))) then V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = .0, (1, 2) = .0, (2, 1) = .0, (2, 2) = .0, (3, 1) = .0, (3, 2) = .0, (4, 1) = .0, (4, 2) = .0, (5, 1) = .0, (5, 2) = .0, (6, 1) = .0, (6, 2) = .0, (7, 1) = .0, (7, 2) = .0}, datatype = float[8], order = C_order); yout := Vector(2, {(1) = .0, (2) = .0}, datatype = float[8]); evalhf(`dsolve/numeric/hermite`(21, 2, X, Y, YP, outpoint, var(yout), var(L), var(V))) else if _EnvInFsolve = true then Digits := _EnvDSNumericSaveDigits end if; V := array( 1 .. 6, [( 1 ) = (7), ( 2 ) = (0), ( 3 ) = (false), ( 4 ) = (false), ( 5 ) = (false), ( 6 ) = (false)  ] ); L := Matrix(7, 2, {(1, 1) = 0., (1, 2) = 0., (2, 1) = 0., (2, 2) = 0., (3, 1) = 0., (3, 2) = 0., (4, 1) = 0., (4, 2) = 0., (5, 1) = 0., (5, 2) = 0., (6, 1) = 0., (6, 2) = 0., (7, 1) = 0., (7, 2) = 0.}, order = C_order); yout := Vector(2, {(1) = 0., (2) = 0.}); `dsolve/numeric/hermite`(21, 2, X, Y, YP, outpoint, yout, L, V) end if; [outpoint, seq(yout[i], i = 1 .. 2)] end proc, (2) = Array(0..0, {}), (3) = [x, u(x), diff(u(x), x)], (4) = 0}); solnproc := data[1]; if not type(outpoint, 'numeric') then if outpoint = "solnprocedure" then return eval(solnproc) elif member(outpoint, ["start", "left", "right", "errorproc", "rawdata", "order", "error"]) then return solnproc(x_bvp) elif outpoint = "sysvars" then return data[3] elif procname <> unknown then return ('procname')(x_bvp) else _ndsol := pointto(data[2][0]); return ('_ndsol')(x_bvp) end if end if; try res := solnproc(outpoint); [x = res[1], seq('[u(x), diff(u(x), x)]'[i] = res[i+1], i = 1 .. 2)] catch: error  end try end proc

 

 

 

Download simpleODE.mw

 

In general the second argument to the indets() command has to be a Maple type - for a list of Maple types, see the help at ?type.

If (for some reason) you are trying to extract the operands of your expression, then you could use either of the methods shown in the attached


 

#
# The hard(?) way
#
  s1 := sqrt(2);
  s2 := log[2](3);
  s3 := surd(2, 3);
  map(op, indets(s1, op(0, s1)));
  map(op, indets(s2, op(0,s2)));
  map(op, indets(s3, op(0, s3)));
 

2^(1/2)

 

{2, 1/2}

 

ln(3)/ln(2)

 

{1/ln(2), ln(3)}

 

2^(1/3)

 

{2, 1/3}

(1)

#
# The easy(?) way
#
  op([0..-1], s1);
  op([0..-1], s2);
  op([0..-1], s3);

`^`, 2, 1/2

 

`*`, ln(3), 1/ln(2)

 

`^`, 2, 1/3

(2)

 


 

Download opStuff.mw

can be done with the attached.

Note that the numerator of your expression is real for any value of 'x'. However the denominator is complex for x<-4 or x>4.
Outside the range x=0..4, there are an infinite number of "solutions" of theform  0/a_complex_Number, which is obviously 0. However whether you consider this to be a "real" solution would seem to be a "philosophical" question

  restart;
  expr:=(-2*cos(x)^2+2*sin(x+(1/4)*Pi)^2-1)/sqrt(-x^2+4*x) = 0;
#
# "Basic" solution
#
  solve(expr, x);
#
# Now get "all" the solutions
#
  sols:=[solve(expr, x, allsolutions=true)];
#
# Produce "explicit" forms of the solutions
# over a limited range of integers - ie -10..10
# (which can be extended if necessary)
#
  ans:=`union`(seq( {seq( eval(sols[k],indets(sols[k], assignable)[]=j), j=-10..10)}, k=1..4));
#
# Check these solutions
#
  seq( eval(expr, x=j), j in ans);

(-2*cos(x)^2+2*sin(x+(1/4)*Pi)^2-1)/(-x^2+4*x)^(1/2) = 0

 

(1/2)*Pi, -(1/2)*Pi, (1/4)*Pi, -(3/4)*Pi

 

[(1/2)*Pi+2*Pi*_Z1, -(1/2)*Pi+2*Pi*_Z2, (1/4)*Pi+2*Pi*_Z3, -(3/4)*Pi+2*Pi*_Z3]

 

{-(83/4)*Pi, -(79/4)*Pi, -(75/4)*Pi, -(71/4)*Pi, -(67/4)*Pi, -(63/4)*Pi, -(59/4)*Pi, -(55/4)*Pi, -(51/4)*Pi, -(47/4)*Pi, -(43/4)*Pi, -(41/2)*Pi, -(39/2)*Pi, -(39/4)*Pi, -(37/2)*Pi, -(35/2)*Pi, -(35/4)*Pi, -(33/2)*Pi, -(31/2)*Pi, -(31/4)*Pi, -(29/2)*Pi, -(27/2)*Pi, -(27/4)*Pi, -(25/2)*Pi, -(23/2)*Pi, -(23/4)*Pi, -(21/2)*Pi, -(19/2)*Pi, -(19/4)*Pi, -(17/2)*Pi, -(15/2)*Pi, -(15/4)*Pi, -(13/2)*Pi, -(11/2)*Pi, -(11/4)*Pi, -(9/2)*Pi, -(7/2)*Pi, -(7/4)*Pi, -(5/2)*Pi, -(3/2)*Pi, -(3/4)*Pi, -(1/2)*Pi, (1/2)*Pi, (1/4)*Pi, (3/2)*Pi, (5/2)*Pi, (5/4)*Pi, (7/2)*Pi, (9/2)*Pi, (9/4)*Pi, (11/2)*Pi, (13/2)*Pi, (13/4)*Pi, (15/2)*Pi, (17/2)*Pi, (17/4)*Pi, (19/2)*Pi, (21/2)*Pi, (21/4)*Pi, (23/2)*Pi, (25/2)*Pi, (25/4)*Pi, (27/2)*Pi, (29/2)*Pi, (29/4)*Pi, (31/2)*Pi, (33/2)*Pi, (33/4)*Pi, (35/2)*Pi, (37/2)*Pi, (37/4)*Pi, (39/2)*Pi, (41/2)*Pi, (41/4)*Pi, (45/4)*Pi, (49/4)*Pi, (53/4)*Pi, (57/4)*Pi, (61/4)*Pi, (65/4)*Pi, (69/4)*Pi, (73/4)*Pi, (77/4)*Pi, (81/4)*Pi}

 

0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0, 0 = 0

(1)

 


 

Download manySols3.mw

for a given ODE system with fixed boundary conditions, it is "difficult" to imagine why a numerical solving process would give two different solutions - possible I suppose, but just very (very!) unlikely.

Thus you are going to have to demonstrate exactly how the same ODEs with the same initial/boundary conditions produces two different solutions. Upload the Matlab file which shows this phenomenon, if necessary

Meanwhile the attached worksheet shows the (unique) Maple solutions after I "strip out" all the random, unnecessary cr*p in your original worksheet

  restart:
  with(plots):

  bet:= 3.1: lam:= 0.01: pr:= 0.1: af:= 0.1:
   sf:= 0.1:  sc:= 0.1:   N:= 8:
  eq1:= diff(f(eta), eta$3)*(1+1/bet)+diff(f(eta), eta$2)*f(eta)-diff(f(eta), eta)^2+1+lam*t(eta) = 0:
  eq2:= diff(t(eta), eta$2)/pr+diff(t(eta), eta)*f(eta)-diff(f(eta), eta)*t(eta)+af*diff(c(eta), eta$2) = 0:
  eq3:= diff(t(eta), eta$2)/sc+diff(c(eta), eta)*f(eta)-diff(f(eta), eta)*c(eta)+sf*diff(t(eta), eta$2) = 0:
  bc:= f(0) = 0, D(f)(0) = ca, D(f)(N) = 1, t(0) = 1,
       t(N) = 0,    c(0) = 1,     c(N) = 0:

  caVals:= [-1.25, -1.24, -1.23]:
  colors:= [red, blue, green]:
  display
  ( [ seq
      ( odeplot
        ( dsolve
          ( eval
            ( [bc, eq1, eq2, eq3],
              ca = caVals[k]
            ),
            numeric,
            method = bvp[midrich]
          ),
          [eta, D(f)(eta)],
          color = colors[k]
        ),
        k = 1 .. numelems(caVals)
      )
    ]
  );

 

 

Download odeProb.mw

shown in the attached


 

  expr:=sin(9*x-(1/3)*Pi) = sin(7*x-(1/3)*Pi);
  ans:=simplify~([solve(expr,x)], symbolic);
#
# Sort in ascending order
#
  ans[sort(evalf~(%),output=permutation)];

-cos(9*x+(1/6)*Pi) = -cos(7*x+(1/6)*Pi)

 

[0, Pi, -(1/48)*Pi, (47/48)*Pi, (23/48)*Pi, -(25/48)*Pi, (11/48)*Pi, -(37/48)*Pi, -(13/48)*Pi, (35/48)*Pi, (5/48)*Pi, -(43/48)*Pi, -(19/48)*Pi, (29/48)*Pi, -(7/48)*Pi, (41/48)*Pi, (17/48)*Pi, -(31/48)*Pi]

 

[-(43/48)*Pi, -(37/48)*Pi, -(31/48)*Pi, -(25/48)*Pi, -(19/48)*Pi, -(13/48)*Pi, -(7/48)*Pi, -(1/48)*Pi, 0, (5/48)*Pi, (11/48)*Pi, (17/48)*Pi, (23/48)*Pi, (29/48)*Pi, (35/48)*Pi, (41/48)*Pi, (47/48)*Pi, Pi]

(1)

#
# A check
#
  [seq( `if`(eval(lhs(expr)-rhs(expr), x=-Pi/48+K*Pi/48)=0,-Pi/48+K*Pi/48,NULL), K=-46..49)];

[-(43/48)*Pi, -(37/48)*Pi, -(31/48)*Pi, -(25/48)*Pi, -(19/48)*Pi, -(13/48)*Pi, -(7/48)*Pi, -(1/48)*Pi, 0, (5/48)*Pi, (11/48)*Pi, (17/48)*Pi, (23/48)*Pi, (29/48)*Pi, (35/48)*Pi, (41/48)*Pi, (47/48)*Pi, Pi]

(2)

 


 

Download solveTrig.mw

 

some variant of the attached

restart;
expr1:=sin(x)*(x*y)^(1/3);
expr2:=sin(x)+(x*y)^(1/6);
getMatch:=expr-> `if`
                 ( ormap
                   ( patmatch,
                     [op(expr)],
                     `^`(a::name*b::name,c::nonunit(radnum)),
                     'la'
                   ),
                   printf("Pattern Match with c=%a\n", eval(c, la)),
                   printf("No Match\n")
                 ):
getMatch(expr1);
getMatch(expr2);

sin(x)*(x*y)^(1/3)

 

sin(x)+(x*y)^(1/6)

 

Pattern Match with c=1/3
Pattern Match with c=1/6

 

 

Download matchPat.mw

can be performed elementwise, as in the attached


 

#
# "Toy" example
#
  B:=Matrix( [ [ 1,   t,   t^2],
               [ 2, 2*t, 2*t^2],
               [ 3, 3*t, 3*t^2]
             ]
         );
#
# Elementwise (indefinite) integration
#
  int~(B, t);
#
# Elementwise (definite) integration
#
  int~(B, t=0..1);

Matrix(3, 3, {(1, 1) = 1, (1, 2) = t, (1, 3) = t^2, (2, 1) = 2, (2, 2) = 2*t, (2, 3) = 2*t^2, (3, 1) = 3, (3, 2) = 3*t, (3, 3) = 3*t^2})

 

Matrix(3, 3, {(1, 1) = t, (1, 2) = (1/2)*t^2, (1, 3) = (1/3)*t^3, (2, 1) = 2*t, (2, 2) = t^2, (2, 3) = (2/3)*t^3, (3, 1) = 3*t, (3, 2) = (3/2)*t^2, (3, 3) = t^3})

 

Matrix(%id = 18446744074573600158)

(1)

 

 

 


 

Download matInt.mw

First 97 98 99 100 101 102 103 Last Page 99 of 207