Kitonum

21435 Reputation

26 Badges

17 years, 28 days

MaplePrimes Activity


These are replies submitted by Kitonum

@vv  

J(5, 1);
   Error, (in J) invalid input: J expects its 1st argument, n, to be of type posint, but received 0


 

 

In fact, your link contains a solution that works perfectly. You do not have to add "1" yet. Perhaps you are confused by the example (in the link) for  n=5  and  k=3 . But in this example, the numbering of people starts with 1, not with 0. I did not understand the logic of your code and why do you consider it to be improved.

Josephus:=proc(n,k)
if n = 1 then return 0 else
Josephus(n-1, k)+k mod n fi;
end proc:

 

Example of use:

Josephus(5, 3);

                                            3
 

@Markiyan Hirnyk   If you give a result that depends on the parameters, then the parameter values should be specified when this result is correct. Otherwise, what is the value of this result?

@Markiyan Hirnyk   Obviously, any generic answer must be true for particular cases. And more

restart;
S:=sum(k*sin(k*x)/(k^2+p^2+k), k = 1 .. infinity, parametric) assuming real:
evalf(eval(S, x=0));

             Error, (in Zeta) numeric exception: division by zero

 

@Markiyan Hirnyk 

S:=sum(k*sin(k*x)/(k^2+p^2+k), k = 1 .. infinity, parametric) assuming real:
evalf(eval(S,[p=0,x=1]));

              Error, (in LerchPhi) numeric exception: division by zero
 

@Matt C Anderson  NumberTheory package appeared only in Maple 2016. In Maple 17, you should use  numtheory  package. Here are the versions of these two procedures for Maple 17. For convenience, I also inserted the text of  Partition  procedure (combinat:-partition  package can not replace it). See the file below.

GWC.mw

@Markiyan Hirnyk   I just replaced  Pi/4  by  Pi/7 :

Student[Calculus1]:-Roots((10*cos((6*(1/10))*t)-10*cos((3/10)*t+(1/7)*Pi))^2+(10*sin((6*(1/10))*t)-10*sin((3/10)*t+(1/7)*Pi))^2 = 0, t = 0 .. 20*Pi);

                                                              [ ]

@usmanafzal  Unfortunately, I can not help anything, because I did not install this package. Try to contact the technical service Maplesoft.

This is even a simpler task than  http://www.mapleprimes.com/questions/221383-How-Do-To-Inscribed-Cone-In-Sphere--In-Maple

You must submit the text of your code instead of the picture and / or load the worksheet.

@Jalale  If you initialize this procedure in Maple and click on the plot, the animation panel will appear and on it you will see a slider that can move by the mouse.

 

 

 

@Jalale  I think you mean a procedure whose parameter will be the properties of the inscribed cone. The procedure  ConeInSphere  solves the problem. The height of the cone  h  is a required parameter. This can be any number from the range  0 .. 2.  Cone and Sphere are optional parameters. They set the graphical options for the cone and sphere.

ConeInSphere:=proc(h::numeric, Cone::list:=[style=surface, color="Green"], Sphere::list:=[color=pink, transparency=0.5])
local R, A, B, C;
uses plottools, plots;
R:=sqrt(1-(h-1)^2);
A:=plot3d([r*cos(t),r*sin(t),1-h], r=0..R, t=0..2*Pi, op(Cone)):  
# The base of the cone
B:=plot3d([r*cos(t),r*sin(t),-h/R*r+1], r=0..R, t=0..2*Pi,op(Cone)): # Lateral surface of the cone
C:=plottools:-sphere(op(Sphere)):
plots:-display(A, B, C, axes=normal, view=[-1.2..1.2,-1.2..1.2, -1.2..1.4], scaling=constrained);
end proc:

 

Example of use:

ConeInSphere(1.2, [style=surface, color="Cyan"], [color="Yellow", transparency=0.7]);

 

Example of an animation by using this procedure:

P:=h->ConeInSphere(h, [style=surface, color="Cyan"], [color="Yellow", transparency=0.7]):
plots:-animate(P, [h], h=2..0, frames=90, paraminfo=false);

                   

Edit.

 




 

@mehdibaghaee   Your system already has objects with names  A  and  b . I changed the names for the matrix of the system and its right side. Now everything is all right.

soal_new.mw

@nk2016 

eq:=diff(y(x),x)=sqrt(1+a*x+2*y(x)):
eval(eq, y(x)=-(1/2)*a*x+(1/8)*a^2-1/2);
is(%) assuming a<0;
A:=eval(eq, y(x)=m*x+c);
solve(coeff(op([2,1],%), x), m);
eval(A, m=%);
solve(%, c);

 

@taro  Because  this is a recursive procedure. If you put a semicolon instead of a comma in the example  P(A)  the procedure returns NULL. Every procedure returns only the last expression which is ending with a semicolon.

See this a toy example:

Proc:=proc(a,b)
a; b;
end proc:

Proc(1, 2);

                                        2

 

First 66 67 68 69 70 71 72 Last Page 68 of 132