MaplePrimes Questions

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)

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

I am trying to solve the equation: 
solve(cos(3*x - Pi/12) = cos(2*x + Pi/7), x, allsolutions).
It is difficult for me to get the resullt. 
Solve by my hand. I tried
restart;
a := 3*x - Pi/12;
b := 2*x + Pi/7;
S1 := solve(a = 2*Pi*k + b, x);
S2 := solve(a = 2*Pi*k - b, x);
S := ((S1 union S2) assuming k::integer);

I get the answer

Can I get the result by command 
solve(cos(3*x - Pi/12) = cos(2*x + Pi/7), x, allsolutions).

How to get U1,U2,..I dont know how to use this inverse transform.Please help to find the series.

CM.mw

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?

Earlier today I observed this:



What would be the reason?

I am creating a Maple document mode worksheet in which I use the Units package. I was doing a calculation and I noticed a discrepancy when I repeated the calculation slightly more manually (but still expecting the same result). 

Here is a link to the worksheet: Units.mw

(Unfortunately, it is hit or miss for me when I try to use the option to show the contents of the worksheet here directly)

Here is a screenshot of the issue

All I am doing in the second calculation is doing some of the unit conversions myself. 

I came across this while solving a chemistry problem, and I know the answer in the book agrees with the second calculation. 

So the question is why doesn't the first calculation, which uses more of Maple's library to do the calculation, agree with the second calculation?

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? 

Why can't a singular call fully simplify them? 
 

restart;

(* in △ABC *)

tp1 := [cot((1/2)*A)/(cot(A)+cot((1/2)*A))-cos((1/2)*B)*cos((1/2)*C), ((sin(B)+sin(C))*cos((1/2)*A)+4*sin((1/2)*A)*cos((1/2)*B)*cos((1/2)*C))*(1-sin((1/2)*A)/(cos((1/2)*B)^2+cos((1/2)*C)^2))-(sin(B)+sin(C))*sec((1/2)*A), (1+cos(2*A))/(1+cos(A))+(1+cos(2*B))/(1+cos(B))+(1+cos(2*C))/(1+cos(C))]

tp2 := [sin((B-C)*(1/4))^2+sin((1/2)*A)*(2-csc((1/2)*A))^2/(4*tan((Pi-A)*(1/4))*(cot(A)+cot((1/2)*A))), 16*sin((1/2)*A)^2*sin((B+C)*(1/4))^2*sin((B-C)*(1/4))^4/(cos((1/2)*B)^2+cos((1/2)*C)^2), 1+(tan((1/2)*B)*sin(C)-tan((1/2)*C)*sin(B))^2+(tan((1/2)*B)*cos(C)+tan((1/2)*C)*cos(B)-tan((1/2)*A))^2]

simplify(`~`[`-`](tp1, tp2), {A+B+C = Pi}, 'mindeg', assume = positive)simplify(%)

[(1/4)*(-4*cot((1/4)*Pi+(1/4)*A)*(cot(A)+cot((1/2)*A))*cos((1/4)*Pi+(1/4)*A+(1/2)*B)^2+(-4*cos((1/2)*B)*(cot(A)+cot((1/2)*A))*sin((1/2)*A+(1/2)*B)+4*cot((1/2)*A))*cot((1/4)*Pi+(1/4)*A)-sin((1/2)*A)*(csc((1/2)*A)-2)^2)/(cot((1/4)*Pi+(1/4)*A)*(cot(A)+cot((1/2)*A))), (-16*sin((1/2)*A)^2*cos((1/4)*Pi+(1/4)*A)^2*cos((1/4)*Pi+(1/4)*A+(1/2)*B)^4+4*sin((1/2)*A)*cos((1/2)*B)*sin((1/2)*A+(1/2)*B)^3+(cos((1/2)*A)-sec((1/2)*A))*(sin(B)+sin(A+B))*sin((1/2)*A+(1/2)*B)^2+(4*cos((1/2)*B)^3*sin((1/2)*A)-4*sin((1/2)*A)^2*cos((1/2)*B))*sin((1/2)*A+(1/2)*B)+((cos((1/2)*A)-sec((1/2)*A))*cos((1/2)*B)^2-cos((1/2)*A)*sin((1/2)*A))*(sin(B)+sin(A+B)))/(cos((1/2)*B)^2+sin((1/2)*A+(1/2)*B)^2), (-(1+cos(B))*(cos(B)^2+sin(B)^2)*(cos(A+B)-1)*(1+cos(A))*cot((1/2)*A+(1/2)*B)^2+2*(1+cos(B))*((sin(A+B)*sin(B)+cos(B)*cos(A+B))*tan((1/2)*B)+tan((1/2)*A)*cos(B))*(cos(A+B)-1)*(1+cos(A))*cot((1/2)*A+(1/2)*B)-(1+cos(B))*(1+cos(A))*cos(2*A+2*B)-(cos(A+B)-1)*(sin(A+B)^2+cos(A+B)^2)*(1+cos(B))*(1+cos(A))*tan((1/2)*B)^2-2*tan((1/2)*A)*cos(A+B)*(cos(A+B)-1)*(1+cos(B))*(1+cos(A))*tan((1/2)*B)-(cos(A+B)-1)*(1+cos(B))*(1+cos(A))*tan((1/2)*A)^2+((1+cos(B))*cos(2*A)+(1+cos(A))*cos(2*B)-cos(A)*cos(B)+1)*cos(A+B)+(-cos(B)-1)*cos(2*A)+(-cos(A)-1)*cos(2*B)-cos(A)-cos(B)-2)/((cos(A+B)-1)*(1+cos(B))*(1+cos(A)))]

 

[0, 0, 0]

(1)

simplify(`~`[`-`](tp1, tp2), {B+C = Pi-A}, 'mindeg', assume = positive)simplify(%)

[(1/4)*(-4*cot((1/4)*Pi+(1/4)*A)*(cot(A)+cot((1/2)*A))*cos((1/4)*Pi+(1/4)*A+(1/2)*B)^2+(-4*cos((1/2)*B)*(cot(A)+cot((1/2)*A))*sin((1/2)*A+(1/2)*B)+4*cot((1/2)*A))*cot((1/4)*Pi+(1/4)*A)-sin((1/2)*A)*(csc((1/2)*A)-2)^2)/(cot((1/4)*Pi+(1/4)*A)*(cot(A)+cot((1/2)*A))), (-16*sin((1/2)*A)^2*cos((1/4)*Pi+(1/4)*A)^2*cos((1/4)*Pi+(1/4)*A+(1/2)*B)^4+4*sin((1/2)*A)*cos((1/2)*B)*sin((1/2)*A+(1/2)*B)^3+(cos((1/2)*A)-sec((1/2)*A))*(sin(B)+sin(A+B))*sin((1/2)*A+(1/2)*B)^2+(4*cos((1/2)*B)^3*sin((1/2)*A)-4*sin((1/2)*A)^2*cos((1/2)*B))*sin((1/2)*A+(1/2)*B)+((cos((1/2)*A)-sec((1/2)*A))*cos((1/2)*B)^2-cos((1/2)*A)*sin((1/2)*A))*(sin(B)+sin(A+B)))/(cos((1/2)*B)^2+sin((1/2)*A+(1/2)*B)^2), (-(1+cos(B))*(cos(B)^2+sin(B)^2)*(cos(A+B)-1)*(1+cos(A))*cot((1/2)*A+(1/2)*B)^2+2*(1+cos(B))*((sin(A+B)*sin(B)+cos(B)*cos(A+B))*tan((1/2)*B)+tan((1/2)*A)*cos(B))*(cos(A+B)-1)*(1+cos(A))*cot((1/2)*A+(1/2)*B)-(1+cos(B))*(1+cos(A))*cos(2*A+2*B)-(cos(A+B)-1)*(sin(A+B)^2+cos(A+B)^2)*(1+cos(B))*(1+cos(A))*tan((1/2)*B)^2-2*tan((1/2)*A)*cos(A+B)*(cos(A+B)-1)*(1+cos(B))*(1+cos(A))*tan((1/2)*B)-(cos(A+B)-1)*(1+cos(B))*(1+cos(A))*tan((1/2)*A)^2+((1+cos(B))*cos(2*A)+(1+cos(A))*cos(2*B)-cos(A)*cos(B)+1)*cos(A+B)+(-cos(B)-1)*cos(2*A)+(-cos(A)-1)*cos(2*B)-cos(A)-cos(B)-2)/((cos(A+B)-1)*(1+cos(B))*(1+cos(A)))]

 

[0, 0, 0]

(2)

simplify(`~`[`-`](tp1, tp2), {A = Pi-B-C}, 'mindeg', assume = positive)simplify(%)

[(1/4)*(-4*cot((1/4)*Pi+(1/4)*A)*(cot(A)+cot((1/2)*A))*cos((1/4)*Pi+(1/4)*A+(1/2)*B)^2+(-4*cos((1/2)*B)*(cot(A)+cot((1/2)*A))*sin((1/2)*A+(1/2)*B)+4*cot((1/2)*A))*cot((1/4)*Pi+(1/4)*A)-sin((1/2)*A)*(csc((1/2)*A)-2)^2)/(cot((1/4)*Pi+(1/4)*A)*(cot(A)+cot((1/2)*A))), (-16*sin((1/2)*A)^2*cos((1/4)*Pi+(1/4)*A)^2*cos((1/4)*Pi+(1/4)*A+(1/2)*B)^4+4*sin((1/2)*A)*cos((1/2)*B)*sin((1/2)*A+(1/2)*B)^3+(cos((1/2)*A)-sec((1/2)*A))*(sin(B)+sin(A+B))*sin((1/2)*A+(1/2)*B)^2+(4*cos((1/2)*B)^3*sin((1/2)*A)-4*sin((1/2)*A)^2*cos((1/2)*B))*sin((1/2)*A+(1/2)*B)+((cos((1/2)*A)-sec((1/2)*A))*cos((1/2)*B)^2-cos((1/2)*A)*sin((1/2)*A))*(sin(B)+sin(A+B)))/(cos((1/2)*B)^2+sin((1/2)*A+(1/2)*B)^2), (-(1+cos(B))*(cos(B)^2+sin(B)^2)*(cos(A+B)-1)*(1+cos(A))*cot((1/2)*A+(1/2)*B)^2+2*(1+cos(B))*((sin(A+B)*sin(B)+cos(B)*cos(A+B))*tan((1/2)*B)+tan((1/2)*A)*cos(B))*(cos(A+B)-1)*(1+cos(A))*cot((1/2)*A+(1/2)*B)-(1+cos(B))*(1+cos(A))*cos(2*A+2*B)-(cos(A+B)-1)*(sin(A+B)^2+cos(A+B)^2)*(1+cos(B))*(1+cos(A))*tan((1/2)*B)^2-2*tan((1/2)*A)*cos(A+B)*(cos(A+B)-1)*(1+cos(B))*(1+cos(A))*tan((1/2)*B)-(cos(A+B)-1)*(1+cos(B))*(1+cos(A))*tan((1/2)*A)^2+((1+cos(B))*cos(2*A)+(1+cos(A))*cos(2*B)-cos(A)*cos(B)+1)*cos(A+B)+(-cos(B)-1)*cos(2*A)+(-cos(A)-1)*cos(2*B)-cos(A)-cos(B)-2)/((cos(A+B)-1)*(1+cos(B))*(1+cos(A)))]

 

[0, 0, 0]

(3)


 

Download trigReduce.mw

Is there any limitation of `simplify/trig`?

 

restart; interface(version)

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

(1)

y(L) = (EllipticK((1/2)*sqrt(2*sin(`ϕ__0`)+2))-EllipticF(1/sqrt(sin(`ϕ__0`)+1), (1/2)*sqrt(2)*sqrt(sin(`ϕ__0`)+1))-2*EllipticE((1/2)*sqrt(2)*sqrt(sin(`ϕ__0`)+1))+2*EllipticE(1/sqrt(sin(`ϕ__0`)+1), (1/2)*sqrt(2)*sqrt(sin(`ϕ__0`)+1)))/sqrt(C)

y(L) = (EllipticK((1/2)*(2*sin(varphi__0)+2)^(1/2))-EllipticF(1/(sin(varphi__0)+1)^(1/2), (1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2))-2*EllipticE((1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2))+2*EllipticE(1/(sin(varphi__0)+1)^(1/2), (1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2)))/C^(1/2)

(2)

Typesetting:-EnableTypesetRule({"EllipticE", "EllipticF", "EllipticK"})

{}

(3)

y(L) = (EllipticK((1/2)*(2*sin(varphi__0)+2)^(1/2))-EllipticF(1/(sin(varphi__0)+1)^(1/2), (1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2))-2*EllipticE((1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2))+2*EllipticE(1/(sin(varphi__0)+1)^(1/2), (1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2)))/C^(1/2)

y(L) = (EllipticK((1/2)*(2*sin(varphi__0)+2)^(1/2))-EllipticF(1/(sin(varphi__0)+1)^(1/2), (1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2))-2*EllipticE((1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2))+2*EllipticE(1/(sin(varphi__0)+1)^(1/2), (1/2)*2^(1/2)*(sin(varphi__0)+1)^(1/2)))/C^(1/2)

(4)

NULL

Download Typesetrule.mw

First 65 66 67 68 69 70 71 Last Page 67 of 2308