## How to solve properly given system of ODE's?...

Hi

I have trouble with solving this ODE system using dsolve command:

and

This system have following solutions:

where

and

C's and A are constants of integration.

They're equations from this paper https://arxiv.org/abs/1710.01910 (45 and 47).

However, my solution differs from correct one - in output there are hypergeometric functions everywhere.

Is there any way to fix/convert this solution? Or to get rid of these functions (my f1 solution looks very close to original one but with coupled hypergeometric function).

sysode := 2*q*(3*q-1)*f1(tau)/tau^2+2*q*(diff(f1(tau), tau))/tau+diff(f1(tau), tau, tau)+(kappa^2+f2(tau))*(1+omega)*(tau/t0)^(-(3*(3+omega))*q) = 0, (54*q^3-30*q^2+4*q)*f1(tau)/tau^3+(24*q^2-4*q)*(diff(f1(tau), tau))/tau^2+11*q*(diff(f1(tau), tau, tau))/tau+diff(f1(tau), tau, tau, tau)-3*omega*(1+omega)*(kappa^2+f2(tau))*q*(tau/t0)^(-(3*(1+omega))*q)/tau = 0;

 (1)

simplify(dsolve([sysode], build));

 (2)

## In python, call Maple and its toolbox....

I know you can call python from Maple, I am thinking if there is the other way around. That is use Maple (and its toolbox) as backend engine to do calculations (e.g. Global Optimization), and say manipulate the data in Python as the front-end.

## Chebyshev series in different intervals...

Hello,

My question is mathematical in nature, so it might be a little out of place but I though I would give it a shot.

You have a series of chebyshev coefficients in two connecting subdomains lets say S1 = [0,0.5] and S2=[0.5,1]. So far you are still in the spectral space. If you want to compute the solution in real space you can sum the coefficients with the Chebyshev polynomials.

Now imagine you change the interval to S1 = [0,0.6] and S2 = [0.6,1]. Is there a way to manipulate the Chebyshev coefficients from both initial subdomains to create a new set of Chebyshev coefficients that fit the solution in the new subdomains.

The brute force method would be to create the real solution of Chebyshev polynomials and then use that to form a new set of Chebyshev coefficients. Or you can use Clenshaw to compute the solution at several points, and then use the points to create new Chebyshev coefficients.

But what if we can stay in spectral space and create the new chebyshev coefficients. Is that possible? If so, how?

## Is it possible to instantiate all the attributes o...

Hi,

When creating a user random variable, I would like to instanciate some of its attributes, for instance ParentName.
But it seems that it's not always possible.

​​​​​​​Is it a Maple's limitation or am I not doing the things correctly ?
​​​​​​​
Example:

 > restart:
 > with(Statistics):
 > U := RandomVariable(Uniform(0, 1)):
 > interface(warnlevel=0):
 > A := attributes(U)[3]
 (1)
 > AllAttributes := with(A);
 (2)
 > A:-ParentName
 (3)
 > # Define a user random variable v := Distribution(PDF = (z -> piecewise(0 <= t and t < 1, 1, 0))): V := RandomVariable(v): A := attributes(V)[3]; AllAttributes := with(A); A:-Conditions;
 (4)
 > # its definition can be augmented by adding some recognized attributes... # even if the result returned by Mean is strange v := Distribution(PDF = (z -> piecewise(0 <= t and t < 1, 1, 0)), 'Mean'=1/Pi, 'Median'=exp(-1)): V := RandomVariable(v): A := attributes(V)[3]; AllAttributes := with(A); [Median, Mean](V)
 (5)
 > # but not all the recognized attributes seem to be able to be instanciated: v := Distribution(PDF = (z -> piecewise(a <= t and t < b, 1/(b-a), 0)), 'Parameters'=[a, b]); v := Distribution(PDF = (z -> piecewise(a <= t and t < b, 1/(b-a), 0)), 'ParentNames'=MyDistribution);
 >

## Strange behavior of sqrt function....

I'm new to Maple.

My problem is that if I input the command sqrt(3.0), for example, I get this strange result:

1.81847767202745*10^(-58) + (7.53238114626421*10^(-59))*I

The results is the same, no matter the argument of sqrt.

Also, when using ln, I get this:

-265.745524189222 + 0.785398163397448*I

Again, no matter the argument of ln, the result is the same.

What is happening?

## Galerkin Finite Element Method using maple...

Dear maple user  any one suggest me how to solve  second order coupled differential equation using galerkin finite element method for 8 elements and 10 elements using maple codes

## How do I solve Optimal control in Maple?...

Hi, Is there a way in which i can solve the following optimal control problem numerically with Maple ??

where P(t)=N(t)+S(t)+A(t) and N(0)=0.4897, S(0)=0.4018, A(0)=0.1085.

μ=0.000833, d=0.000666, ε1=0.0020, ε2=0.000634, β1=0.002453, β2=0.25*0.02, γ1=0.0048, γ2=0.25*0.02+0.00013, k1=1, k2=0.001, k3=0.99.

where

p1,p2,p3 are transversality conditions

p1(60)=0
p2(60)=0
p3(60)=0

Benz.

## hamilton method for optimal solution...

Hi

I have an optimization problem subjects with a system of ordinary differential equations with initial conditions.

I would like to obtain u^star, x^star and y^star solution of my problem

I prefer if possible we implement hamilton jacobi bellman if possible

Optimal_control_problem.mw

thanks

## Different Memory and time for running same codes...

whats wrong with the codes while running the codes in maple 13 it will take memory and time as 41.80M, 9.29s while the same code is running in maple 18 it will take 1492.38M , 911.79s

Why the same codes take different time and memory. The codes are here

restart:
Digits:=15:
d1:=0.2:d2:=0.6:L1:=0.2:L2:=0.2:F:=0.3:Br:=0.3:
Gr:=0.2: Nb:=0.1:Nt:=0.3:B:=1:B1:=0.7:m:=1:k:=0.1:
Ro:=1:R1:=1:q:=1:alpha:=Pi/4:
h:=z->piecewise( z<=d1,    1,
z<=d1+L1,   1-(gamma1/(2*Ro))*(1 + cos(2*(Pi/L1)*(z - d1 - L1/2))),
z<=B1-L2/2,  1 ,
z<=B1,  1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),
z<=B1+L2/2,  R1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),
z<=B,    R1):
A:=(-m^2/4)-(1/4*k):
S1:=(h(z)^2)/4*A-ln(A*h(z)^2+1)*(1+h(z)^2)/4*A:
a2:=Int((1/S1),z=0..1):
b2:=Int((sin(alpha)/F),z=0..1):
c2:=(1/S1)*(-h(z)^6/(6912*A)-h(z)^4/(9216*A)+h(z)^2/(4608*A^3)+ln(1+A*h(z)^2)*(h(z)^6/(576*A)+h(z)^4/(512*A^2)-1/(4608*A^4))):
c3:=Int(c2,z=0..1):
c4:=2*Gr*(Nb-Nt)*c3:
e2:=(1/S1)*(-7*h(z)^4/(256*A)-h(z)^2/(128*A^2)+ln(1+A*h(z)^2)*(3*h(z)^4/(128*A)+h(z)^2/(32*A^2)+1/(128*A^3))):
e3:=Int(e2,z=0..1):
e4:=2*(Nt/Nb)*Br*e3:
l1:=-a2:
l2:=-b2-c4+e4:
Dp:=q*l1+l2:

igRe:=subsindets(Dp,specfunc(anything,Int),
u->Int(Re(op(1,u)),op(2,u),
method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igRe,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
linestyle = [solid,dash,dot],
color = [black,black,black],
labels=[gamma1,'Re(Dp)'],
gridlines=false, axes=boxed);

igIm:=subsindets(Dp,specfunc(anything,Int),
u->Int(Im(op(1,u)),op(2,u),
method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igIm,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
linestyle = [solid,dash,dot],
color = [black,black,black],
labels=[gamma1,'Im(Dp)'],
gridlines=false, axes=boxed);

## I Have a problem in Do loop...

Dears, greeting for all

I have a problem, I try to explain it by a figure

This formula does not work.

I need to substitute n=0 to give G_n+1 as a function of the parameter s, then find the limit.

.where G_n is a function in s.

this is the result

## how to express eigenvector or eigenvalues in terms...

how to express eigenvector or eigenvalues in terms of fibonacci or lucas or golden ratio?

fibonacci ratio has many

f(n)/f(n-1) , all eigenvector can not divided by any one of them

## Wrong values for Eigenvalues, depending on Digits ...

Hello!

I want to calculate Eigenvalues. Depending on values for digits and which datatype I choose Maple sometimes returns zero as Eigenvalues. Maybe there is a problem with the used routines: CLAPACK sw_dgeevx_, CLAPACK sw_zgeevx_.

 >

Problems LinearAlgebra:-Eigenvalues, Digits, ':-datatype' = ':-sfloat', ':-datatype' = ':-complex'( ':-sfloat' )

 > restart;
 > interface( ':-displayprecision' = 5 ):
 > infolevel['LinearAlgebra'] := 5; myPlatform := kernelopts( ':-platform' ); myVersion := kernelopts( ':-version' );
 (1.1)

Example 1

 > A1 := Matrix( 5, 5, [[0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1], [-10201/1000, 30199/10000, -5049/250, 97/50, -48/5]] );
 (1.1.1)
 > LinearAlgebra:-Eigenvalues( A1 );
 CharacteristicPolynomial: working on determinant of minor 2 CharacteristicPolynomial: working on determinant of minor 3 CharacteristicPolynomial: working on determinant of minor 4 CharacteristicPolynomial: working on determinant of minor 5
 (1.1.2)
 > A11 := Matrix( op( 1, A1 ),( i,j ) -> evalf( A1[i,j] ), ':-datatype' = ':-sfloat' );
 (1.1.3)
 > Digits := 89; LinearAlgebra:-Eigenvalues( A11 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.1.4)
 > Digits := 90; LinearAlgebra:-Eigenvalues( A11 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.1.5)
 > A12 := Matrix( op( 1, A1 ),( i,j ) -> evalf( A1[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );
 (1.1.6)
 > Digits := 100; LinearAlgebra:-Eigenvalues( A12 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.1.7)
 > Digits := 250; LinearAlgebra:-Eigenvalues( A12 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.1.8)
 >
 >

Example 2

 > A2 := Matrix(3, 3, [[0, 1, 0], [0, 0, 1], [3375, -675, 45]]);
 (1.2.1)
 > LinearAlgebra:-Eigenvalues( A2 );
 IntegerCharacteristicPolynomial: Computing characteristic polynomial for a 3 x 3 matrix IntegerCharacteristicPolynomial: Using prime 33554393 IntegerCharacteristicPolynomial: Using prime 33554383 IntegerCharacteristicPolynomial: Used total of  2  prime(s)
 (1.2.2)
 > A21 := Matrix( op( 1, A2 ),( i,j ) -> evalf( A2[i,j] ), ':-datatype' = ':-sfloat' );
 (1.2.3)
 > Digits := 77; LinearAlgebra:-Eigenvalues( A21 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.2.4)
 > Digits := 78; LinearAlgebra:-Eigenvalues( A21 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.2.5)
 > A22 := Matrix( op( 1, A2 ),( i,j ) -> evalf( A2[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );
 (1.2.6)
 > Digits := 58; LinearAlgebra:-Eigenvalues( A22 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.2.7)
 > Digits := 59; LinearAlgebra:-Eigenvalues( A22 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.2.8)
 >
 >

Example 3

 > A3 := Matrix(4, 4, [[0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [-48841, 8840, -842, 40]]);
 (1.3.1)
 > LinearAlgebra:-Eigenvalues( A3 );
 IntegerCharacteristicPolynomial: Computing characteristic polynomial for a 4 x 4 matrix IntegerCharacteristicPolynomial: Using prime 33554393 IntegerCharacteristicPolynomial: Using prime 33554383 IntegerCharacteristicPolynomial: Used total of  2  prime(s)
 (1.3.2)
 > A31 := Matrix( op( 1, A3 ),( i,j ) -> evalf( A3[i,j] ), ':-datatype' = ':-sfloat' );
 (1.3.3)
 > Digits := 75; LinearAlgebra:-Eigenvalues( A31 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.3.4)
 > Digits := 76; LinearAlgebra:-Eigenvalues( A31 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.3.5)
 > A32 := Matrix( op( 1, A3 ),( i,j ) -> evalf( A3[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );
 (1.3.6)
 > Digits := 100; LinearAlgebra:-Eigenvalues( A32 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.3.7)
 > Digits := 250; LinearAlgebra:-Eigenvalues( A32 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.3.8)
 >
 >

Example 4

 > A4 := Matrix(8, 8, [[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1], [-1050625/20736, 529925/1296, -15417673/10368, 3622249/1296, -55468465/20736, 93265/108, -1345/8, 52/3]]);
 (1.4.1)
 > LinearAlgebra:-Eigenvalues( A4 );
 CharacteristicPolynomial: working on determinant of minor 2 CharacteristicPolynomial: working on determinant of minor 3 CharacteristicPolynomial: working on determinant of minor 4 CharacteristicPolynomial: working on determinant of minor 5 CharacteristicPolynomial: working on determinant of minor 6 CharacteristicPolynomial: working on determinant of minor 7 CharacteristicPolynomial: working on determinant of minor 8
 (1.4.2)
 > A41 := Matrix( op( 1, A4 ),( i,j ) -> evalf( A4[i,j] ), ':-datatype' = ':-sfloat' );
 (1.4.3)
 > Digits := 74; LinearAlgebra:-Eigenvalues( A41 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.4.4)
 > Digits := 75; LinearAlgebra:-Eigenvalues( A41 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.4.5)
 > A42 := Matrix( op( 1, A4 ),( i,j ) -> evalf( A4[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );
 (1.4.6)
 > Digits := 100; LinearAlgebra:-Eigenvalues( A42 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.4.7)
 > Digits := 250; LinearAlgebra:-Eigenvalues( A42 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.4.8)
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >

## FUNCTIONAL FORM OF INTERPOLATON...

How to get the functional form of interpolation in the given example below

GP.mw

## problems with ChiSquareSuitableModelTest...

Hi,

The procedure Statistics:-ChiSquareSuitableModelTest returns wrong or stupid results in some situations.
The stupid answer can easily be avoided if the user is careful enough.
The wrong answer is more serious: the standard deviation (in the second case below) is not correctly estimated.

PS: the expression "CORRECT ANSWER" is a short for "POTENTIALLY CORRECT ANSWER" given that what ChiSquareSuitableModelTest really does is not documented

 > restart:
 > with(Statistics):
 > randomize(): N := 100: S := Sample(Normal(0, 1), N):
 > infolevel[Statistics] := 1: # 0 parameter to fit from the sample S  CORRECT ANSWER ChiSquareSuitableModelTest(S, Normal(0, 1), level = 0.5e-1): print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Bins:                    10 Degrees of freedom:      9 Distribution:            ChiSquare(9) Computed statistic:      15.8 Computed pvalue:         0.0711774 Critical value:          16.9189774487099 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (1)
 > # 2 parameters (mean and standard deviation) to fit from the sample S  INCORRECT ANSWER ChiSquareSuitableModelTest(S, Normal(a, b), level = 0.5e-1, fittedparameters = 2): print(): # verification m := Mean(S); s := StandardDeviation(S); t := sqrt(add((S-~m)^~2) / (N-1)); print(): error "the estimation of the StandardDeviation ChiSquareSuitableModelTest is not correct"; print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Model specialization:    [a = -.2143e-1, b = .8489] Bins:                    10 Degrees of freedom:      7 Distribution:            ChiSquare(7) Computed statistic:      3.8 Computed pvalue:         0.802504 Critical value:          14.0671405764057 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (2)
 > # ONLY 1 parameter (mean OR standard deviation ?) to fit from the sample S  STUPID ANSWER # # A stupid answer: the parameter to fit not being declared, the procedure should return # an error of the type "don(t know what is the paramater tio fit" ChiSquareSuitableModelTest(S, Normal(a, b), level = 0.5e-1, fittedparameters = 1): print(): WARNING("ChiSquareSuitableModelTest should return it can't fit a single parameter"); print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Model specialization:    [a = -.2143e-1, b = .8489] Bins:                    10 Degrees of freedom:      8 Distribution:            ChiSquare(8) Computed statistic:      3.8 Computed pvalue:         0.874702 Critical value:          15.5073130558655 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (3)
 > ChiSquareSuitableModelTest(S, Normal(a, 1), level = 0.5e-1, fittedparameters = 1):  #CORRECT ANSWER print(): # verification m := Mean(S); print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Model specialization:    [a = -.2143e-1] Bins:                    10 Degrees of freedom:      8 Distribution:            ChiSquare(8) Computed statistic:      16.4 Computed pvalue:         0.0369999 Critical value:          15.5073130558655 Result: [Rejected] This statistical test provides evidence that the null hypothesis is false
 (4)
 > ChiSquareSuitableModelTest(S, Normal(0, b), level = 0.5e-1, fittedparameters = 1):  #CORRECT ANSWER print(): # verification s := sqrt((add(S^~2) - 0^2) / N); print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Model specialization:    [b = .8492] Bins:                    10 Degrees of freedom:      8 Distribution:            ChiSquare(8) Computed statistic:      6.4 Computed pvalue:         0.60252 Critical value:          15.5073130558655 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (5)
 >