MaplePrimes Questions

I am trying to solve the Schrodinger equation:

-y''(x) = (E-V(x))*y(x),

where the potential V(x) is not known in quadratures. The potential V(x) comes from numerical solution of ODE, and is known only a discrete set of points and given by the vector [V(x_1), V_(x_2), ...], and has the following plot:

So, the question is: what is the best way to solve this problem? (apart from the obvious choice to fit the data and solve the equation with the fitted potential)

How can I produce a graph with various values for parameters? I also attached a sample of my Maple code.

restart

with(plots);
with(plottools);
with(DEtools);

eqn1 := diff(V(t), t) = pi*p - (alpha + mu)*V(t), V(0) = ic1

eqn2 := diff(S(t), t) = alpha*V(t) + (1 - p)*pi - beta*S(t)*In(t)/N - mu*S(t), S(0) = ic2

eqn3 := diff(In(t), t) = beta*S(t)*In(t)/N - (mu + delta + gamma)*In(t), In(0) = ic3

eqn4 := diff(R(t), t) = gamma*In(t) - mu*R(t), R(0) = ic4

pi := 487845;
p := 0.948;
alpha := 0.054;
beta := 0.955;
mu := 0.005;
delta := 0.03;
localgamma := 0.935;
ic1 := 484465;
ic2 := 31999760;
ic3 := 26305;
ics4 := 12470;
dsol := dsolve([eqn1, eqn2, eqn3, eqn4], numeric);

odeplot(dsol, [[t, V(t), color = plum], [t, S(t), color = blue], [t, In(t), color = cyan], [t, R(t), color = green]], t = 0 .. 1000, view = [0 .. 1000, 0 .. 300000000], thickness = 3)
 

Let's say I want to produce a graph for eqn1 with various values of parameter p: p = 0.2, p = 0.5, p = 0.7, p = 0.8. How should I produce it?

I am trying to see the closed form solution to the following equation where the know constants are phi1, a, and b:

Z := phi__1 = arctan(a*sin(alpha__1)/(a*cos(alpha__1) - b))

I am attempting to use the "solve" command as follows:

(solve(Z, alpha__1, useassumptions) assuming (0 < a and 0 < b))

 and I definitely do not understand what Maple is producing.

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

Hello Maple users,

I have the following metric:

In the calculation of the different tensors, I encounter the derivative of "v" w.r.t. "t" and "v" w.r.t. "r". Can I use the compactdisplay command so that the first derivative is with a dot over "v" and a prime beside it for the second derivative for r (or other symbols, as long as it simplifies the output.

Here is my General_metric.mw:

Thank you in advance for your troubles.

Mario

How can I make a function from the results of equation (4) in the below image from the attached file? As seen in equation (6) my attempt at doing this didn't work because it didn't evaluate to a number like equation (7) did.

I saw posts on using numeric results from solve, but I don't see how to use the equation results to make a function of x.

using_solved_equations.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;

I see that using units with the maximize() function causes the connection to the kernel to be lost and then Maple (v2018) must be restarted for things to work properly.  This is obviously not desired behavior - is there any known workaround for this issue? (other than forgoing the use of units?).  Attached is a simple worksheet that illustrates this problem.  It has one part without units that works properly and one part with units that causes the error:  Units_Lose_Kernel.mw

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

I want to generate bivaraite zero-inflated descrite random numbers from this distribution defined below

### Generating Random Numbers from MBZIPR`  

restart:      

with(Statistics):  

randomize():  

N    := 100;

`x__01` := Vector[row](P, [1$N]);  

`x__11` := Sample(Binomial(N, 0.4), N);  

`x__22` := Sample(Normal(0, 1), N);  

`z__02` := Vector[row](P, [1$N]);  

`z__12` := Sample(Binomial(N, 0.4), N);  

`z__22` := Sample(Normal(0, 1), N);  

phi__1:= (1)/((1+exp(-(gamma__01 *`z__01` +gamma__11*`z__11` + gamma__21*`z__21`)))):      

phi__2:=(1)/((1+exp(-(gamma__02 *`z__02` +gamma__12*`z__12` + gamma__22*`z__22`)))):    

lambda__1:=exp(beta__01 *`x__01` +beta__11*`x__11` + beta__21*`x__21`)*(1+exp(gamma__01 *`z__01` +gamma__11*`z__11` + gamma__21*`z__21`)):    

lambda__2:=exp(beta__02 *`x__02` +beta__12*`x__12` + beta__22*`x__22`)*(1+exp(gamma__02 *`z__02` +gamma__12*`z__12` + gamma__22*`z__22`)):    

B:= (y[1],  y[2])->([[phi +(1-phi)*((e)^(-lambda[1]- lambda[2])*(1+ alpha*(1-(e)^(-(1-(e)^(-1))*lambda[1]))*(1-(e)^(-(1-(e)^(-1))*lambda[2])))),],[(1-phi)*((e)^(-lambda[1]- lambda[2])*((lambda[1])^(y[1]) *  (lambda[2])^(y[2]))/(y[1]!* y[2]!)*((1+ alpha)*((e)^(-y[1])-(e)^(-(1-(e)^(-1))*lambda[1]))*((e)^(-y[2])-(e)^(-(1-(e)^(-1))*lambda[2])))),]]):  

B1:= Statistics:-Distribution(  Type= discrete,        ProbabilityFunction= B,        Support= 0..infinity,        DiscreteValueMap= (n-> n)  

):  (beta__01,beta__11,beta__21,beta__02,beta__12,beta__22,gamma__01,gamma__11,gamma__21,gamma__02,gamma__12,gamma__22,phi,alpha):= (0.2,  -2,  0.25,  0.15,  -2.5,  0.2, 0.1,  2,  -2.5,  0.3,  1.3,  2.5,  0.5, -2) :  M:= Matrix((100, 25), datatype= float[8]);  S:=Statistics:-Sample(B1, M, method= [discrete, range= 0..100]); 

 

Recently, Maple takes quite long to start here, and I wonder if there are any hints about how to speed up.

Maple itself starts quickly, but opening the start page takes quite long.

Antivirus? Other settings?

Do you have any idea why the graph of function f (see the attached file) is not displayed?
How can I plot it without using the 

plot([seq([t, f], t in [seq](0.9..1.12, 0.002))]);

command ?

Thanks in advance.

restart:

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

f := 4.185692792*10^2172*t^2499*exp(-5000.000000*sqrt(t));

# Here is a plot of f

plot([seq([t, f], t in [seq](0.9..1.12, 0.002))]);

0.4185692792e2173*t^2499*exp(-5000.000000*t^(1/2))

 

 

# How can I plot f using simply:

plot(f, t=0.9..1.12);  #no graph

 

# As numelems([seq](0.9..1.12, 0.002)) = 111, I assume
# that forcing numpoints to a number that at least equal
# to this one could give a non null display?

plot(f, t=0.9..1.12, numpoints=1000):  #no graph

# adaptive=true option doesn't help

plot(f, t=0.9..1.12, adaptive=true):  #no graph

# Last attempt by forcing a list of points where f has to be evaluated.

plot(f, t=0.9..1.12, sample=[seq](0.9..1.12, 0.002))

 

 

Download NoPlot.mw

I am using temperature units with thermophysical data and scientific constants but am getting inconsistent behavior when using these.  In some cases (e.g., when calling thermophysical data), it seems that it's best to use a Temperature object.  However I have tried to use scientific constants in calculations and it seems that temperature expressions work best (i.e., when using degrees K rather than deg F or deg C).  Simplifying/combining units don't seem to work when using a Temperature object (or when using expressions with deg F).  It may be something simple I am overlooking but I can't figure out the pattern of behavior yet.  I've attached a file that demonstrates the issue:  Temperature_Object_Use.mw

Thanks for any insight here.

 

the graf that I want to generate is like this one 

I am trying to plot the following function in maple but the graph will not render. No problem plotting it on a TI-84 Plus CE where the output looks like a parabola. What am I missing?

polarplot(tan(theta)*sec(theta), theta = 0 .. 2*Pi)

First 178 179 180 181 182 183 184 Last Page 180 of 2421