Maple 18 Questions and Posts

These are Posts and Questions associated with the product, Maple 18

Dear all

I have data and a vector d. 
I would like to sum the elements of the vector d corresponding to the index  of the element data <=0.01 

Step 1: we select the index of data that corresponds to data<=0.01

step 2: we select the consecutive index corresponding to data<=0.01

Step 3 : we sum the element of d corresponding to the previous index

step 4: update d=d/number(index) ;

Please see my attached code. It's done by hand how can reformulate the code.

 

 

code_vector.mw

many thanks

 

I keep getting errors empty sets or only header information using the HTTP or URL package to when trying to download files from here through Maple. 

How do I download the csv files from here?
https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series

 

How do I know that what numerical method has maple used in this code.?

dsolve({eq11,eq21,eq3,eq4,bc21,bc22},numeric,continuation=lambda1,maxmesh=15000, output=array([seq( i, i=0..N,0.01 )]))

 

     Dear Sir/Madam,

I have faced a problem while using Maple 18. The  warning is the following

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)

This is the code

restart;
with(plots);
beta := 0.2e-1; delta := .5; PI := 10000; mu := 0.16e-1; tau := 0.3e-1; rho := 0.4e-1; epsilon := 0.4e-1; sigma[1] := 0.1e-2; sigma[2] := 0.2e-2; eta := 0.6e-1;
sys := {diff(e(t), t) = beta*(sigma[1]*i(t)+sigma[2]*e(t))*s(t)-(delta+mu)*e(t), diff(i(t), t) = tau*delta*e(t)-(epsilon+rho+mu)*i*t, diff(r(t), t) = (1-tau)*delta*e(t)+epsilon*i(t)-(mu+eta)*r(t), diff(s(t), t) = PI+eta*r(t)-beta*(sigma[1]*i(t)+sigma[2]*e(t))*s(t)-mu*s(t), e(0) = 148, i(0) = 74, r(0) = 14, s(0) = 4110};
p1 := dsolve(sys, numeric, method = rkf45, output = procedurelist);
Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)
Error, (in dsolve/numeric) i(t) and i cannot both appear in the given ODE
p2o := odeplot(p1, [t, s(t)], 0 .. 4, numpoints = 100, labels = ["Time (months)", " Infected  "], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed);
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

plots[display](p2o);

 

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/nnn.mw .

Download nnn.mw

If we have an equation for the generalized Bloch sphere i.e.,

\partial_{t}(u^{2} + v^{2} + w^{2}) = 0,

where u, v and w are functions of x and t and the initial conditions u=v=0, w=-1. Then how to plot this equation on maple?

Dear all

I applied the definition of a permutation matrix to a given matrix A to obtain a Tridiagonal Toeplitz matrix, but I haven't any idea why the final result looks strange.

Permutation_matrix.mw

 

 

Many thanks

 

 

Dear all

Using maple I can't obtain an exact solution, my goal for which initial condition can the solution diverge to infinity if maple can not give us a solution.

special_condition_diverge.mw

many thanks

 

Dear all

I would like to compute a Laurent of a given function at an isolated point.

laurent_series.mw

thanks for your help

Dear all

I would like to solve a linear system A X=b whee A is a matrix n times n

If A is a tri-diagonal matrix, how can we write simple code to make A upper-triangular and then we solve the system using backward substitution

many thanks

 

I am trying to simplify an expression, and leave W in terms of other variables. But unfortunately I can't delete the RootOf, and I can't see the expressions. Could you please help me.

 

 

Dear all

I have an optimization problem. I would like to add a condition to obtain only a positive integer as the solution to the problem 

 

 

Positive_integer.mw

 

thanks


 

with(LinearAlgebra); S[p] := 34.722406639004; alpha[1] := 0.2e-3; mu := 0.2041e-1; tau := .33; beta := .5; eta[1] := 0.96e-1; alpha[2] := .2; sigma := .9; e[o] := .33; delta := .2115; eta[2] := 0.2485e-2; A := Matrix(6, 6, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = alpha[1]*S[p], (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = beta, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0}); B := Matrix(6, 6, {(1, 1) = mu, (1, 2) = tau, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = e[o], (2, 1) = 0, (2, 2) = tau+mu, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = beta+eta[1]+sigma+mu, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = (1-delta)*alpha[2]-mu, (4, 5) = 0, (4, 6) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = alpha[2]*delta, (5, 5) = mu+eta[2], (5, 6) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = mu+e[o]}); 1/B; VectorMatrixMultiply(A, 1/B)

S[p] := 34.722406639004

 

alpha[1] := 0.2e-3

 

mu := 0.2041e-1

 

tau := .33

 

beta := .5

 

eta[1] := 0.96e-1

 

alpha[2] := .2

 

sigma := .9

 

e[o] := .33

 

delta := .2115

 

eta[2] := 0.2485e-2

 

A := Matrix(6, 6, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0.6944481328e-2, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = .5, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0})

 

B := Matrix(6, 6, {(1, 1) = 0.2041e-1, (1, 2) = .33, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = .33, (2, 1) = 0, (2, 2) = .35041, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1.51641, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = .13729, (4, 5) = 0, (4, 6) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0.4230e-1, (5, 5) = 0.22895e-1, (5, 6) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = .35041})

 

Matrix(6, 6, {(1, 1) = 48.9955903968643, (1, 2) = -46.1417905623847, (1, 3) = 0., (1, 4) = 0., (1, 5) = 0., (1, 6) = -46.1417905623847, (2, 1) = 0., (2, 2) = 2.85379983447961, (2, 3) = 0., (2, 4) = 0., (2, 5) = 0., (2, 6) = -0., (3, 1) = 0., (3, 2) = 0., (3, 3) = .659452258953713, (3, 4) = 0., (3, 5) = 0., (3, 6) = -0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 7.28385170077937, (4, 5) = 0., (4, 6) = -0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = -13.4573892528049, (5, 5) = 43.6776588774842, (5, 6) = -0., (6, 1) = 0., (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = 2.85379983447961})

 

Matrix(6, 6, {(1, 1) = 0., (1, 2) = 0., (1, 3) = 0., (1, 4) = 0., (1, 5) = 0., (1, 6) = -0., (2, 1) = 0., (2, 2) = 0., (2, 3) = 0., (2, 4) = 0., (2, 5) = 0., (2, 6) = -0., (3, 1) = 0., (3, 2) = 0., (3, 3) = 0.457955389901148e-2, (3, 4) = 0., (3, 5) = 0., (3, 6) = -0., (4, 1) = 0., (4, 2) = 0., (4, 3) = .329726129476857, (4, 4) = 0., (4, 5) = 0., (4, 6) = -0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 0., (5, 6) = -0., (6, 1) = 0., (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = -0.})

(1)

LinearAlgebra:-Eigenvalues( (1) );

Vector(6, {(1) = 0.+0.*I, (2) = 0.+0.*I, (3) = 0.+0.*I, (4) = 0.457955389901148e-2+0.*I, (5) = 0.+0.*I, (6) = -0.+0.*I})

(2)


 

Download AB.mw

Dear all

I hope to find the maximum of a given function or show that the maximum is negative.

 

negative_maximum.mw

 

many thanks for your help

Since maple doesn't have mp3 support, the best we can do is just convert to a supported file type and go from there.  We can actually use maple's system command to work within maple to accomplish this and other tasks.  Actually someone using Matlab created an FFmpeg tool package - something similar could also be done with Maple.

So first you need to load the free open source FFmpeg software into your machine.  I'm using windows so Unzip into a folder then into right click on mycomputer go into properties advanced and add a new environment variable.

However I'm having a problem using the ssystem command.  The system command actually works fine, so I don't know if it's an issue with my format of the command or maybe it's a bug within the Maple 18 that I'm currently working in (perhaps it works on the newer versions) so here's the script

system("ffmpeg -i c:/test/test.mp3") #works fine outputed in a new window displays info about specified file

ssystem("ffmpeg -i c:/test/test.mp3") #maple is busy sitting executing with nothing happening

However this works,

ssystem("ffmpeg -version") #does output into Maple just information of the ffmpeg software version

so I suspect something to do with the file formatting??  Any ideas why ssystem doesn't output into maple using a file location?

 

First 18 19 20 21 22 23 24 Last Page 20 of 86