17852 Reputation

24 Badges

13 years, 190 days

MaplePrimes Activity

These are replies submitted by Kitonum

@Markiyan Hirnyk  In my answer I did not use this function, so I did not look at Maple for help on it and immediately looked at the wiki.

@Markiyan Hirnyk  Quotation from the wiki:

"In probability theory and statistics, the geometric distribution is either of two discrete probability distributions:

  • The probability distribution of the number X of Bernoulli trials needed to get one success, supported on the set { 1, 2, 3, ...}
  • The probability distribution of the number Y = X − 1 of failures before the first success, supported on the set { 0, 1, 2, 3, ... }"      You did not specify what kind of case is meant. I took the first as the more common .

@escorpsy I think that it is impossible to obtain analytically explicit dependences of roots on parameters, but it is possible to investigate how the roots change when individual parameters change. This can be done, for example, using  Explore  command. See update to my answer.

@mahmood1800  Sorry for my inattention. I corrected the definitions of  b[n,m]  in the body of  HybrFunc  procedure. Code1_new  file is replaced by  Code1_new1  (see my answer).



g:=(x,k)->Int(exp(k*cos(z)), z = 0 .. x):
f:=(y,k)->fsolve(y=g(x,k), x=0..infinity): 
# The inverse to g  
h:=(u,v,k1,k2)->evalf(Int(exp(sin('f'(x,k1))*sin('f'(y,k2))), [x = 0..u, y = 0..v]));


The examples of use:


@Annonymouse   Use  seq  command to write this shorter:

S1 := convert~(S, list): 
S2 := rhs~(Array(S1));
m, n := op(S2)[1 .. 2]; 
Res:=seq(AllNonZero(S2[i]), i = m);

We see that  true  are on the 9th, 10th and 13th places. These 3 numbers we can return programmatically as follows (continuation of the previous code):

ListTools:-SearchAll(true, [Res]);
9, 10, 13



@kivan  The reason is that your integral is not expressed in terms of known functions, so it can only be calculated numerically. Therefore, the inverse function can not be expressed symbolically, but can only be calculated numerically using  fsolve  command:

g:=x->Int(exp(cos(z)), z = 0 .. x): 
h:=y->fsolve(y=g(x), x=0..infinity):   

Example of use:

plot([g,h], 0..10, 0..10, color=[red,blue], scaling=constrained);  # Visualization




@toandhsp  You can do it according to the same scheme. The only significant difference is that Maple does not solve the equation  x^2+y^2+z^2=r^2  in integers and you have to do it yourself, for example using nested for loops.

@mbras  I still do not understand what you are going to do with the list  z:=[[1,2],[3,4],[5,6]] . Write simply by words without any codes. 


1. Read here about the history of Maple.

2. Many problems can be solved in Maple different ways. Write more in what your problem is. Perhaps it can be solved in a different way without  PolyhedralSets  package.

@Jawadqau What are stream tubes?  Curves in the space? In this case, the last line of code should be:

plots:-odeplot(sol, [-1/2*diff(h(eta),eta), h(eta), g(eta)], 0..N, color=red, thickness=3, scaling=constrained, labels=[f,h,g]);

plots:-tubeplot([s->eval(-1/2*diff(h(eta),eta),sol(s)),s->eval( h(eta),sol(s)),s->eval(g(eta),sol(s))], 0..N, radius=0.05, color=red, scaling=constrained, lightmodel=light4);  # Or a tubeplot  


From the first equation we obtain

f(eta) = -2*diff(h(eta),eta)

that is for  eta=0  we have  f(0) = -2*D(h)(0)  but it contradicts your  bc



@minhhieuh2003  It's not an error. By default, Maple works with an extended numeric line when solving inequalities;  infinity  and  -infinity  can participate in arithmetic operations and in comparisons with ordinary numbers. See

is(eval(x*(x-3)+2, x=infinity)>0);


@ssara  In your code, instead  _local(cos);  should be  local cos;  and instead  B := op([1, 2], A)*(-cos(theta)+1)+op(2, A);  should be  B:=op([1,2], A)*(1-cos(theta))+op(2, A):  . Just copy the whole code from my answer into your worksheet and check that the codes exactly match. 
Tell me what version of Maple you use and upload here a link to your worksheet using the bold green arrow (the worksheet should be saved before that) if my code does not work again.

First 39 40 41 42 43 44 45 Last Page 41 of 121