Kitonum

21435 Reputation

26 Badges

17 years, 29 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;

solve(subs(z=t, [x + 3*y + 5*z = 0, 7*x + 9*y + 11*z = 0, 13*x + 15*y + 17*z = 0]), {x,y});

                                       {x = t,  y = -2*t}

Your system has a lot of parameters (15 ones). I do not think that Maple can solve it in general terms.

Here is a numerical solution for the specified parameter values. Maple gives one solution. The problem of finding all solutions remains open.

Example of numerical solution:

restart;

eq1 := A-B*a-V*a*q/z-W*(b+d)*a/z = 0;

eq2 := W*(b+d)*a/z-V*b*q/z-(F*G+B+D1)*b = 0;  # D is replaced by D1, as D is a protected name

eq3 := V*a*q/z-W*c*(b+d)/z-(B+C+E)*c = 0;

eq4 := V*b*q/z+W*(b+d)*c/z-(B+C+D1+F)*d = 0;

eq5 := G*F*b-V*q*e/z-(B+H)*e = 0;

eq6 := H*e-V*q*f/z-(B+S)*f = 0;

eq7 := S*f-V*q*g/z-B*g = 0;

eq8 := V*q*g/z+S*s-(B+C+E)*h = 0;

eq9 := F*d+V*q*e/z-(B+C+H+T)*t = 0;

eq10 := H*t+V*q*f/z-(U+B+C+2*S)*s = 0;

eq11 := T*t+W*(b+d)*x/z-(B+H+Y)*u = 0;

eq12 := U*s-(B+S)*v+H*u-Y*H*v/(H+S) = 0;

eq13 := g-c-d-t-s-h = 0;

eq14 := z-a-b-c-d-e-f-g-h-s-t-u-v = 0;

A:=1: B:=3: C:=2: D1:=4: E:=5: F:=6: G:=7: H:=3: S:=5: T:=10: V:=1: W:=1: U:=3: Y:=4: x:=9:

soln := fsolve({eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10, eq11, eq12, eq13, eq14}, {a, b, c, d, e, f, g, h, q, s, t, u, v, z});

      soln := {a = -0.09239258218, b = 0.02046544085, c = -40.00746249, d = 26.68993307, e = 0.3933087206,       f =0.2819127969, g = -1.730438481, h = 1.364657560, q = 10.17990179, s = 1.409139234, t =      8.813294145, u = -0.1946342314, v = 0.3835278957, z = -2.668688921}

 

Sol := dsolve(Sys, numeric, output = listprocedure):

y2 := eval(y2(t), Sol):

y3 := eval(y3(t), Sol):

Now you can use  y2  and  y3  as  usual functions:

plot(abs(y2(t)-y3(t)), t = 0 .. 10);

Optimization[Maximize](abs(y2(t)-y3(t)), t = 0 .. 10);

                    [0.478412603974697, [t = 1.55119226446816]]

g(y):=80*y^8 + 68*y^6 + 12*y^4 -4*y^2 -1;

p(y):=RandomTools[Generate](polynom(integer(range=1..20), y, degree=10));

Sol:=[solve(g(y))];

is(subs(y=Sol[3], p(y)*g(y))=0);

 

 

The set of points  z  is a circle of radius 3 centered at point  -3+2*I . The set of points  w  is this circle translated by the vector  1+3*I .

restart;

Set:=abs(z+3-2*I)=3:

A:=plots[implicitplot](subs(z=x+I*y,Set), x=-10..5,y=-5..10, color=red, thickness=2): # set of points z

w:=solve((x+I*y) - z = 1 +3*I, z):

B:=plots[implicitplot](subs(z=w,Set), x=-10..5,y=-5..10, color=blue, thickness=2): # set of points w

plots[display](A,B, scaling=constrained); 

 

 

Solution of the equation:

solve({2*sin(2*((1/180)*x*Pi)) = 1, x >= 0, x <= 360}, AllSolutions, Explicit);

                                  {x = 15}, {x = 195}, {x = 75}, {x = 255}

 

Plotting of graphs  y=2*sin(2*x)  and  y=1 :

plot([2*sin(2*((1/180)*x*Pi)), 1, [15, t, t = 0 .. 1], [75, t, t = 0 .. 1], [195, t, t = 0 .. 1], [255, t, t = 0 .. 1]], x = 0 .. 360, color = [red, blue, black $ 4], thickness = [2, 2, 1 $ 4], linestyle = [1, 1, 3 $ 4], tickmarks = [[15 = "15", 75 = "75", 195 = "195", 255 = "255"], default]);

 

 

Of course,  n = 11  is also the answer  because  the original problem statement does not say that the maximum should be unique.

Carl's solution has 2 disadvantages:
1) Unimodality of the function  C(n,k)  is not proven.
2) The Carl's method does not work for  large  k ,  for example for  k = 50  we have:

C:= (n,k)-> binomial(n,k)*2^k:

fsolve({eval(diff(C(n,k),k), k=50)}, n= 50..infinity);

       fsolve({1125899906842624*(-Psi(51)+Psi(n-49))*binomial(n,50)+1125899906842624*binomial(n,50)*

               ln(2)},n,50 .. infinity)

 

I propose a simple solution that is different from all previous decisions and makes it easy to solve the problem for any . We consider only integers  n>0  and  0<=k<=n . First we prove that the numbers  C(n,k) (in Carl's notation)  behave similarly binomial coefficients and for each fixed n we find the value  k  for which the function  C(n,k)  reaches its maximum value.

Consider the quotient  C(n,k+1) / C(n,k) . It is easy to check that it is equal to  2*(n-k)/(k+1) . Comparing this number with 1, it is easy to make the following conclusions:

1) If  k=(2*n-1)/3  is integer then  C(n,k)  has 2 maximums at  k  and  k+1

2) If  k=(2*n-1)/3  is fraction  then  C(n,k)  has 1 maximum at  k=ceil( (2*n-1)/3)

From above it follows easily that the required numbers  n  for a given  k  are the integer solutions of the system

{(2*n-1)/3>=k-1, (2*n-1)/3<=k}

 

Two examples:

isolve({(2*n-1)/3>=7, (2*n-1)/3<=8});  # Solution of original problem

isolve({(2*n-1)/3>=49, (2*n-1)/3<=50});

                              {n = 11}, {n = 12}

                              {n = 74}, {n = 75}

 

 

 

q:=T-> sin(T)*_C2+cos(T)*_C1-(1/3000)*Pi*(4012562293500*Pi^3*cos(T)^3-32100498340000*Pi^3*cos(T)^2-3009421720125*Pi^3*cos(T)+16050249170000*Pi^3+435778855000*Pi*cos(T)^2-217889427500*Pi-3539762622):

solve({q(0)=0, D(q)(0)=0});

 

 

In Maple function definition is not provided as a subset of the Cartesian product with special properties. This can be done with a simple procedure.

Definition of a function  if  it is specified as a set of ordered pairs:

f:=proc(x)

local i;

for i in S do

if i[1]=x then return i[2]  fi;

od;

end proc:

 

Your example:

S:={[1,2], [2,a], [3,b]}:

f(1); f(2); f(3);

         2

         a

         b

 

 

 

Finding a monomial with the maximum coefficient:

restart:

expand((1+2*x)^12,x);

L:=convert(PolynomialTools[CoefficientVector](%,x), list); # full list of coefficients

M:=max(L);

op(map(t->t-1, [ListTools[SearchAll](M, L)])); 

 

Edited: solution of the problem:

K:=[]:

for n from 1 do

expand((1+2*x)^n,x);

L:=convert(PolynomialTools[CoefficientVector](%,x), list); 

M:=max(L);

S:=map(t->t-1, [ListTools[SearchAll](M, L)]);

if 8 in S then K:=[op(K),n] fi;

if nops(K)=2 then break fi;

od:

K;

                               [11, 12]

convert((x^2+5*x+9)/(x+2), parfrac);

 

x+3  is  the quotient and  3  (in the numerator)  is the remainder. 

 

restart;

a:=-7:  b:=2:  c:=9:

solve(a*x^2+b*x+c=0, x);

                         -1,  9/7

 

Another way (without assignment):

restart;

simplify({eval(solve(a*x^2+b*x+c = 0, x), {a = -7, b = 2, c = 9})});

                        {-1,  9/7}

! have not any problems with your expression:

expr := a*ln(u) + b*ln(u) + a*ln(v)+b*ln(v);

collect(expr, [ln(u), ln(v)]);

                  expr := a*ln(u)+b*ln(u)+a*ln(v)+b*ln(v)


                               (a+b)*ln(u)+(a+b)*ln(v)

c := a+I*b;

 ``(Re(c^2))+I*``(Im(c^2))  assuming a::realcons, b::realcons;

 

1)  Maple does not know that you assume that  a  and  b  are real numbers.

2)  Construction  ``(...)  prevents the disclosure of the parentheses.

 

poly := x^2*y+x*y*z+x*z;

poly1:=0:

for i in [op(poly)] do

if degree(i, x)=2 then poly1:=poly1+subs(x=a+b, i) else

if degree(i, x)=1 then poly1:=poly1+subs(x=c+d, i) else

poly1:=poly1+i; fi; fi;

od:

poly1;

 

 Another way:

poly := x^2*y+x*y*z+x*z;

map(t->`if`(degree(t, x)=2,subs(x=a+b,t), `if`(degree(t, x)=1,subs(x=c+d,t), t)), poly);

 

 

First 238 239 240 241 242 243 244 Last Page 240 of 289