## 5473 Reputation

9 years, 338 days

## Why do you want the power series??...

1. It is possible to ask Maple to generate "power series" solutions for systems of ODEs. This is done in the attached, where I have generated the relevant series up to Order(12). However as the comparison graphs demonstrate, the power series solution deviates substantially from the numerical solution obtained by Runge-Kutta methods, as T increases. The attached shows that "reasonable" agreement between the two methods is only obtained up to ~6. One could increase the order of the power series solutions (the attached uses 12) and the range of "reasonable" will be extended.
2. The code you supply in your worksheet does not implement the method required to produce a power series solutiion for an ODE system. In fact I have absolutely no idea what your code calculates, but I guarantee that it has nothing to do with power series solution of the ODE system.

If you really want to develop your own code for producing power series solutions, I suggest you read

1. Chaper 3 of Elementary Differention Equations by Edwards  and  Penney, or
2. https://en.wikipedia.org/wiki/Power_series_solution_of_differential_equations (for a quick introduction).

before starting

 >
 >
 >
 >
 >
 (1)
 > # # Generate power series solutions of order 12 # (Maple default is 6) for all ODEs #   Order:=12:   ans2:= convert~          ( evalf~            ( dsolve              ( {ODEs, bcs},                indets([ODEs], function(name)),                'series'              )            ),            polynom          ); # # Plot the "numeric" solution obtained earlier # and the equivalent power series solution # obtaine above on th same graph. # # Note that the range of the plots is reduced, # because even with 12-th order polynomials, # the power series soluton and the numerical # solution start to deviate for T>~6 #   for j in indets([ODEs], function(name)) do       display       ( [ odeplot           ( ans,             [T, j],             T = 0 .. 10,             thickness = 2,             color = red           ),           plot           ( eval(j, ans2),             T = 0 .. 10,             thickness = 2,             color=blue           )         ],         title = cat(convert(j,string), " (Numerical and PowerSeries compared)"),         titlefont = [tims, bold, 20]       )    end do
 >

## interface(rtablesize)...

Mine is set to [10,10] which is the default.

Until Maple2019 any matrix bigger than the interface(rtablesize) setting  wouldn't display at all (unless one reset the rtablesize). By default in Maple 2019 it now displays the matrix up to the rtablesize setting with the other entries elided, and just the little indicator at the bottom which tells you the actual matrix size - so the "15*9 Matrix" in  the output of my worksheet above

## Or with a couple of minor amendments...

One can get the output matrix directly

 > restart; incog:=[theta[1, 1], theta[1, 2], theta[2, 1], theta[2, 2], theta[2, 6],         theta[3, 0], theta[3, 3], theta[3, 4], theta[3, 5]        ]: eq:=[ 1, theta[1, 1]+theta[2, 2]+theta[3, 3], -theta[1, 1]-theta[2, 2],       theta[2, 6]*theta[3, 5], -theta[1, 1]*theta[3, 3]-theta[2, 2]*theta[3, 3],      -theta[1, 1]*theta[2, 6]*theta[3, 5]+theta[1, 2]*theta[2, 6]*theta[3, 4],       theta[1, 1]*theta[2, 2]*theta[3, 3]-theta[1, 2]*theta[2, 1]*theta[3, 3]+theta[1, 2]*theta[2, 6]*theta[3, 0]     ]: myProc:= proc(P, V)               local c, C, v;               coeffs(P, V, 'c');               seq([seq(`if`(type(C, dependent(v)),1,0), v = V)], C = c);          end proc: Matrix(map(myProc, eq, incog));
 (1)
 >

## Slightly off-topic...

I'm thinking about building a new workstation, using an AMD processor. (I've never gone the AMD route before - but you know - current price/performance etc!)

The fact that Maple itself appears to use the Intel MKL has now got me (slightly) worried, since (many years ago?)  this library was nicknamed "crippleAMD".

According to https://en.wikipedia.org/wiki/Math_Kernel_Library,

As of 2019, MKL, which remains the choice of many pre-compiled Mathematical applications on Windows (such as NumPy, SymPy, and MATLAB), still significantly underperforms on AMD CPUs with equivalent instruction sets

Would I really get a performance penalty if my (future) workstation uses an AMD processor??

## Didn't investigate...

was actually much more interested in the discrepancy which arises between 'physics' versions

which command in the following you do not understand, or find "needlessly complicated"

 > restart; # # Define a function #   f:= x-> 4*sin(x)+2*x^2+x+3;
 (1)
 > # # Return the value of this function #   f(p);
 (2)
 > # # Return the value of a function at some # value of the independent variable #   f(2);
 (3)
 > # # Return the derivative of the function. # Note that this derivative is itself a # funcion #   D(f);
 (4)
 > # # Return the derivative of the funcion at a # some value of the independent variable #   D(f)(2);
 (5)
 > # # Define a "new" function which contains the # derivative of the original function #   g:= (x, y)-> D(f)(x)*y;
 (6)
 > # # Return the value of the "new" function #   g(p,q);
 (7)
 > # # Return the value of the "new" function for # a few values of the independent variables #   g(p,2);   g(3,q);   g(3,2);
 (8)
 >

## Observation...

On 64-bit Windows 7, I just updated to Physics 428.

Subsequent Physics:-Version() check in Maple gave the message

`The "Physics Updates" version in the MapleCloud is 428 and is the same as the version installed in this computer, created 2019, September 22, 7:8 hours, found in the directory C:\\Users\\TomLeslie\\maple\\toolbox\\2019\\Physics Updates\\lib\\`

as expected.

So I had no issues with this update

## InsertContent()...

was introducd in Maple 2015, and updated in Maple 2016. Exactly what version are you using?

## Don't know what you mean!!...

so you will have to specify the requirement more clearly.

Possibly??? the command

P:=unapply(doDiff(f,x,n),n);

## You will note...

This is the same error message which I obtained in a earlier post - and I suggested why this error message might occur. Try reading my earlier post

## Using Matlab or Maple?...

Questions on this site only get an answer in Maple code. If you want an answer in Matlab code, then post on

If you have a Maple problem in Maple code, then post the code here

## why is this posted here?...

"fminsearch" is a Matlab command to "Find minimum of unconstrained multivariable function using derivative-free method"

Why are you posting Matlab problems on a Maple forum??

"Exactly what is the problem???"

Your answer that " I think time-series result ( i mean graph) is incorrect?" isn't making it!!

On what mathematical basis do you think the solution provided by Maple is incorrect??

When I look at the 3D result provided by Maple, ie C(x,t) as a function of x and t, the only thing that looks  *slightly* suspicious is the region around C(1,0). The value at C(1,0) is forced to be 1 by the supplied ICs/BCs, but this value changes very rapidly (one might almost say "discontinuously") as (x,t) move even slightly from (1,0). This would make me double-check whether the relevant boundary/initial condition is "correct"

Otherwise I see no reason to doubt the result which Maple provides

## Observation...

The code in the image you supply is "cheating" becuase the expressions you supply for 'c' and 'd' mean two completely different things, and are certainly not equivalent

See the attached

 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 > # # Convert the above to 1-D input for illustration # # Note that the code contains the variable 'names' # ui and uf, but also the 'functions' ui() and uf() # with arguments (1/lambda^2). # # Maple consider the name 'ui' and the function 'ui()' # to be two completely different entities # # The function definitions occur because there is # no multiplication (explicit or implicit) in a # subexpression like ui(1/lambda^2) # # Check what happens when these multiplications are # added #   d := ui*delta*ui(1/lambda^2) - ui*delta*uf(1/lambda^2) - uf*delta*ui(1/lambda^2) + uf*delta*uf(1/lambda^2);   d := ui*delta*ui*(1/lambda^2) - ui*delta*uf*(1/lambda^2) - uf*delta*ui*(1/lambda^2) + uf*delta*uf*(1/lambda^2);
 (5)
 >