Kitonum

21885 Reputation

26 Badges

17 years, 243 days

MaplePrimes Activity


These are answers submitted by Kitonum

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

                                  

As far as I know, the  is  command attempts to syntactically confirm or disprove the equality presented to it using various simplifying procedures. If it is unable to do so, it should return  FAIL. Therefore, output  false  as result of  is(Q1=Pi/exp(1))  should be considered as  a bug. Sometimes it is useful to help it a little to obtain the result. Below are some examples of the  is command in action.
 

restart;
Q1 := int(sin(Pi*x)/(x^x*(1-x)^(1-x)), x = 0 .. 1); 
seq(is(evalf[10*k](Q1) = evalf[10*k](Pi/exp(1))), k = 1 .. 10);
is(Pi = 3.14); 
is(evalf(Pi) = 3.14); 
is(evalf[3](Pi) = 3.14); 
eq := sqrt(x+2*sqrt(-1+x)) = sqrt(-1+x)+1; 
is(eq) assuming x >= 1; 
is(eq^2) assuming x >= 1;

              


When using the  identify command, the expression must be evaluated with sufficient precision. Often, 10 digits (the default) is insufficient, but requiring 100 digits is probably overkill. Typically, 15-20 digits are sufficient.

identify(evalf(Q1));
identify(evalf[15](Q1));
identify(evalf[20](Q1));

                          

 

 

I completely rewrote this code to improve the visual clarity and informativeness. Everything related to the cosine is in red, and everything related to the sine is in blue. Furthermore, the red segment equal to the cosine value is also plotted not only horizontally but also vertically, so that all the dash-lines are parallel to the horizontal axis.

restart;
OneFrame:=proc(t)
local h, r, Circle, L1, L2, L3, L4, L5, L6, L7, L8, P1, P2, P3, P4, P5, P6, Curves, Arc, T;
uses plots, plottools;
h:=-1.3; r:=0.04;
Circle:=circle([h,0], view=[h-1.2..h+1,-1.4..1.4], axes=none);
L1:=line([h,-1.5],[h,1.5]); L2:=line([h+cos(t),0],[h,cos(t)], linestyle=2); L3:=line([h,0],[h+cos(t),0], color=red, thickness=3); L4:=line([h,cos(t)],[h,0], color=red, thickness=3);
L5:=line([h,0],[h+cos(t),sin(t)]);L6:=line([h+cos(t),0],[h+cos(t),sin(t)], color=blue, thickness=3);
L6:=line([h,cos(t)],[t,cos(t)], linestyle=3, thickness=0);
L7:=line([h+cos(t),sin(t)],[t,sin(t)], linestyle=3, thickness=0);
L8:=line([h+cos(t),sin(t)],[h+cos(t),0], thickness=3, color=blue); 
P1:=disk([h,0],r); P2:=disk([h+cos(t),sin(t)],r); P3:=disk(
[h+cos(t),0],r, color=red); P4:=disk([h,cos(t)],r, color=red);
P5:=disk([t,sin(t)],r, color=blue);
P6:=disk([t,cos(t)(t)],r, color=red);
Curves:=plot([sin(x),cos(x)], x=0..t, color=[blue,red], thickness=2, view=[0..2*Pi,-1.4..1.4], tickmarks = [[seq(Pi/2*k=k*Pi/2, k=1..4)], default]);
Arc:=arc([h,0],0.3, 0..t);
T:=textplot([[0.2*cos(t/2)+h,0.2*sin(t/2),"t"],[t,cos(t),typeset(cat("(","t",",","cos(t)",")")), align=[above,right], color=red],[t,sin(t),typeset(cat("(","t",",","sin(t)",")")), align=[above,right], color=blue]], font=[times,14]);
display(Circle, L1, L2, L3, L6, L4, L5, L6, L7, L8, P1, P2, P3, P4, P5, P6, Curves, Arc, T, scaling=constrained, view=[h-1..6.5,-1.4..1.4]);
end proc:

plots:-animate(OneFrame, [t], t=0..2*Pi, frames=120, size=[1000,300], paraminfo=false);

         


cos_sin.mw

If we're solving this equation in the real domain, it's natural to use assumptions that ensure non-negativity under the root sign in the original equation, i.e.  x>-1  and  x<=1 . We also use the condition that  arcsech(x)  takes real values, i.e.  x>0  and  x<=1 . This ensures that everything is solved quickly and correctly:

restart;
ode:=-x*sqrt((1 - x)/(x + 1))*(x + 1)*arcsech(x)*diff(y(x), x)*exp(y(x)/arcsech(x) + exp(y(x)/arcsech(x))) - y(x)*exp(y(x)/arcsech(x) + exp(y(x)/arcsech(x))) + 2*x*sqrt((1 - x)/(x + 1))*(x + 1)*arcsech(x)^2 = 0;
convert(arcsech(x), ln);
Cond:=solve({(1 - x)/(x + 1)>=0, op(1,%)>0}, x)[];
sol:=CodeTools:-Usage(dsolve(ode)) assuming Cond;
odetest(sol, ode) assuming Cond;

       

Use the  unapply  command  instead  of  the  ->  notation  to define the  F  function:

restart;
F:=x-> (x^4+3*x^3-3*x^2-2*x-24)/(x^4-4*x^3-13*x^2+62*x-56);
u:=unapply(piecewise(x=-4, limit(F(x), x=-4), true, F(x) ), x);
u(-4);

                

The help for the  solve  command states that it may not find all roots, but using additional options  explicit  and  allsolutions  allows you to explicitly find all roots.
Regarding the  PDEtools:-Solve  command, the help does not state that it may not find all roots. Using some additional options listed in the help does not produce any new roots beyond the one already found  x=1 .  I use Maple 2018.2 .

restart;
f:=x->(x^2+3*x-4)*cos(x^2+3*x-5);
PDEtools:-Solve({f(x)=0,0<x,x<2}, x, explicit, allsolutions, solver =solve);
solve({f(x)=0,0<x,x<2},x, explicit, allsolutions);

       

Curve   consists of two branches located on opposite sides of the vertical asymptote  x=1 . The local maximum point is  (-1, -1) . However, there are infinitely many circles that are tangent to curve   at this point. From this family of circles, we find a single circle that is also tangent to the second branch of this curve.

restart;
f:=x->x+2+4/(x-1):
solve(D(f)(x)=0);
x0:=select(x->(D@@2)(f)(x)<0, [%])[];
y0:=f(x0);
Eq:=(x-x0)^2+(y-(y0+R))^2=R^2;
g:=unapply(solve(Eq, y)[1], x);
sol:=solve({f(x)=g(x),D(f)(x)=D(g)(x),y=f(x),R>0}, {x,y,R}, explicit);
R:=eval(R, sol[2]);
P1:=plot(x+2+4/(x-1), x=-6..6, color=blue, discont):
P2:=plottools:-circle([x0,y0+R],R, color=red):
P3:=plottools:-disk([x0,y0], 0.1, color=red):
P4:=plottools:-disk(eval([x,y],sol[2]), 0.1, color=red):
plots:-display(P1,P2,P3,P4, scaling=constrained, view=[-6..6,-4..10], size=[500,500]);

         

Circle.mw

Here is my attempt:

restart;
Colors:=[seq(op(["LightBlue","Indigo","Violet","Red","Orange","Yellow","Green"]),n=1..14)]:

P:=proc(n)
uses plots, plottools;
display(rotate(plot([x^(1+0.1*(n-1)),x^(1/(1+0.1*(n-1)))], x=0..1, thickness=5, color=Colors[round(n)], transparency=0.4),Pi*n/98, [0.5,0.5]));
end proc:

plots:-animate(P,[n],n=1..98, frames=98, trace=[$1..98], axes=none, size=[700,700], paraminfo=false);

                 

restart;
A:=Matrix([[1,2], [3,4]]);
ListTools:-Search(3, A);

                                      

See the post  https://mapleprimes.com/posts/202222-Contour-Curves-With-Labels  for this.

Your example:

f:=(11 - x - y)^2 + (1 + x + 10*y - x*y)^2:
ContoursWithLabels(f, 0 .. 20, 0 .. 15, 10,[color=black, thickness=2,size=[800,600]], Coloring = [colorstyle = HUE, colorscheme = ["White", "Red"], style = surface]);

              

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