Kitonum

21465 Reputation

26 Badges

17 years, 48 days

MaplePrimes Activity


These are answers submitted by Kitonum

Looks like a bug. Below is a workaround:

plots:-display(
	plots:-implicitplot(`if`(y<=1-x^2,-x^2+y,undefined), x = 0 .. 2, y = -2 .. 1, color=red),
	plot(1-x^2, x=0..2, color=blue), scaling=constrained, view=[0..2,-2..1]
);

                                    

 

In fact, your expression is a first degree polynomial with respect to  exp(x) . Its coefficients should be simplified but not factored:

restart;
expr:= (cos(x)^2+sin(x)^2)+5+(1+x+x^2+x^3)*(cos(x)^2+sin(x)^2)*exp(x);
simplify~([coeffs(expr,exp(x),'t')]);
add(%*~t);

                         

Another reliable way to find all complex roots (in particular, real roots) of some analytic function in the specified intervals is to use RootFinding:-Analytic command:

restart:
line := x/100 - 1/2:
wave := cos(x/5) * sin(x/2): ## -1 <= wave <= 1
eq:= line - wave:
L:=sort([RootFinding:-Analytic(eq, re=-50..150, im=-1..1)]);
nops(L);
plot(eq, x=-50..150, -0.05..0.05, color=red, size=[1000,400]);

              

 

The line

((max-min)/abs(Mean))(S);

is incorrect. Should be

(max-min)(S)/abs(Mean(S)); 


The result is the same as 

((max-min)/(abs@Mean))(S);

 

You have one equation with three unknowns. Such equations usually have infinitely many solutions. The plot clearly shows that your equation is satisfied by the points lying on  some surfaces:

plots:-implicitplot3d((x,y,z)->`if`(y>x and z>y,cos(2*Pi*(x+y-2*z))+cos(2*Pi*(y+z-2*x))+cos(2*Pi*(z+x-2*y)),undefined),  0..1, 0..1, 0..1, style=surface, grid=[50,50,50], axes=normal);

                         

 

restart;
h:=k-(k-1)*x: lambda:=k/(1+k):
DE:=diff(p(x),x)=6/h^2-12/h^3*lambda;
BC:=p(0)=0, p(1)=0;
simplify(dsolve({DE, BC}, p(x)));
is(eval(p(x),%)=6*(h-1)*(h-k)/h^2/(1-k^2));

                 

Or

restart;
h:=k-(k-1)*x: lambda:=k/(1+k):
DE:=diff(p(x),x)=6/h^2-12/h^3*lambda;
BC:=p(0)=0, p(1)=0;
simplify(dsolve({DE, BC}, p(x)));
p:=unapply(eval(p(x),%), x);
h:='h':
eval(p(x),x=solve(h=k-(k-1)*x,x));
simplify(%);

             

 

int(u*v, x=-1..0, y=-1..1) + int(u*v, x=0..1, y=-1..1);

 

expr:=sin(x)+cos(x)*exp(x)+x*tan(x)*f(x)+x+y;
indets(expr, function) union {x};

                         {x, cos(x), exp(x), f(x), sin(x), tan(x)}

restart;
plot3d([[r*cos(phi),r*sin(phi),r],[r*cos(phi),r*sin(phi),2-sqrt(4-r^2)]], r=0..2, phi=0..2*Pi, scaling=constrained);

                

Another option:

plot3d([[r*cos(phi),r*sin(phi),r],[r*cos(phi),r*sin(phi),2+sqrt(4-r^2)]], r=0..2, phi=0..2*Pi, scaling=constrained);

                           

@flesx  R is your initial region.

restart;
R:=plot([seq(k,k=0..1,0.1),seq([k,y,y=0..1],k=0..1,0.1)],x=0..1, color=blue, scaling=constrained):
z:=x+I*y:
F:=plottools:-transform(unapply(evalc([(Re,Im)(exp(2*z))]), x,y)):
plots:-display(<R | F(R)>);

           

 

The code:
plots:-display(plottools:-curve([[x1,y1,z1], [x2,y2,z2], ... ,[xn,yn,zn]]));
 

[[x1,y1,z1], [x2,y2,z2], ... ,[xn,yn,zn]]  is the list of lists of your points.

As for the statement of the classical problem see wiki for details.

We assume that:  newly born  n  pairs of rabbits are put in a field; each  pair mates at the age of one month, and at the end of their second month they  produce another pair of rabbits with the probability 3/4 ; and rabbits never die, but continue breeding forever. So we come to the recurrent equation  u(k)=u(k-1)+3/4*u(k-2)  with the initial conditions  u(0)=n, u(1)=n

restart;
u:=unapply(rsolve({u(k)=u(k-1)+3/4*u(k-2),u(0)=n,u(1)=n}, u(k)),k);
expand(u(12));
round(%/n);

                              

Thus, the original number of rabbits will increase approximately 97 times.

 

restart;
dat := <14.52407334|-162.1310124>:
A := 10^(dat[1]/20.):
phi := dat[2]*Pi/180.:
R:= 0.3036:
f := (Zeta,A,phi) -> cos(Zeta) - R * Zeta * sin(Zeta) - exp(-phi * I)/A:
soln := [solve(f(Zeta,A,phi), Zeta)]:
nos := nops(soln):
# soln := Vector(soln);
soln1:=select(s->Re(s)>0 and Im(s)>0, soln);
L:=sort(soln1,key=(s->Re(s)));
real_part:=Re(L[1]);
imaginary_part:=Im(L[1]);

   

We can numerically parameterize this curve by polar angle and then do any animations, for example:

restart; 
f1 := sqrt((x+0.500000000)^2+y^2)+sqrt((x-0.500000000)^2+(y-1)^2)+sqrt((x-1.050000000)^2+(y+1)^2)+sqrt((x-0.500000000)^2+(y+0.500000000)^2)+sqrt((x-1)^2+(y-1)^2)-7: 
X := t->fsolve(eval(f1, [x = r*cos(t), y = r*sin(t)]), r = 0 .. 20)*cos(t): 
Y := t->fsolve(eval(f1, [x = r*cos(t), y = r*sin(t)]), r = 0 .. 20)*sin(t): 
plots:-animate(plot, [[X, Y, 0 .. a]], a = 0 .. 2*Pi, frames = 60);

                      

 

The code below works in Maple 2018.2:
 

restart;
F := proc(t)
local A, B, C;
uses plottools, plots;
A:=line([-2,0], [cos(t)-2, sin(t)], color=blue,thickness=3);
B:=line([cos(t)-2, sin(t)], [t, sin(t)], color=blue,thickness=3);
C:=plot(sin(x), x=0..t, view=[-3..7, -5..5],thickness=3);
display(A,B,C);
end proc:

plots:-animate(F,[theta],theta=0..2*Pi,background=plot([cos(t)-2,sin(t),t=0..2*Pi],thickness=3),
scaling=constrained,axes=none);

 

First 30 31 32 33 34 35 36 Last Page 32 of 290