Kitonum

21485 Reputation

26 Badges

17 years, 55 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;

plot(x^2, x=0..2, thickness=2, view=[-2..2, -0.5..4.5], scaling=constrained);

Lorny! Your system can be solved exactly with respect to   and  C  at any value of  n2 . To do this,  n1  and  n3  should be defined exactly as a fractions. Solutions are expressed in terms of the roots of cubic equations and even can be expressed by radicals, but very cumbersome expressions. Simple expression have only solutions for  n2 = 3/10 . If  n2 <0.3  or  n2> 0.3246543748 (approximately), the system has a unique solution, if  n2 = 0.3  or  n2 = 0.3246543748 (approximately), then two solutions, and if  0.3 <n2 <0.3246543748, then three solutions:

n1:=1: n3:=3/10:

n2:=1/5:

solve({T= n1/(1+abs(T-S)), S=n2/(n3+abs(T-S))});

n2:=31/100:

solve({T= n1/(1+abs(T-S)), S=n2/(n3+abs(T-S))});

 

 

 

 

Several specific solutions:

n1:=1: n3:=0.3:

n2:=0.29:

solve({T= n1/(1+abs(T-S)), S=n2/(n3+abs(T-S))});

n2:=3/10:

solve({T= n1/(1+abs(T-S)), S=n2/(3/10+abs(T-S))});

n2:=0.31:

solve({T= n1/(1+abs(T-S)), S=n2/(n3+abs(T-S))});

n2:=0.3246543748:

solve({T= n1/(1+abs(T-S)), S=n2/(n3+abs(T-S))});

n2:=0.3246543749:

solve({T= n1/(1+abs(T-S)), S=n2/(n3+abs(T-S))});

 

 

 

 

The plot of solutions. The plot, where the solution is not unique, isolated vertical dashed lines:

> restart;

n1:=1: n3:=0.3:

 

f:=n2->solve({T= n1/(1+abs(T-S)), S=n2/(n3+abs(T-S))}):

 

A:=plot(['eval(T, f(n2))', 'eval(S, f(n2))'], n2=0..0.2999, color=[red, blue], thickness=2):

B:=plot(['eval(T, f(n2))', 'eval(S, f(n2))'], n2=0.3248..1, color=[red, blue], thickness=2):

E:=plot(['eval(T, f(n2)[1])', 'eval(T, f(n2)[2])', 'eval(T, f(n2)[3])'], n2=0.3001..0.3246, color=red, thickness=2):

F:=plot(['eval(S, f(n2)[1])', 'eval(S, f(n2)[2])', 'eval(S, f(n2)[3])'], n2=0.3001..0.3246, color=blue, thickness=2):

G:=plot([0.3, t, t=0..1], linestyle=3, color=black):

H:=plot([0.3247, t, t=0..1.001], linestyle=3, color=black):

 

plots[display](A, B, E, F, G, H, view=[0.25..0.4, 0.4..1.2]);

 

Easiest to use  add  function:

PartialSum:=proc(n::posint)

evalf(add(4*(-1)^(k-1)/(2*k-1), k=1..n));

end proc:

 

Example:

PartialSum(1000);

            3.140592654

 

To solve the second problem, we use property an alternating series: the remainder of a series does not exceed the first of the neglected terms (in absolute value).

solve(4/(2*n-1)<10^(-5));

Therefore, we take n = 200001

PartialSum(200001);

                      3.141597654

evalf(Pi - %);

                      -0.5*10^(-5)

 

 

n1:=1: n3:=0.3:

f:=n2->fsolve({T= n1/(1+abs(T-S)), S=n2/(n3+abs(T-S))}):

plot(['eval(T, f(n2))', 'eval(S, f(n2))'], n2=0.5..3, color=[red, blue], numpoints=1000);

Replace  e^(-1.5*t)  by  exp(-1.5*t) :

 

A:=Int(exp(-1.5*t)/sqrt(t*(t+1)), t = 1 .. infinity);

evalf(A);

 

 

In the procedure  the standard algorithm was used for an even number of participants. See  http://en.wikipedia.org/wiki/Round-robin_tournament  .

Schedule:=proc(n::even)

local L, k, i;

if n=4 then L:=[[[1,4],[2,3]], [[1,3],[4,2]], [[1,2],[3,4]]] else

L[1]:=[seq([i,n-i+1], i=1..n/2)];

for k from 2 to n-1 do

L[k]:=[[1,L[k-1][2,2]], [L[k-1][1,2],L[k-1][3,2]], seq([L[k-1][i,1],L[k-1][i+2,2]], i=2..n/2-2), [L[k-1][n/2-1,1],L[k-1][n/2,1]]];

od; fi;

for i to n-1 do

print([seq(convert(L[i][j],set), j=1..n/2)]);

od;

end: 

 

Example for n=16:

Schedule(16);

 

 

The following code solves the logic problem for sorts of sports.  Solution of the problem of the composition of departments used in this code:

restart;

Names:=[Alex, Betty, Carol, Dan, Earl, Fay, George, Harry]:

Sports:=[football, cricket, volleyball, badminton, lawn_tennis, basketball, hockey, table_tennis]:

Variants:=combinat[permute](Sports):

Terms:='[Dan<>football, Dan<>cricket, Alex=table_tennis, Carol=hockey, George<>cricket, George<>badminton, 'Dan=football or Betty=football or Carol=football', 'Fay=volleyball or Alex=volleyball', Dan<>badminton, Dan<>lawn_tennis, Betty<>badminton, Betty<>lawn_tennis, Carol<>badminton, Carol<>lawn_tennis, Harry<>cricket]':

Solutions:=[]:

for variant in Variants do

if convert(subs([seq(Names[i]=variant[i], i=1..8)], Terms), `and`) then Solutions:=[op(Solutions), variant] fi:

od:

seq(Names[i]=op(Solutions)[i], i=1..8);

This equation has five (real or complex) roots, which Maple can not find in radicals. 

RootOf(20+60Z+335Z2+825Z3+1629Z4+2520Z5, index=3)  is the third root of this list.

You have assigned the name  с  to  a + b , and not vice versa.

Solution the problem:

restart;

algsubs(a+b=c, [a+b+2, a+2+b, b+2+a]);

                         [c+2, c+2, c+2]

 

Here is the solution of the logic problem for composition of departments:

restart;

Names:={Alex, Betty, Carol, Dan, Earl, Fay, George, Harry}:

A:=combinat[choose](Names, 3):

L:=[]:

for i in A do

B:=combinat[choose](Names minus i, 3);

for j in B do

L:=[op(L), [i, j, (Names minus i) minus j]];

od: od:

Organization:={seq(op(combinat[permute](L[k])), k=1..nops(L))}:

Terms:=[Dan in Administration, Fay in Personnel, Alex in Personnel, 'nops(Personnel)=2', not(Earl in Administration), not(Harry in Administration), not(Carol in Marketing), not(George in Administration)]:

Departments:=[]:

for variant in Organization do

Personnel:=variant[1]: Administration:=variant[2]: Marketing:=variant[3]:

if convert(Terms, `and`) then Departments:=[op(Departments), variant]; fi;

od:

op(Departments);

                           [{Fay, Alex}, {Dan, Betty, Carol}, {Earl, George, Harry}]

 

Thus we have the unique solution:

Personnel={Fay, Alex},  Administration={Dan, Betty, Carol},  Marketing={Earl, George, Harry}

Similarly, we can find the distribution of sorts of sport.

 

In fact, there is no error, because  cos  function is even, ie  cos(-x) = cos(x). If you do not confuse the extra parentheses, you can write:

cos(``(Phi1(x)-psi));

 

If further transformations are not planned, you can just write:

cos(``*Phi1(x)-psi);

 

 

Replace simplify by  radnormal .

Procedure  Horner  using Horner's method calculates the value of the polynomial  P  in the point  x0 :

restart;

Horner:=proc(P::polynom, x0::realcons)

local n, x, b, i, a;

n:=degree(P); x:=op(indets(P));

assign(seq(a[k]=coeff(P, x, k), k=0..n)); b:=a[n];

for i from n-1 by -1 to 0 do

b:=a[i]+b*x0;

od;

b;

end;

 

Example:

Horner(x^3-5*x^2-3*x+4, 3);

                   -23

Example:

f:=unapply(expand(sum((x1+x2+x3)^i, i=1..5)), x1,x2,x3);

f(a,b,c);

restart;

sol := solve([sin(a)-sin(b) = 0, b >= 0, b < 2*Pi], b, allsolutions, explicit);

seq(eval(op(sol[i]), op(`minus`(indets(sol[i]), {a, b})) = 0), i = 1 .. 2);

 

 Addition:  if instead of   specific angle to write, there is no problem.

restart;

solve({sin(Pi/6)-sin(b) = 0, b>=0, b<2*Pi}, b, allsolutions, explicit);

 

 

First 246 247 248 249 250 251 252 Last Page 248 of 290