tomleslie

5353 Reputation

17 Badges

9 years, 301 days

MaplePrimes Activity


These are replies submitted by tomleslie

Your PDE is fourth-order in the variable 'x', and therefore needs 4 'x-related' boundary conditions - you have five

Your PDE is second-order in the variable 't', and therefore needs 2 't-related' initial conditions - you have one

The right hand side of this PDE (the piecewise function) looks a bit weird - it has a value at x=L, and absoutely nowhere else. This is probably going to result in a serious discontinuity an any solution (and may make the solution impossible to generate). Is this piecewise definition correct???

@Carl Love 

I have been reading this thread with increasing bewilderment. This confusion exists on two levels

  1. The worksheet  RLC.mw you posted does not generate the displayed answers! When I re-execute it (see attached below) the values of 'Sol' and related plot are different: note the arguments of the sin() and cos() terms should be 3*t, not 7*t. How is this possible? It is relatively easy to demonstrate that this coefficient (aka the the damped frequency) ought to be 3, although this demonstration is further confused by item 2 below
  2. As written, the ODE 'RLC' is incredibly confusing. You are using the symbol 'R' to denote inductance and the symbol 'L' to denote resistance, which is perverse to say the least. However it is the only way that applying Kirchoff's current law to to a series circuit of this type would make any sense. Of course one can use any names one wants, but OP's original post has R = 20 , C = 0.01 , L = 10, whereas  has   R=10, L=20, C= 1/100 so names have been swapped in the equation RLC and values have been swapped back in the params list. Hence the actual effect is nil (other than to confuse old people like me)
  3. In the second attachment below, I have defined the series RLC circuit in the conventional way, and swapped the parameter values around in order to achieve some kind of consistency. This means that both of these worksheets will now generate the same answers (but neither will generate the damped frequency value referred to in (1) above!)

restart:

RLC:= R*diff(x(t),t$2) + L*diff(x(t),t) + x(t)/C = 0;

R*(diff(diff(x(t), t), t))+L*(diff(x(t), t))+x(t)/C = 0

(1)

IC:= x(0)=10, D(x)(0)=0;

x(0) = 10, (D(x))(0) = 0

(2)

params:= [R=10, L=20, C= 1/100]:

Sol:= dsolve(eval({RLC, IC}, params));

x(t) = (10/3)*exp(-t)*sin(3*t)+10*exp(-t)*cos(3*t)

(3)

plot(eval(x(t), Sol), t= 0..5);

 

#Original square wave function:
step:= t-> piecewise(t < 0, 0, 1):
f:= t-> sum((-1)^n*step(t-n), n= 0..50):

#
#It's equivalent to this simpler function:
f:= t-> piecewise(floor(t)::even, 1, 0):

plot(f, 0..5, axes= frame, title= "Square Wave",thickness= 4, gridlines= false);

 

RLC2:= lhs(RLC) = 200*f(t/3);

RLC2 := R*(diff(x(t), t, t))+L*(diff(x(t), t))+x(t)/C = 200*piecewise((floor((1/3)*t))::even, 1, 0)

(4)

Sol2:= dsolve(eval({RLC2, IC}, params), numeric):

plots:-odeplot(Sol2, [[x(t), diff(x(t),t)]], t= 0..25, numpoints= 1000, thickness= 2, title= "Phase portrait", gridlines= false);

 

plots:-odeplot(Sol2, [t, x(t)], t= 0..25, numpoints= 1000, thickness= 2, title= "Solution curve", gridlines= false);

 

 

Download carlsCode.mw

restart:

#
# swapped round R and L
#
RLC:= L*diff(x(t),t$2) + R*diff(x(t),t) + x(t)/C = 0;

L*(diff(diff(x(t), t), t))+R*(diff(x(t), t))+x(t)/C = 0

(1)

IC:= x(0)=10, D(x)(0)=0;

x(0) = 10, (D(x))(0) = 0

(2)

#
# swapped rond values for R and L
#
params:= [R=20, L=10, C= 1/100]:

Sol:= dsolve(eval({RLC, IC}, params));

x(t) = (10/3)*exp(-t)*sin(3*t)+10*exp(-t)*cos(3*t)

(3)

plot(eval(x(t), Sol), t= 0..5);

 

#Original square wave function:
step:= t-> piecewise(t < 0, 0, 1):
f:= t-> sum((-1)^n*step(t-n), n= 0..50):

#
#It's equivalent to this simpler function:
f:= t-> piecewise(floor(t)::even, 1, 0):

plot(f, 0..5, axes= frame, title= "Square Wave",thickness= 4, gridlines= false);

 

RLC2:= lhs(RLC) = 200*f(t/3);

RLC2 := L*(diff(x(t), t, t))+R*(diff(x(t), t))+x(t)/C = 200*piecewise((floor((1/3)*t))::even, 1, 0)

(4)

Sol2:= dsolve(eval({RLC2, IC}, params), numeric):

plots:-odeplot(Sol2, [[x(t), diff(x(t),t)]], t= 0..25, numpoints= 1000, thickness= 2, title= "Phase portrait", gridlines= false);

 

plots:-odeplot(Sol2, [t, x(t)], t= 0..25, numpoints= 1000, thickness= 2, title= "Solution curve", gridlines= false);

 

 


 

Download convRLC.mw

@nm 

because we "froze" two different things. In your code

r    := (x^2-1)/x^2:
Z    := freeze(r):

whereas in mine

Z:=freeze( (x^2-1) ):

 

 

 

@nm 

one of the following more "suitable".

A "trick" I have observed with algsubs() is to (sometimes) do the substitution in a couple of stages


 

  restart;
  expr1:=(x^2-1)*y/x^2+(x^2-1)/x^2;

(x^2-1)*y/x^2+(x^2-1)/x^2

(1)

#
# The 'easy' way
#
  thaw(algsubs((y+1)=freeze((y+1)), expr1));

(y+1)*(x^2-1)/x^2

(2)

#
# Slightly harder - using algsubs and freeze/thaw
#
  Z:=freeze( (x^2-1) ):
  simplify
  ( collect
    ( algsubs
      ( x^2-1=Z,
        expr1
      ),
      Z
    )
  ):
  thaw(%);

(y+1)*(x^2-1)/x^2

(3)

#
# Even harder - using algsubs witout freeze/thaw
#
  subs
  ( Z1=(x^2-1),
    subs
    ( Z2=Z1/x^2,
      collect
      ( algsubs
        ( Z1/x^2=Z2,
          algsubs
          ( (x^2-1)=Z1,
            expr1
          )
        ),
        Z2
      )
    )
  );

(y+1)*(x^2-1)/x^2

(4)

 

 


 

Download frth3.mw

@minhthien2016 

to my previous worksheet to return the radius of the circumcircle and the incircle

triFun2.mw

odetest() only makes very careful simplifications when checking the validity of solutions.

It is sometimes(?) informative to perform the equivalent of odetest() manually - just substitute the solution into the ode, and make your own "simplifications", although I would advise doing this very carefully

For your specific example, the first command in the following evaluates to 'true', while the second evaluates to 'false' - the 'symbolic' option in the simplify() command makes all the difference

evalb(simplify(subs( my_sol, ode), symbolic));
evalb(simplify(subs( my_sol, ode)));

 

@nm
using patmatch! Whilst it is relatively simple to modify my previous response to accommodate your latest counterexample (see the attached), I doubt that this approach could be extended to cover absolutely arbitrary initial  expressions

restart;
expr1:=sin(x)*(x*y)^(1/3);
expr2:=sin(x)+(x*y)^(1/6);
expr3:=sin(x)*(x*y)^(1/3)+3;
f:=ex->`if`(type(ex,`+`),g~([op( ex)]), [op(ex)]);
g:=ex->`if`(type(ex,`*`), op(ex), ex);
getMatch:=expr-> `if`
                 ( ormap
                   ( patmatch,
                     f(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);
getMatch(expr3);

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

 

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

 

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

 

proc (ex) options operator, arrow; `if`(type(ex, `+`), `~`[g]([op(ex)]), [op(ex)]) end proc

 

proc (ex) options operator, arrow; `if`(type(ex, `*`), op(ex), ex) end proc

 

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

 

 


 

Download matchPat2.mw

@Carl Love

In addition to the corrections alreadt noted

  1. There are various places on the right hand sides of the OP's expressions where "extra" spaces are probably being interpreted as "implicit multiplications"
  2. Using the same name for the summation index and the loop index is definitely not advisable
  3. In the attached, I have made several corrections based on "guessing" your intent, and this worksheet executes without error. However there is no guarantee that my "guesses are correct, so I suggest you examine the attached very carefully

restart; _local(gamma); m := 10; A := 10; delta := .112; rho := .23; mu := .31; 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; N := 3; for k from 0 to N do S(k+1) := (A*delta*k-(rho+µ)*S(k)-beta*(sum(S(m)*B(j-m), j = 0 .. m)))/(k+1); B(k+1) := -(-(µ+alpha+gamma)*B(k)+beta*(sum(S(m)*B(j-m), j = 0 .. m)))/(k+1); V(k+1) := (rho*S(k)-(1-q)*S(k)-µ*V(k))/(k+1); R(k+1) := (gamma*B(k)-µ*R(k))/(k+1) end do

gamma

 

10

 

10

 

.112

 

.23

 

.31

 

1.4

 

2.1

 

1.02

 

2.3

 

50

 

10

 

5

 

20

 

50

 

10

 

5

 

20

 

3

 

-11.50-50*µ-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10)

 

10*µ+31.20-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10)

 

76.50-5*µ

 

10.20-20*µ

 

.5600000000-(1/2)*(.23+µ)*(-11.50-50*µ-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.7000000000*S(10)*B(-10)-.7000000000*S(10)*B(-9)-.7000000000*S(10)*B(-8)-.7000000000*S(10)*B(-7)-.7000000000*S(10)*B(-6)-.7000000000*S(10)*B(-5)-.7000000000*S(10)*B(-4)-.7000000000*S(10)*B(-3)-.7000000000*S(10)*B(-2)-.7000000000*S(10)*B(-1)-7.000000000*S(10)

 

(1/2)*(µ+3.12)*(10*µ+31.20-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.7000000000*S(10)*B(-10)-.7000000000*S(10)*B(-9)-.7000000000*S(10)*B(-8)-.7000000000*S(10)*B(-7)-.7000000000*S(10)*B(-6)-.7000000000*S(10)*B(-5)-.7000000000*S(10)*B(-4)-.7000000000*S(10)*B(-3)-.7000000000*S(10)*B(-2)-.7000000000*S(10)*B(-1)-7.000000000*S(10)

 

-(1/2)*µ*(76.50-5*µ)-8.797500000-38.25000000*µ-10.71000000*S(10)-1.071000000*S(10)*B(-9)-1.071000000*S(10)*B(-8)-1.071000000*S(10)*B(-7)-1.071000000*S(10)*B(-6)-1.071000000*S(10)*B(-5)-1.071000000*S(10)*B(-4)-1.071000000*S(10)*B(-3)-1.071000000*S(10)*B(-2)-1.071000000*S(10)*B(-1)-1.071000000*S(10)*B(-10)

 

5.100000000*µ+15.91200000-.7140000000*S(10)*B(-10)-.7140000000*S(10)*B(-9)-.7140000000*S(10)*B(-8)-.7140000000*S(10)*B(-7)-.7140000000*S(10)*B(-6)-.7140000000*S(10)*B(-5)-.7140000000*S(10)*B(-4)-.7140000000*S(10)*B(-3)-.7140000000*S(10)*B(-2)-.7140000000*S(10)*B(-1)-7.140000000*S(10)-(1/2)*µ*(10.20-20*µ)

 

.7466666667-(1/3)*(.23+µ)*(.5600000000-(1/2)*(.23+µ)*(-11.50-50*µ-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.7000000000*S(10)*B(-10)-.7000000000*S(10)*B(-9)-.7000000000*S(10)*B(-8)-.7000000000*S(10)*B(-7)-.7000000000*S(10)*B(-6)-.7000000000*S(10)*B(-5)-.7000000000*S(10)*B(-4)-.7000000000*S(10)*B(-3)-.7000000000*S(10)*B(-2)-.7000000000*S(10)*B(-1)-7.000000000*S(10))-.4666666667*S(10)*B(-10)-.4666666667*S(10)*B(-9)-.4666666667*S(10)*B(-8)-.4666666667*S(10)*B(-7)-.4666666667*S(10)*B(-6)-.4666666667*S(10)*B(-5)-.4666666667*S(10)*B(-4)-.4666666667*S(10)*B(-3)-.4666666667*S(10)*B(-2)-.4666666667*S(10)*B(-1)-4.666666667*S(10)

 

(1/3)*(µ+3.12)*((1/2)*(µ+3.12)*(10*µ+31.20-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.7000000000*S(10)*B(-10)-.7000000000*S(10)*B(-9)-.7000000000*S(10)*B(-8)-.7000000000*S(10)*B(-7)-.7000000000*S(10)*B(-6)-.7000000000*S(10)*B(-5)-.7000000000*S(10)*B(-4)-.7000000000*S(10)*B(-3)-.7000000000*S(10)*B(-2)-.7000000000*S(10)*B(-1)-7.000000000*S(10))-.4666666667*S(10)*B(-10)-.4666666667*S(10)*B(-9)-.4666666667*S(10)*B(-8)-.4666666667*S(10)*B(-7)-.4666666667*S(10)*B(-6)-.4666666667*S(10)*B(-5)-.4666666667*S(10)*B(-4)-.4666666667*S(10)*B(-3)-.4666666667*S(10)*B(-2)-.4666666667*S(10)*B(-1)-4.666666667*S(10)

 

-.2550000000*(.23+µ)*(-11.50-50*µ-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-(1/3)*µ*(-(1/2)*µ*(76.50-5*µ)-8.797500000-38.25000000*µ-10.71000000*S(10)-1.071000000*S(10)*B(-9)-1.071000000*S(10)*B(-8)-1.071000000*S(10)*B(-7)-1.071000000*S(10)*B(-6)-1.071000000*S(10)*B(-5)-1.071000000*S(10)*B(-4)-1.071000000*S(10)*B(-3)-1.071000000*S(10)*B(-2)-1.071000000*S(10)*B(-1)-1.071000000*S(10)*B(-10))+.2856000000-3.570000000*S(10)-.3570000000*S(10)*B(-9)-.3570000000*S(10)*B(-8)-.3570000000*S(10)*B(-7)-.3570000000*S(10)*B(-6)-.3570000000*S(10)*B(-5)-.3570000000*S(10)*B(-4)-.3570000000*S(10)*B(-3)-.3570000000*S(10)*B(-2)-.3570000000*S(10)*B(-1)-.3570000000*S(10)*B(-10)

 

.1700000000*(µ+3.12)*(10*µ+31.20-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.2380000000*S(10)*B(-10)-.2380000000*S(10)*B(-9)-.2380000000*S(10)*B(-8)-.2380000000*S(10)*B(-7)-.2380000000*S(10)*B(-6)-.2380000000*S(10)*B(-5)-.2380000000*S(10)*B(-4)-.2380000000*S(10)*B(-3)-.2380000000*S(10)*B(-2)-.2380000000*S(10)*B(-1)-2.380000000*S(10)-(1/3)*µ*(5.100000000*µ+15.91200000-.7140000000*S(10)*B(-10)-.7140000000*S(10)*B(-9)-.7140000000*S(10)*B(-8)-.7140000000*S(10)*B(-7)-.7140000000*S(10)*B(-6)-.7140000000*S(10)*B(-5)-.7140000000*S(10)*B(-4)-.7140000000*S(10)*B(-3)-.7140000000*S(10)*B(-2)-.7140000000*S(10)*B(-1)-7.140000000*S(10)-(1/2)*µ*(10.20-20*µ))

 

.8400000000-(1/4)*(.23+µ)*(.7466666667-(1/3)*(.23+µ)*(.5600000000-(1/2)*(.23+µ)*(-11.50-50*µ-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.7000000000*S(10)*B(-10)-.7000000000*S(10)*B(-9)-.7000000000*S(10)*B(-8)-.7000000000*S(10)*B(-7)-.7000000000*S(10)*B(-6)-.7000000000*S(10)*B(-5)-.7000000000*S(10)*B(-4)-.7000000000*S(10)*B(-3)-.7000000000*S(10)*B(-2)-.7000000000*S(10)*B(-1)-7.000000000*S(10))-.4666666667*S(10)*B(-10)-.4666666667*S(10)*B(-9)-.4666666667*S(10)*B(-8)-.4666666667*S(10)*B(-7)-.4666666667*S(10)*B(-6)-.4666666667*S(10)*B(-5)-.4666666667*S(10)*B(-4)-.4666666667*S(10)*B(-3)-.4666666667*S(10)*B(-2)-.4666666667*S(10)*B(-1)-4.666666667*S(10))-.3500000000*S(10)*B(-10)-.3500000000*S(10)*B(-9)-.3500000000*S(10)*B(-8)-.3500000000*S(10)*B(-7)-.3500000000*S(10)*B(-6)-.3500000000*S(10)*B(-5)-.3500000000*S(10)*B(-4)-.3500000000*S(10)*B(-3)-.3500000000*S(10)*B(-2)-.3500000000*S(10)*B(-1)-3.500000000*S(10)

 

(1/4)*(µ+3.12)*((1/3)*(µ+3.12)*((1/2)*(µ+3.12)*(10*µ+31.20-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.7000000000*S(10)*B(-10)-.7000000000*S(10)*B(-9)-.7000000000*S(10)*B(-8)-.7000000000*S(10)*B(-7)-.7000000000*S(10)*B(-6)-.7000000000*S(10)*B(-5)-.7000000000*S(10)*B(-4)-.7000000000*S(10)*B(-3)-.7000000000*S(10)*B(-2)-.7000000000*S(10)*B(-1)-7.000000000*S(10))-.4666666667*S(10)*B(-10)-.4666666667*S(10)*B(-9)-.4666666667*S(10)*B(-8)-.4666666667*S(10)*B(-7)-.4666666667*S(10)*B(-6)-.4666666667*S(10)*B(-5)-.4666666667*S(10)*B(-4)-.4666666667*S(10)*B(-3)-.4666666667*S(10)*B(-2)-.4666666667*S(10)*B(-1)-4.666666667*S(10))-.3500000000*S(10)*B(-10)-.3500000000*S(10)*B(-9)-.3500000000*S(10)*B(-8)-.3500000000*S(10)*B(-7)-.3500000000*S(10)*B(-6)-.3500000000*S(10)*B(-5)-.3500000000*S(10)*B(-4)-.3500000000*S(10)*B(-3)-.3500000000*S(10)*B(-2)-.3500000000*S(10)*B(-1)-3.500000000*S(10)

 

-.1275000000*(.23+µ)*(.5600000000-(1/2)*(.23+µ)*(-11.50-50*µ-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.7000000000*S(10)*B(-10)-.7000000000*S(10)*B(-9)-.7000000000*S(10)*B(-8)-.7000000000*S(10)*B(-7)-.7000000000*S(10)*B(-6)-.7000000000*S(10)*B(-5)-.7000000000*S(10)*B(-4)-.7000000000*S(10)*B(-3)-.7000000000*S(10)*B(-2)-.7000000000*S(10)*B(-1)-7.000000000*S(10))-1.785000000*S(10)-.1785000000*S(10)*B(-9)-.1785000000*S(10)*B(-8)-.1785000000*S(10)*B(-7)-.1785000000*S(10)*B(-6)-.1785000000*S(10)*B(-5)-.1785000000*S(10)*B(-4)-.1785000000*S(10)*B(-3)-.1785000000*S(10)*B(-2)-.1785000000*S(10)*B(-1)-.1785000000*S(10)*B(-10)-(1/4)*µ*(-.2550000000*(.23+µ)*(-11.50-50*µ-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-(1/3)*µ*(-(1/2)*µ*(76.50-5*µ)-8.797500000-38.25000000*µ-10.71000000*S(10)-1.071000000*S(10)*B(-9)-1.071000000*S(10)*B(-8)-1.071000000*S(10)*B(-7)-1.071000000*S(10)*B(-6)-1.071000000*S(10)*B(-5)-1.071000000*S(10)*B(-4)-1.071000000*S(10)*B(-3)-1.071000000*S(10)*B(-2)-1.071000000*S(10)*B(-1)-1.071000000*S(10)*B(-10))+.2856000000-3.570000000*S(10)-.3570000000*S(10)*B(-9)-.3570000000*S(10)*B(-8)-.3570000000*S(10)*B(-7)-.3570000000*S(10)*B(-6)-.3570000000*S(10)*B(-5)-.3570000000*S(10)*B(-4)-.3570000000*S(10)*B(-3)-.3570000000*S(10)*B(-2)-.3570000000*S(10)*B(-1)-.3570000000*S(10)*B(-10))+.2856000000

 

0.8500000000e-1*(µ+3.12)*((1/2)*(µ+3.12)*(10*µ+31.20-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.7000000000*S(10)*B(-10)-.7000000000*S(10)*B(-9)-.7000000000*S(10)*B(-8)-.7000000000*S(10)*B(-7)-.7000000000*S(10)*B(-6)-.7000000000*S(10)*B(-5)-.7000000000*S(10)*B(-4)-.7000000000*S(10)*B(-3)-.7000000000*S(10)*B(-2)-.7000000000*S(10)*B(-1)-7.000000000*S(10))-.1190000000*S(10)*B(-10)-.1190000000*S(10)*B(-9)-.1190000000*S(10)*B(-8)-.1190000000*S(10)*B(-7)-.1190000000*S(10)*B(-6)-.1190000000*S(10)*B(-5)-.1190000000*S(10)*B(-4)-.1190000000*S(10)*B(-3)-.1190000000*S(10)*B(-2)-.1190000000*S(10)*B(-1)-1.190000000*S(10)-(1/4)*µ*(.1700000000*(µ+3.12)*(10*µ+31.20-1.4*S(10)*B(-10)-1.4*S(10)*B(-9)-1.4*S(10)*B(-8)-1.4*S(10)*B(-7)-1.4*S(10)*B(-6)-1.4*S(10)*B(-5)-1.4*S(10)*B(-4)-1.4*S(10)*B(-3)-1.4*S(10)*B(-2)-1.4*S(10)*B(-1)-14.0*S(10))-.2380000000*S(10)*B(-10)-.2380000000*S(10)*B(-9)-.2380000000*S(10)*B(-8)-.2380000000*S(10)*B(-7)-.2380000000*S(10)*B(-6)-.2380000000*S(10)*B(-5)-.2380000000*S(10)*B(-4)-.2380000000*S(10)*B(-3)-.2380000000*S(10)*B(-2)-.2380000000*S(10)*B(-1)-2.380000000*S(10)-(1/3)*µ*(5.100000000*µ+15.91200000-.7140000000*S(10)*B(-10)-.7140000000*S(10)*B(-9)-.7140000000*S(10)*B(-8)-.7140000000*S(10)*B(-7)-.7140000000*S(10)*B(-6)-.7140000000*S(10)*B(-5)-.7140000000*S(10)*B(-4)-.7140000000*S(10)*B(-3)-.7140000000*S(10)*B(-2)-.7140000000*S(10)*B(-1)-7.140000000*S(10)-(1/2)*µ*(10.20-20*µ)))

(1)

NULL


 

Download badSums2.mw

 

in the Mapleprimes toolbar to upload a worksheet with your calculation

That way the problem can be sensibly invetigated

@Carl Love 

for the wrong question! It was intended for

https://www.mapleprimes.com/questions/227415-How-To-Convert-The-Tekplot-File?reply=answer

because I only have the last six major versions of Maple installed on this machine.

Code I supplied works fine on all of them, but that only goes back to Maple 18!

 

Maple uses various methods to "restrict" the display of "output", amongst which are

  1. If a command is terminated with a colon ( ie ':'), the command will be executed but no output will be displayed
  2. If a command is terminated with a semi-colon ( ie ';'), the command will be executed and output will be displayed
  3. By default Maple will not display of matrices bigger than 10X10. This can be changed by an appropriate setting of interface(rtablesize).
  4. If you want to display the complete contents of a table (called say T), then you need to use T()

In the attached, I have terminated commands with ";" rather than ":" (see 1 above), so the output of more commands will be displayed. I have left colons terminating the 'for' loops - in general you don't want to see the output of every iteration of a loop, becuase this can fill a lot of "screens"

I have also changed set interface(rtablesize=15), so anything with 15 (or fewer) entries in either dimension ought to display completely

If you  download/execute the attached, then it should display (more-or-less) as it displays here

  restart:
  interface(rtablesize = 15):
  with(LinearAlgebra):

  A:= 8;
  B:= 5;
  q:= 0.4;
  p:= 0.2;
  r:= 1 - p - q;
  dimP:= A + B + 1;

8

 

5

 

.4

 

.2

 

.4

 

14

(1)

  P:= Matrix(dimP, dimP, [0 $ dimP*dimP]);
  P[1, 1]:= 1;
  P[1, 2]:= 0;
  P[dimP, dimP]:= 1;
  P[dimP, dimP - 1]:= 0;
  for i from 2 to dimP - 1 do
      P[i, i - 1]:= q;
      P[i, i]:= r;
      P[i, i + 1]:= p;
  end do:

Matrix(14, 14, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (1, 13) = 0, (1, 14) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (2, 13) = 0, (2, 14) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (3, 13) = 0, (3, 14) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (4, 13) = 0, (4, 14) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (5, 13) = 0, (5, 14) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (6, 13) = 0, (6, 14) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 0, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (7, 13) = 0, (7, 14) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 0, (8, 11) = 0, (8, 12) = 0, (8, 13) = 0, (8, 14) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (9, 11) = 0, (9, 12) = 0, (9, 13) = 0, (9, 14) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0, (10, 11) = 0, (10, 12) = 0, (10, 13) = 0, (10, 14) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = 0, (11, 11) = 0, (11, 12) = 0, (11, 13) = 0, (11, 14) = 0, (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = 0, (12, 10) = 0, (12, 11) = 0, (12, 12) = 0, (12, 13) = 0, (12, 14) = 0, (13, 1) = 0, (13, 2) = 0, (13, 3) = 0, (13, 4) = 0, (13, 5) = 0, (13, 6) = 0, (13, 7) = 0, (13, 8) = 0, (13, 9) = 0, (13, 10) = 0, (13, 11) = 0, (13, 12) = 0, (13, 13) = 0, (13, 14) = 0, (14, 1) = 0, (14, 2) = 0, (14, 3) = 0, (14, 4) = 0, (14, 5) = 0, (14, 6) = 0, (14, 7) = 0, (14, 8) = 0, (14, 9) = 0, (14, 10) = 0, (14, 11) = 0, (14, 12) = 0, (14, 13) = 0, (14, 14) = 0})

 

1

 

0

 

1

 

0

(2)

  p0:= Matrix(dimP, 1, [0 $ dimP]);
  p0[A + 1, 1]:= 1;
  pV[0]:= p0;
  PT:= Transpose(P);

Vector(14, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 0, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0})

 

p0[9, 1] := 1

 

Vector(14, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 0, (8) = 0, (9) = 1, (10) = 0, (11) = 0, (12) = 0, (13) = 0, (14) = 0})

 

Matrix(%id = 18446744074386657518)

(3)

  for n to 200 do
      pV[n]:= PT . (pV[n - 1]);
  end do:

  map(x -> evalf(x, 3), Transpose(pV[5]));

Vector[row](14, {(1) = 0., (2) = 0., (3) = 0., (4) = 0.102e-1, (5) = 0.512e-1, (6) = .128, (7) = .205, (8) = .230, (9) = .189, (10) = .115, (11) = 0.512e-1, (12) = 0.160e-1, (13) = 0.320e-2, (14) = 0.320e-3})

(4)

 

 

NULL


 

Download mat3.mw

@Rouben Rostamian

As well as the sign of the second derivative, you also flipped the sign of the exponent term in the definition of 'f'. Deliberate?

 

Is this worksheet using 'j' to represent the square root of -1, perhaps set up using an 'init' file?

Maple's default is I

@minhthien2016 

'sol' is a sequence, so you need nops([sol]) to get the number of entries.

Alternatively you can change the solve() command so that it returns a list, rather than a sequence just by writing

sol:=[solve(......)];

in which case nops(sol) will work.

4 5 6 7 8 9 10 Last Page 6 of 149