Kitonum

21925 Reputation

26 Badges

17 years, 282 days

MaplePrimes Activity


These are answers submitted by Kitonum

What do you mean by an arbitrary partition? If the interval of integration   a..b  divided into  n  equal parts, and the value of the function is taken in the middle of each interval, the Riemann sum is

RiemannSum:=proc(expr, a, b, n)

local x, f, h;

x:=op(indets(expr));

f:=unapply(expr, x);

h:=(b-a)/n;

sum(f(a-h/2+h*i)*h, i=1..n);

end proc:

 

Examples:

RiemannSum(t^2, 0, 1, 10);

limit(RiemannSum(x^2, 0, 1, n), n=infinity);

                            

 

 

 

For easy use rewrote the program as a procedure. Formal parameters: a  and  b  - sizes of the table,  T - the  duration of the animation,  P - the coordinates of the initial point ,  V - the velocity of the ball, N - (optional) the number of the frames (by default  N=100).

The code of the procedure:

restart;

Billiard:=proc(a::positive, b::positive, T::positive, P::list, V::list, N::posint:=100)

local A, B;

if (P[1]<=0 or P[1]>=a) or (P[2]<=0 or P[2]>=b) then error "Should be 0<=P[1]<=a and 0<=P[2]<=b" fi;

A:=plots[animate](plot,[[2*a/Pi*abs(arcsin(sin(Pi/2/a*(P[1]+V[1]*t)))), 2*b/Pi*abs(arcsin(sin(Pi/2/b*(P[2]+V[2]*t)))), t=0..tau], thickness=5, color=red, numpoints=1000], tau=0..T, frames=N):

B:=plottools[rectangle]([0,b], [a,0], thickness=2, color=green):

plots[display](A, B, scaling=constrained, axes=none)

end proc: 

 

Examples 1.

Billiard(2, 1, 10, [0.5,0.5], [0.5,-sqrt(3)/2]);

 

Example 2.  I wonder in what proportions of the parameters the trajectory is closed?

Billiard(4, 2, 40, [1,1], [3/4,2]); 

 

Here is a simple example of an animation path of a billiard ball on a rectangular table:

restart;

A:=plots[animate](plot,[[3/Pi*abs(arcsin(sin(Pi/2*(0.5+0.2*t)))), 2/Pi*abs(arcsin(sin(Pi/2*(0.5+sqrt(3)/5*t)))), t=0..a], thickness=5, color=red, numpoints=1000], a=0..25, frames=100):

B:=plottools[rectangle]([0,1], [3/2,0], thickness=2, color=green):

plots[display](A, B, scaling=constrained, axes=none); 

 

restart;

p:=prevprime(41): n:=0:

while p<107 do

p:=nextprime(p);  n:=n+1;  sol:=msolve(y^2 + y - 11=0, p);

if sol<>NULL then L[n]:=[p,sol] fi;

od:

L:=convert(L,list):

op(L);

[41, {y = 21}, {y = 19}], [59, {y = 17}, {y = 41}], [61, {y = 8}, {y = 52}], [71, {y = 25}, {y = 45}], [79, {y = 9}, {y = 69}], [89, {y = 28}, {y = 60}], [101, {y = 33}, {y = 67}]

 

The conjecture is obvious.

plots[implicitplot]  command makes it possible to build any straight lines. If the coefficient of the y is equal to 0, and the coefficient of the x is not equal to 0, we obtain a vertical line.

Example:

plots[implicitplot]([seq(seq(a*x+b*y = 1, a = -1 .. 1), b = -1 .. 1)], x = -2 .. 2, y = -2 .. 2);

 

 

 

 

You do not have to convert these numbers into polar form, can immediately build these points:

z0 := sqrt(3)+I;
z1 := -1+I*sqrt(3);
z2 := -sqrt(3)-I;
z3 := 1-I*sqrt(3);

Points := seq(plots[pointplot]([Re(z||i), Im(z||i)], color = red, symbol = solidcircle, symbolsize = 15), i = 0 .. 3):
Names := seq(plots[textplot]([Re(z||i)+.2, Im(z||i), cat('z', i)], color = blue, font = [TIMES, ROMAN, 16]), i = 0 .. 3):

plots[display](Points, Names);

 

 

Of course, the same can be build by  plots[polarplot]  command:

restart; 

z0 := sqrt(3)+I: 
z1 := -1+I*sqrt(3): 
z2 := -sqrt(3)-I: 
z3 := 1-I*sqrt(3): 

Points := plots[polarplot]([seq([abs(z||i), argument(z||i)], i = 0 .. 3)], style = point, color = red, symbol = solidcircle, symbolsize = 15):

Names := seq(plots[textplot]([Re(z||i)+.2, Im(z||i), cat('z', i)], color = blue, font = [TIMES, BOLD, 16]), i = 0 .. 3):

plots[display](Points, Names);

 

 

Your body is limited to 5 surfaces:

1. y=x  and  y=-x  - two planes (green).

2. x^2+y^2+z^2 = 4  and  x^2+y^2+z^2 = 9  - two spherical surface (yellow).

3. z = sqrt(x^2+y^2)  -  conical surface (cyan).

All surfaces are defined by the parametric equations:

 

A:=plot3d([r*cos(t)/sqrt(2),r*cos(t)/sqrt(2),r*sin(t)], r=2..3, t=Pi/4..Pi/2, color=green):

B:=plot3d([-r*cos(t)/sqrt(2),r*cos(t)/sqrt(2),r*sin(t)], r=2..3, t=Pi/4..Pi/2, color=green):

C:=plot3d([r*cos(t),r*sin(t),r], r=2/sqrt(2)..3/sqrt(2), t=Pi/4..3*Pi/4, color=cyan):

E:=plot3d([2*cos(phi)*sin(theta),2*sin(phi)*sin(theta),2*cos(theta)], phi=Pi/4..3*Pi/4, theta=0..Pi/4, color=yellow):

F:=plot3d([3*cos(phi)*sin(theta),3*sin(phi)*sin(theta),3*cos(theta)], phi=Pi/4..3*Pi/4, theta=0..Pi/4, color=yellow):

plots[display](A,B,C,E, F, view=[-2.5..2.5,0..2.5,0..3.5],scaling=constrained, axes=normal, orientation=[25,75], labels=[x,y,z]);

 

 

 

You must use the geometric meaning of the definite integral. Your integral is precisely the area of a quarter of a circle of radius 4, because the plot of the function  f(x)=sqrt(16-x^2), x=-4..4, is the upper semicircle of the radius 4.

The name of a function or expression should be  name  type. But

type(omega^2, name); 

                     false

 

Instead of  omega^2  you can write  `omega^2`

type(`omega^2`, name);

                      true 

restart;

plots[implicitplot](x^3+y^3-3*x*y=0, x=-3..3, y=-3..3, thickness=2, gridrefine=4);

 

 

I believe this is the simple way:

[7,9,1]:

add(%[i]*10^(i-1), i=1..nops(L));

                       197

Should be  add  instead of  sum . Write as follows:

Omega := n-> R^n*P(n, z/R)*ln(r)+R^n*add((2*n-4*i+1)*P(n-2*i, z/R)/(i*(2*n-2*i+1)), i = 1 ..

(1/2)*(n-(n mod 2))) ;

restart;

ee := -ln(-a/(b-c)):

ff:=combine(ee) assuming a/(c-b)>0;

gg:=op(1, ff);

subs(gg=numer(gg)/denom(gg), ff);

 

 

In your expression you forgot to put the separators (colons or semicolons).

restart;

m := 2:

k := 1.0931:

a := k-m:

b := k+m-1:

z := k*m/10^(.1*10):

simplify((10^(.1*yo))^((b-a+2*p-1)*(1/2))*z^((b-a+2*p+1)*(1/2))*GAMMA((1/2)*(1-b+a-2*p))/(p!*GAMMA(p-a+1)*GAMMA(1+(1/2)*(1-b+a-2*p))));

[seq(limit(%, p = k), k = 0 .. 10)];

 

 

 

 

Example:

cat(op(0, A[1]), op(A[1]));

                  A1

First 229 230 231 232 233 234 235 Last Page 231 of 292