Kitonum

21435 Reputation

26 Badges

17 years, 24 days

MaplePrimes Activity


These are answers submitted by Kitonum

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);

 

You can just skip this option:

restart;
p1 := plot([[0,0], [1,1]]);

                                 


If you want the plot of a function  f(x)  without labels, then define the function in operator form, for example:

restart;
plot(x->x^2, -2..2);

 

restart;
f := a*b+a*c+a+b+c;
s:=select(has, {op(f)}, a) minus {a*b};
# or
s:=select(has,{op(f)} minus {a*b}, a);

Output:       {a, a*c}

restart;
eq2 := ln(2*u^2 + u - 1) = -c - 2*ln(x);
sol:=[solve(eq2,u)];
simplify(sol[1]);
applyop(t->sqrt(simplify(t^2)), [2,2], %);

                                               

 

restart;
f:=x->3+(exp(x^2)+exp(1))/(exp(x^2)-exp(1));
P:=plot(f, -5..5, -3..8, color=blue, discont);
g:=x->f(a)-1/D(f)(a)*(x-a); # Equation of normal to f(x) at the point x=a
x0:=0:
M:=f(0);
d:=sqrt(a^2+(f(a)-g(0))^2):
a:=fsolve(g(0)-M=d, a=1..2);
R:=evalf(d);
y0:=evalf(g(0));
# (x-x0)^2+(y-y0)^2=R^2 - Equation of the circle
plots:-display(P, plottools:-circle([x0,y0],R, color=red), scaling=constrained);

                

We use a numerical solution ( fsolve  instead of  solve ) because the  solve  command cannot find any solution (returns NULL)

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