Kitonum

21435 Reputation

26 Badges

17 years, 26 days

MaplePrimes Activity


These are answers submitted by Kitonum

A:={20,15,10,30,46,78}; 
S:=0:
for i from 1 to nops(A) do
S:=S+A[i];
if S>=50 then break fi;
od:
B:=A[1..i-1];

Maple automatically sorts the elements of a set in ascending order, so for Maple your set will be  A={10, 15, 20, 30, 46, 78}

Example:

DocumentTools:-Tabulate(Matrix(2, [seq(plot(x^k, x=-1..1, size=[300,300]),k=1..4)]), interior = none, exterior = none);

See help for details.

To see this matrix run the  interface(rtablesize=infinity):   command first.

If you do not have Maple on your work computer, then you cannot rotate your 3D plot with the mouse.

Two possible options:
1. You can simply save the plot in any graphic format and display it as a static image.
2. You can make a simple animation in Maple, for example, rotating your plot around a spatial axis, then save this animation as a GIF file. Such files can be played in many browsers and in Power Point.

The problem is easily solved by application of the formula inclusions and exclusions:

for n from 6 do
if sum(binomial(6,k)*(6^n-(6-k)^n)*(-1)^(k-1), k=1..6)/6^n>=1/2 then break fi;
od;
n;
                                       
          13

restart; 
b:=unapply(rsolve({b(n)+b(n-1)+b(n-2)=0, b(0)=1, b(1)=-1, b(2)=0}, b(n)), n);

seq(expand(b(n)), n=1..20);
                           
-1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0

 

You can do this as follows (in the example, 4 ellipses are plotted):

restart;
F1,F2:=[-1,0],[1,0]:
Eq:=sqrt((x-F1[1])^2+(y-F1[2])^2)+sqrt((x-F2[1])^2+(y-F2[2])^2) = C;
plots:-implicitplot([seq(eval(Eq,C=c),c=[2.2,3,4,5])], x=-4..4, y=-4..4, color=[red,yellow,blue,green], scaling=constrained, gridrefine=3);

 

You forgot to call the  plots  package. So replace  display  with  plots:-display . To create  filled circles, use  the  disk  command instead of  circle  command. 

I did not find the color option for  title . As a workaround you can use  plots:-textplot  command:

A := plot(f(x), x = 0 .. 10, thickness = 3, gridlines = true): 
B := textplot([4.8, .22, "Fonction densité de χ^2\navec 3. d.d.l"], font = [ARIAL, bold, 14], color = red): 
display(A, B, size = [500, 500]);

 

To improve visibility, I reduced the ranges along the axes and used the size option:

with(DEtools)

diff(y(x), x) = x-y(x)

diff(y(x), x) = x-y(x)

(1)

A := DEplot(diff(y(x), x) = x-y(x), y(x), x = -3.5 .. 3.5, y = -3.5 .. 3.5, [y(0) = -1, y(1) = -1, y(2) = -1]); B := plot([-1, [0, t, t = -1 .. 0], [1, t, t = -1 .. 0], [2, t, t = -1 .. 0]], x = -3.5 .. 3.5, linestyle = [1, `$`(3, 3)], color = blue); plots:-display(A, B, size = [900, 500])

 

NULL


Addition.
You can also easily find the equations of these yellow curves by

Eq := diff(y(x), x) = x-y(x); 
Ic := [y(0) = -1, y(1) = -1, y(2) = -1]; 
seq(combine(dsolve({Ic[i], Eq})), i = 1 .. 3);

    

 

Download Differential_Equation_slope_field_new.mw

It works:

with(plottools): with(plots): 
display(seq(seq(display(polygon([[i,j],[i,j+1],[i+1,j+1],[i+1,j]], color=`if`(j::odd,"Magenta", yellow)), textplot([i+.5,j+.5,sprintf("%d",i*j)], font=[times,roman,14])),i=1..10), j=1..10),axes=none);

      

restart;
a:=[3,3,1,5,7,8,5,4,4,4,4,3,9]:
for i from 1 to nops(a) do
if a[i]=4 then a:=subsop(i=NULL,a); break fi;
od;
a;

Or
 

restart;
a:=[3,3,1,5,7,8,5,4,4,4,4,3,9]:
a:=subsop(ListTools:-Search(4,a)=NULL,a);

 

The same bug in Maple 2018.2. Here are 2 workarounds:

restart;
U:= Matrix(4, {seq((i,i)=1,i=1..4), seq(seq((i,j)=u[i,j],j=i+1..4),i=1..3)});
-U;

# Or

U:= Matrix(4, (i,j)->`if`(i=j,1,`if`(j>i,u[i,j],0)));
-U;

 

Here is another approach to solving equations using the  identify  command. Here we first find the roots numerically, and then try to get their symbolic representation. This method is especially useful when solving transcendental equations for which the  solve  command does not work (second example below). These examples works in Maple 2017.3:
 

restart;
Student:-Calculus1:-Roots((x-1)*(x^3-9*x^2+4),numeric);
evalc~(identify(%));
simplify(map2(eval,(x-1)*(x^3-9*x^2+4)=0,x=~%));  # Check

[-.6440222815, .6939575790, 1., 8.950064703]

 

[-3*cos((1/3)*arctan((2/25)*26^(1/2)))+3-3*3^(1/2)*sin((1/3)*arctan((2/25)*26^(1/2))), -3*cos((1/3)*arctan((2/25)*26^(1/2)))+3+3*3^(1/2)*sin((1/3)*arctan((2/25)*26^(1/2))), 1, 6*cos((1/3)*arctan((2/25)*26^(1/2)))+3]

 

[0 = 0, 0 = 0, 0 = 0, 0 = 0]

(1)

Eq:=sin(x)-6*x/Pi/2=0;
solve(Eq, explicit);
allvalues(%);
Student:-Calculus1:-Roots(sin(x)-6*x/Pi/2=0, numeric);
identify(%);
map2(eval,Eq,x=~%);  # Check

sin(x)-3*x/Pi = 0

 

RootOf(-sin(_Z)*Pi+3*_Z)

 

RootOf(-sin(_Z)*Pi+3*_Z, .5235987756), RootOf(-sin(_Z)*Pi+3*_Z, -.5235987756), 0

 

[-.5235987756, 0., .5235987756]

 

[-(1/6)*Pi, 0, (1/6)*Pi]

 

[0 = 0, 0 = 0, 0 = 0]

(2)

 


 

Download identify.mw

 

s:=solve((hv*hw+lv*lw)/(lv+hv)*(lv+hv) = dw*(lv+hv), hv):
expand(``(-numer(s))/``(-denom(s)));

 

First 93 94 95 96 97 98 99 Last Page 95 of 289