Kitonum

21967 Reputation

26 Badges

18 years, 24 days

MaplePrimes Activity


These are answers submitted by Kitonum

L1:=[2, 2, 3, 2, 4, 2, 3, 5, 4]:
L2:=[5, 4, 3, 4, 2, 2, 2, 2, 3]:
is(ListTools:-Collect(L1)=ListTools:-Collect(L2));

                         true

You don't have to use the  rsolve  command. A recursive procedure  solves your problem also.

restart;
f:=proc(n,x)
option remember;
if n=1 then return x else
if n=2 then return 2*x+2*sin(x) else
2*f(n-1,x)-f(n-2,x)+2*sin((n-1)*x)/(n-1) 
fi; fi;
end proc:

# Examples
f(3,x);
f(4,x);
f(4,Pi/3);
f(10,x);

          

 

You don't have to use Remove.
There's a shorter way below. For details see Help on DataFrame,indexing .

restart;
df1 := DataFrame(<1, 2, 3; 4, 5, 6>, rows = [a, b], columns = [A, B, C]);
df11:=df1[B..];

                      

Addition. The situation here is similar to matrices. If you need to delete a column, you can use the LinearAlgebra:-DeleteColumn command, but it's easier to skip this package call and use indexing:

Example:

A:=<1,2,3; 4,5,6>:
A[..,2..];

               

You can achieve what you want by making a temporary substitution:

restart;
expr1:=(1-a)^3;
expr11:=subs(-a=b,expr1); # A substitution
expr2:=expand(expr11);
expr3:=factor(expr2);
expr4:=subs(b=-a,expr3); # The inverse substitution

                       

A:=<1,2,3; 4,5,6>;
B:=<1,2; 3,4>;
<A|B|A>;

          

Rotations around coordinate axes are only special cases. We can consider rotation in 3D around an arbitrary fixed axis. See the wiki  https://en.wikipedia.org/wiki/Rotation_matrix . The same article derives the matrix for such a rotation.
But for working in Maple, we can do without this matrix. Simply specify the vector defining this axis and the rotation angle and use the  plottools:-rotate  command.
Below is an example of rotation of a cube around the axis defined by the vector <1, 1, 1> :

restart;
P:=proc(phi)
local Cube, c, V;
uses plots, plottools;
Cube:=plots:-display(plottools:-cuboid([-1, -1, -1], [1, 1, 1]), axes=normal, view=[-2.4..2.4,-2.4..2.4,-2.4..2.4], orientation=[40,80]);
c:=[1,1,1],[2,2,2];
V:=arrow(c, color=red, width=0.07);
display(rotate(Cube,phi,[c]),V);
end proc:

plots:-animate(P, [phi], phi=0..2*Pi, frames=90);

          

 

Using the fact that the equation does not contain the variable  x  in its notation, we make a substitution that allows us to lower the order of the equation:  y'(x) = p(x),  y''(x) = p'(x) = p'(y) * y'(x) 

restart;

ode:=diff(diff(y(x),x),x)+sin(y(x)) = 0;
dsolve(diff(p(y),y)*p(y)+sin(y)=0, p(y));
sol:=eval(p(y), eval(%[1],_C1=2));
sol1:=simplify(eval(sol,cos(y)=2*cos(y/2)^2-1)) assuming y>0, y<Pi;
dsolve({diff(y(x),x)=eval(sol1, y=y(x)),y(0)=0}, y(x));
sol:=simplify(%) assuming x>0;

odetest(sol,[ode,y(0)=0]);  # Check
limit(eval(y(x),sol), x=infinity);

                        

 

From the help: "Note that a set cannot be used as it does not preserve the order of the legend entries".
I don't understand why you use curly or square brackets to plot a single curve.

From the help for eval: "Since eval does pointwise evaluation, eval cannot be used to evaluate an expression at a singularity. Use limit instead."

The reason is that you have different scales on the coordinate axes. To equalize the scales, you can use scaling=constrained  option. I also rewrote the plane equation in this form  z=f(x,y)  (you probably meant y=5*x+z+6).

restart;
A := plots:-pointplot3d([[-6, 2, -1]], symbol = solidcircle, symbolsize = 20, color = blue, axes = boxed):
H := plots:-pointplot3d([[-1, 1, 0]], symbol = solidcircle, symbolsize = 20, color = red, axes = boxed):
P1 := plot3d(-5*x+y-6, x = -4 .. 4, y = -4 .. 4, style = surface, axes = boxed, color = cyan):
plots:-display(A, P1, axes = boxed):
l1 := plots:-spacecurve([-5*t-6, t+2, -t-1], t = -10 .. 10, color = red, thickness = 6):
plots:-display(l1, A, P1, H, scaling = constrained, view = [-7 .. 2, -3 .. 6, -4 .. 5], axes = box, orientation = [100, 80]);

          

 

You can use  plots:-implicitplot  command for this:

display(inequal({TMA3 > max(TMA1, TMA2)}, Cr = .65 .. .9, s = .2 .. .9, 'nolines', color = "Chartreuse", transparency = .4), inequal({TMA2 > max(TMA1, TMA3)}, Cr = .65 .. .9, s = .2 .. .9, 'nolines', color = "LightGray", transparency = .4), inequal({TMA1 > max(TMA3, TMA2)}, Cr = .65 .. .9, s = .2 .. .9, 'nolines', color = "Moccasin", transparency = .4), implicitplot(TMA2 = max(TMA3, TMA1), Cr = .65 .. .9, s = .2 .. .9, color = black, thickness = 2, gridrefine = 3), implicitplot(TMA1 = max(TMA3, TMA2), Cr = .65 .. .9, s = .2 .. .9, color = black, thickness = 2, gridrefine = 3), textplot([.7, .3, `#msubsup(mi("SW"),mi(""),mn("S"));` > MAX(SW^B, SW^I)], font = [Verdana, 9, bold]), textplot([.85, .6, `#msubsup(mi("SW"),mi(""),mn("I"));` > MAX(SW^B, SW^S)], font = [Verdana, 9, bold]), textplot([.72, .8, `#msubsup(mi("SW"),mi(""),mn("B"));` > MAX(SW^S, SW^I)], font = [Verdana, 9, bold]), labels = [C__r, typeset(s)], labelfont = [Verdana, bold, 14], axesfont = [Verdana, bold, 12], caption = typeset('Ct' = eval(Ct, DATA1), ", ", 'Cv' = eval(Cv, DATA1), ", ", 'theta' = eval(theta, DATA1)));

          

 

This equation has a unique solution in the real domain. To help Maple solve it, we need to help it a little. First, we eliminate the logarithms, then we cube them. The condition  y>1  is necessary for the existence of a solution in the real domain.

restart;
Eq:=surd(y^3-1,3)/y=C*(t^2+1)^(2/5);
Eq1:=Eq^3 assuming y>1;
Sol:=RealDomain:-solve( Eq1, y) assuming y>1;

simplify(eval(Eq1, y=Sol));  # Check

                      

 

 

restart; 
R := t->sin(1.2*t)^2+cos(6*t)^3: 
plots:-polarplot(R, 0 .. 12*Pi, numpoints = 2000, axes = normal, scaling = constrained);

         

Addition.  If you want the plot to look more like your original sample, then use the  plot command with the option  coords=polar:

restart; 
R := t->sin(1.2*t)^2+cos(6*t)^3: 
plot(R, 0 .. 12*Pi, color="CadetBlue", thickness=2, coords=polar, numpoints = 2000, view=[-1.95..1.95,-1.7..1.7], axis=[color="CadetBlue"], axes=box);

        

 

Since the horizontal size of a worksheet is usually larger than the vertical size, it is more convenient and looks better when the sliders are located on the left or right (done in Maple 2018.2).

restart;
Explore(plot((b+0.7)*sin(x/(a+1))/x+b, x=-4*Pi .. 4*Pi, view=-2 .. 6,gridlines),
        a=-2.0 .. 1.0, 
        b=0.0 .. 3.0,
        width=500,placement='right');

      

Using the inverse function often helps when simplifying complex radicals. It also helps in this example:

restart;
e:=tan((5/9)*Pi) + 4*sin((5/9)*Pi);
tan(simplify(arctan(%)));

                                  

1 2 3 4 5 6 7 Last Page 1 of 293