Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

I'd like to reproduce Initial Value DDE of Neutral Type in Maple.
The differential equation is: 

deq := D(y)(t) = 2*cos(2*t)*y(t/2)^(2*cos(t)) + ln(D(y)(t/2)) - ln(2*cos(t)) - sin(t): # with y(0) = 1 and known D(y)(0)

Unfortunately, if I type valid initial values, Maple will simply generate , and yet if I just give a partial initial condition, Maple will display and only return incorrect results. 
 

restart;

interface(version)

`Standard Worksheet Interface, Maple 2023.1, Windows 10, July 7 2023 Build ID 1723669`

(1)

deq := (D(y))(t) = 2*cos(2*t)*y((1/2)*t)^(2*cos(t))+ln((D(y))((1/2)*t))-ln(2*cos(t))-sin(t)

RealDomain:-solve(subs(t = 0, y(0) = 1, deq), (D(y))(0))

2, -LambertW(-2*exp(-2))

(2)

dsolve({deq, y(0) = 1, (D(y))(0) = (2, -LambertW(-2*exp(-2)))[1]}, 'numeric', 'delaymax' = Pi, 'range' = 0 .. 2*Pi)

Error, (in dsolve/numeric/DAE/initial) too many initial conditions, the following are not needed: {D(y)(0) = 2}

 

dsolve({deq, y(0) = 1, (D(y))(0) = (2, -LambertW(-2*exp(-2)))[2]}, 'numeric', 'delaymax' = Pi, 'range' = 0 .. 2*Pi)

Error, (in dsolve/numeric/DAE/initial) too many initial conditions, the following are not needed: {D(y)(0) = -LambertW(-2*exp(-2))}

 

dsn := dsolve({deq, y(0) = 1}, 'type' = 'numeric', 'delaymax' = Pi, 'range' = 0 .. 2*Pi)

plots['odeplot'](dsn, 0 .. 2*Pi)NULL

Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

 

`[Length of output exceeds limit of 1000000]`

 

Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

 

 


 

Download ndelay.mw

The output is wrong. Note that "y(0) = 1" is insufficient to uniquely specify a solution, as "D(y)(0)" can be either -LambertW(-2/exp(2)) or 2. But Maple does not allow sufficient constraints here. How do I avoid such an unexpected behavior?

Here is a test: 

For small matrices, apart from the first call, the performance is almost perfect (🎉!). 
As a comparison, an equivalent test may be performed in modern Python:

As you can see, for 1024×1024, 2048×2048, 4096×4096, 8192×8192, and 16384×16384 matrices, Maple's performance gets pretty poor. Is the FFT procedure not well optimized for larger matrices? I do have read the Fourier Transforms in Maple, yet I cannot find any information on this subject. 
In accordance with the following output 

showstat(DiscreteTransforms::FFT_complex8, 3):

FFT_complex8 := proc()
       ...
   3   :-DiscreteTransforms:-FFT_complex8 := LinkExternal('hw_FFT',2003);
       ...
end proc

it appears that the code hasn't been developed for 20 years. Is it possible to improve the performance of the FFT built into Maple in order that the computation on such a 2¹⁴×2¹⁴ matrix can be achieved in about twenty seconds (rather than in two minutes)?

Note. For these matrices, exact transform results (see below) can be obtained symbolically.

for n from 0 to 12 do
    m := LinearAlgebra:-HankelMatrix(<$ (1 + 1 .. 2**n + 2**n)>, datatype = complex[8], shape = []): gc();
    print(n, andseq(abs(_) < HFloat(1, -10, 2), _ in SignalProcessing:-FFT(m, normalization = none, inplace = true) - Matrix(2^n, <2^(2*n)*(2^n + 1), <'2^(2*n - 1)*(:-cot((k - 1)/2^n*Pi)*I - 1)' $ 'k' = 1 + 1 .. 2^n>>, shape = symmetric, storage = sparse, datatype = complex[8])) (* faster than `rtable_scanblock` and `ArrayTools:-IsZero` and much faster (🎊!) than `comparray` and `verify/Matrix` with testfloat *) )
od:
 = 
                            0, true

                            1, true

                            2, true

                            3, true

                            4, true

                            5, true

                            6, true

                            7, true

                            8, true

                            9, true

                            10, true

                            11, true

                            12, true

However, the main goal is to test the numerical efficiency of Maple's fast Fourier transform algorithm.

Q1: Why does Maple use the bar as a delimiter for certain elliptic expressions and the comma for others?

Is that in line with: Gradshteyn and Ryzhik (G&R) and in the popular "Handbook of Mathematical Functions" edited by Abramowitz and Stegun (A&S), as stated in help(JacobiAM)?      

Q2: Can I have the comma instead of the vertical bar for the Jacobian functions?

Q3: If not, how to get a bit more space between the symbols and the bar for better readability?

 

interface(version)

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

(1)

FunctionAdvisor(relate, EllipticF, InverseJacobiSN)

EllipticF(z, k) = InverseJacobiSN(z, k)

(2)

Typesetting:-EnableTypesetRule(Typesetting:-SpecialFunctionRules)

{}

(3)

EllipticF(z, k) = InverseJacobiSN(z, k)

EllipticF(z, k) = InverseJacobiSN(z, k)

(4)

NULL


 

Download Argument_delimiter.mw

How to get same graph from maple with finite difference method for differential equations 

I m new here how to plot this i have seen related posts no where given clear idea for FDM method

plase help me to get the results Thank you

 

 

I made the upgrade to Maple 2023 today and for fun I compiled a simple procedure. I got an error in Maple 2023. So I ran the same lines of code in Maple 2022 and eveything works. Does anyone sees this problem?

restart:
kernelopts(version);

`Maple 2023.0, X86 64 WINDOWS, Mar 06 2023, Build ID 1689885`

(1)

p := proc( x :: float ) :: float; 2.3 * x end proc:

cp:=Compiler:-Compile(p)

Error, (in Compiler:-Compile) linker exited with nonzero status 1:

 

cp(1.1)

cp(1.1)

(2)

 

Download compile_ex.mw

Suppose that a procedure is declared with option threadsafe and it has a local child procedure PC (possibly anonymous). Is their any benefit, or perhaps any detriment, to also declaring PC with option threadsafe? For example, is there any benefit or detriment to the yellow option threadsafe in this code below?:

P:= proc()
option threadsafe;
local PC:= proc()
option threadsafe; (* some code *) end proc;
    (* some code *)
    PC();
    (* some code *)

end proc;

Please help with the bifurcation diagram for the system and parameter values below

NULL

with(VectorCalculus)

[`&x`, `*`, `+`, `-`, `.`, `<,>`, `<|>`, About, AddCoordinates, ArcLength, BasisFormat, Binormal, ConvertVector, CrossProduct, Curl, Curvature, D, Del, DirectionalDiff, Divergence, DotProduct, Flux, GetCoordinateParameters, GetCoordinates, GetNames, GetPVDescription, GetRootPoint, GetSpace, Gradient, Hessian, IsPositionVector, IsRootedVector, IsVectorField, Jacobian, Laplacian, LineInt, MapToBasis, Nabla, Norm, Normalize, PathInt, PlotPositionVector, PlotVector, PositionVector, PrincipalNormal, RadiusOfCurvature, RootedVector, ScalarPotential, SetCoordinateParameters, SetCoordinates, SpaceCurve, SurfaceInt, TNBFrame, TangentLine, TangentPlane, TangentVector, Torsion, Vector, VectorField, VectorPotential, VectorSpace, Wronskian, diff, eval, evalVF, int, limit, series]

(1)

interface(imaginaryunit = F)

I

(2)

M := Pi*theta-S*c__1-S*lambda+S__v*v__2

Pi*theta-S*c__1-S*lambda+S__v*v__2

(3)

Y := -S__v*c__2*lambda+Pi*b__1+S*v__1-S__v*c__3

-S__v*c__2*lambda+Pi*b__1+S*v__1-S__v*c__3

(4)

P := S__v*alpha+`&rho;__A`*A+c__4*`&rho;__Q`*Q+I*`&rho;__I`-µ*V

Q*c__4*rho__Q+A*rho__A+I*rho__I+S__v*alpha-V*µ

(5)

R := S__v*c__2*lambda-E*c__5+S*lambda

S__v*c__2*lambda-E*c__5+S*lambda

(6)

U := E*a*delta+Q*k*`&rho;__Q`-A*c__6

E*a*delta+Q*k*rho__Q-A*c__6

(7)

L := c__7*E-I*c__8

E*c__7-I*c__8

(8)

X := q__E*E+I*q__I-c__9*Q

E*q__E+I*q__I-Q*c__9

(9)

solve({L = 0, M = 0, P = 0, R = 0, U = 0, X = 0, Y = 0}, {I, A, E, Q, S, S__v, V})

{A = (a*c__8*c__9*delta+c__7*k*q__I*rho__Q+c__8*k*q__E*rho__Q)*lambda*Pi*(b__1*c__1*c__2+b__1*c__2*lambda+c__2*lambda*theta+c__2*theta*v__1+b__1*v__2+c__3*theta)/(c__6*c__9*c__5*c__8*(c__1*c__2*lambda+c__2*lambda^2+c__1*c__3+c__3*lambda-v__1*v__2)), E = lambda*Pi*(b__1*c__1*c__2+b__1*c__2*lambda+c__2*lambda*theta+c__2*theta*v__1+b__1*v__2+c__3*theta)/(c__5*(c__1*c__2*lambda+c__2*lambda^2+c__1*c__3+c__3*lambda-v__1*v__2)), I = c__7*lambda*Pi*(b__1*c__1*c__2+b__1*c__2*lambda+c__2*lambda*theta+c__2*theta*v__1+b__1*v__2+c__3*theta)/(c__5*c__8*(c__1*c__2*lambda+c__2*lambda^2+c__1*c__3+c__3*lambda-v__1*v__2)), Q = (c__7*q__I+c__8*q__E)*lambda*Pi*(b__1*c__1*c__2+b__1*c__2*lambda+c__2*lambda*theta+c__2*theta*v__1+b__1*v__2+c__3*theta)/(c__9*c__5*c__8*(c__1*c__2*lambda+c__2*lambda^2+c__1*c__3+c__3*lambda-v__1*v__2)), S = Pi*(c__2*lambda*theta+b__1*v__2+c__3*theta)/(c__1*c__2*lambda+c__2*lambda^2+c__1*c__3+c__3*lambda-v__1*v__2), S__v = Pi*(b__1*c__1+b__1*lambda+theta*v__1)/(c__1*c__2*lambda+c__2*lambda^2+c__1*c__3+c__3*lambda-v__1*v__2), V = Pi*(a*b__1*c__1*c__2*c__8*c__9*delta*lambda*rho__A+a*b__1*c__2*c__8*c__9*delta*lambda^2*rho__A+a*c__2*c__8*c__9*delta*lambda^2*rho__A*theta+a*c__2*c__8*c__9*delta*lambda*rho__A*theta*v__1+b__1*c__1*c__2*c__4*c__6*c__7*lambda*q__I*rho__Q+b__1*c__1*c__2*c__4*c__6*c__8*lambda*q__E*rho__Q+b__1*c__1*c__2*c__7*k*lambda*q__I*rho__A*rho__Q+b__1*c__1*c__2*c__8*k*lambda*q__E*rho__A*rho__Q+b__1*c__2*c__4*c__6*c__7*lambda^2*q__I*rho__Q+b__1*c__2*c__4*c__6*c__8*lambda^2*q__E*rho__Q+b__1*c__2*c__7*k*lambda^2*q__I*rho__A*rho__Q+b__1*c__2*c__8*k*lambda^2*q__E*rho__A*rho__Q+c__2*c__4*c__6*c__7*lambda^2*q__I*rho__Q*theta+c__2*c__4*c__6*c__7*lambda*q__I*rho__Q*theta*v__1+c__2*c__4*c__6*c__8*lambda^2*q__E*rho__Q*theta+c__2*c__4*c__6*c__8*lambda*q__E*rho__Q*theta*v__1+c__2*c__7*k*lambda^2*q__I*rho__A*rho__Q*theta+c__2*c__7*k*lambda*q__I*rho__A*rho__Q*theta*v__1+c__2*c__8*k*lambda^2*q__E*rho__A*rho__Q*theta+c__2*c__8*k*lambda*q__E*rho__A*rho__Q*theta*v__1+a*b__1*c__8*c__9*delta*lambda*rho__A*v__2+a*c__3*c__8*c__9*delta*lambda*rho__A*theta+b__1*c__1*c__2*c__6*c__7*c__9*lambda*rho__I+b__1*c__2*c__6*c__7*c__9*lambda^2*rho__I+b__1*c__4*c__6*c__7*lambda*q__I*rho__Q*v__2+b__1*c__4*c__6*c__8*lambda*q__E*rho__Q*v__2+b__1*c__7*k*lambda*q__I*rho__A*rho__Q*v__2+b__1*c__8*k*lambda*q__E*rho__A*rho__Q*v__2+c__2*c__6*c__7*c__9*lambda^2*rho__I*theta+c__2*c__6*c__7*c__9*lambda*rho__I*theta*v__1+c__3*c__4*c__6*c__7*lambda*q__I*rho__Q*theta+c__3*c__4*c__6*c__8*lambda*q__E*rho__Q*theta+c__3*c__7*k*lambda*q__I*rho__A*rho__Q*theta+c__3*c__8*k*lambda*q__E*rho__A*rho__Q*theta+alpha*b__1*c__1*c__5*c__6*c__8*c__9+alpha*b__1*c__5*c__6*c__8*c__9*lambda+alpha*c__5*c__6*c__8*c__9*theta*v__1+b__1*c__6*c__7*c__9*lambda*rho__I*v__2+c__3*c__6*c__7*c__9*lambda*rho__I*theta)/(c__5*c__6*c__8*c__9*µ*(c__1*c__2*lambda+c__2*lambda^2+c__1*c__3+c__3*lambda-v__1*v__2))}

(10)

``

lambda := beta*(I+`&eta;__A`*A+`&eta;__Q`*Q)/N

beta*(I+eta__A*A+eta__Q*Q)/N

(11)

``

NULL

k := .15

.15

(12)

delta := .125

.125

(13)

mu := 0.464360344e-4

0.464360344e-4

(14)

pi := .464360344

.464360344

(15)

delta__Q := 0.6847e-3

0.6847e-3

(16)

beta := .1086

.1086

(17)

q__E := 0.18113e-3

0.18113e-3

(18)

rho__Q := 0.815e-1

0.815e-1

(19)

a := .16255

.16255

(20)

v__1 := 0.5e-1

0.5e-1

(21)

v__2 := 0.5e-1

0.5e-1

(22)

alpha := 0.57e-1

0.57e-1

(23)

lambda := 0.765e-2

0.765e-2

(24)

rho__A := 0.915e-1

0.915e-1

(25)

rho__I := 0.515e-1

0.515e-1

(26)

a := .16255

.16255

(27)

q__I := 0.1923e-2

0.1923e-2

(28)

q__A := 0.4013e-7

0.4013e-7

(29)

eta__A := .1213

.1213

(30)

eta__Q := 0.3808e-2

0.3808e-2

(31)

w := .5925

.5925

(32)

Download Bifurcation_Equation.mw

 

the graf that I want to generate is like this one 

Dear experts

how can I numerically plot the following integral and have output as csv file.

in this relation, there is a list of omega1 and omega2 for each k1 and k2. for example,

k1 = [1,2,3,4,5]

omega11=[1,2,3,4,5], omega12= [1,2,3,4,5], omgega21= [1,2,3,4,5],omega22= [1,2,3,4,5],

all other coefficients would be calculated based on k values and corresponding omegas

thanks in advance

Given a pde (or a set of pdes) of multiple funcitons, is there a way to look for solutions when one of the functions is kept arbritary.

For example if I have a set of pdes with f1,f2,f3. Is there a way to see if there is a functional form for f2 and f3 such that the equation is satisfied for any f1?

It appears to me that "simplify/siderels" with two arguments is simply some special "simplify" procedure that just makes use of assumptions, but the results of experiments seem to tell an opposite story. 

simplify(sqrt(x**2), [x = 0]);
                               0

simplify(sqrt(x**2), assume = [x = 0]);
                               0

simplify(ln(exp(x)), [x = 0]);
                               0

simplify(ln(exp(x)), assume = [x = 0]);
                               x

`assuming`(simplify(ln(exp(x))), [x = 0]);
                               x

simplify((1 - cos(x)**2 + sin(x)*cos(x))/(sin(x)*cos(x) + cos(x)**2), [sin(x)**2 + cos(x)**2 = 1]);
                            2                
                  1 - cos(x)  + sin(x) cos(x)
                  ---------------------------
                   cos(x) (cos(x) + sin(x))  

simplify((1 - cos(x)**2 + sin(x)*cos(x))/(sin(x)*cos(x) + cos(x)**2), assume = [sin(x)**2 + cos(x)**2 = 1]);
                             tan(x)

How to explain these? 

Today, I trried to enter an equation into a text region using Ctrl+R (In Maple Flow 2023.1), like I have always done in previous releases of Maple Flow. Well, today it did not work. I tried to enter the equation Q=W+mCv(T2-T1). When I tried to enter the equal sign after the Q, the program would not allow me to do it. I would press the equal sign and nothing happened. I tried :=, but it would only enter the :, it would not let me enter the =. Any help will be appreciated.

(While using Maple 2015 this question concerns any other Maple versions)

I hesitated on the title to write and my first idea was to write "How to modify a built-in functions without making a mess?".
I finally changed my mind in order not to orient the answers in a wrong way.

So this question is about the construction of multi-variate distributions and concerns only the Statistics package.
Here are some of the attributes of a univariate random variable that Maple recognizes, and it is quite normal to expect that the construction of a multi-variate random variable (MVRV for short) distribution should get, at least, some of them.

X := RandomVariable(Normal(a, b)):
map(a -> printf("%a\n", a), [exports(attributes(X)[3])]):
Conditions
ParentName
Parameters
CharacteristicFunction
CDF
CGF
HodgesLehmann
Mean
Median
MGF
Mode
PDF
RousseeuwCrouxSn
StandardDeviation
Support
Variance
CDFNumeric
QuantileNumeric
RandomSample
RandomSampleSetup
RandomVariate
MaximumLikelihoodEstimate

If the distribution is continuous the PDF is fundamental in the sense it enables constructs all the other statistics (=attributes) of a MVRV.
But it is nice to use integrated functions, such as Mean, Support, PDF, and so on, to get the expressions or values of these statistics instead of computing them from this PDF.
Let's that I prefer doing this

MyNormal := proc(m, v)
  description "Reparameterized Normal randomvariable, m=mean, v=variance":
  Distribution(
    PDF = (t -> exp(-1/2*(x-m)^2/v)/sqrt(2*Pi*v))
    , Conditions = [Sigma > 0]
    , Mean =m
  )
end proc:

X := RandomVariable(MyNormal(mu, Sigma)):
Mean(X)
                              m

than doing this

MyNormal := proc(m, v)
  description "Reparameterized Normal randomvariable, m=mean, v=variance":
  Distribution(
    PDF = (t -> exp(-1/2*(x-m)^2/v)/sqrt(2*Pi*v))
    , Conditions = [Sigma > 0]
  )
end proc:

X := RandomVariable(MyNormal(mu, Sigma)):
Mean(X);  # of course undefined
mean := int(PDF(X, x), x=-infinity..+infinity) assuming Sigma > 0
                           undefined
                           mean := 1

So, while all the statistics can be recover from the CDF (provided it exists), it's nicer to define these statistics within the Distribution structure (as in the first construction above).

Now some problems appear when you want to construct the Distribution structure for a MVRV.
The attached file contains the construction of MVRV whose ecah components are mutually independent (to keep the things simple) and both have a Unifom distribution.

MV_Uniform.mw

Here are some observations:

  • Defining a multi-variate PDF goes without problems.
  • Defining the Mean (or many other algebraic or numeric statistics) presents a difficulty related to the type of the arguments the build-in function Mean is aimed to recieve.
    But a workaround, not very elegant, can be found.
  • The case of the Support seems unsolvable: I wasn't able to find any workaround to define the support of a MVRV.
  • I did not consider the Conditions attribute, but I'm not sure that, in the case of, let's say, a bi-gaussian random variable I would be capable to set that the variance is a symmetric positive-definite matrix?

I feel like the main restriction to define such MVRV distributions is the types used in the buid-in functions used in the Distribution structure.

Does anyone have an idea to tackle this problem?

  • Are we doomed to use workarounds like the one I used for defining the MVRV mean?
  • Can we modify the calling sequence of some build-in functions without making a mess and keep them working on build-in distributions?
  • Must we overload the construction of these build-in functions?
    Doing for instance:
    restart:
    with(Statistics):
    local Mean:
    Mean := proc(...) ... end proc

Thanks in advance for any suggestion and help.

 For the command LieAlgebras[RootSpaceDecomposition] I don't understand what the command return, I read the help and see the examples but still not understanding.

 

for example it returns:

RSD := RootSpaceDecomposition(CSA);

RSD := table([[-2, -1] = E31, [2, 1] = E13, [1, 2] = E23, [1, -1] = E12, [-1, 1] = E21, [-1, -2] = E32])

I don't understand what means [-2, -1] even they said that is the root but I know that a root is in h* so it must be only a number not a vector.

Hi,

I am trying to convert from MapleSim to Simulink Matlab by using the S-function code Generation connector, but I got the above message when I uploaded the selected subsystem and I have no idea how can I fix it. Please help.

3 4 5 6 7 8 9 Last Page 5 of 323