Kitonum

21530 Reputation

26 Badges

17 years, 84 days

MaplePrimes Activity


These are answers submitted by Kitonum

Usually I do it this way: in Maple I press  "prt sc"  key, then I paste it into the Word, then I crop it, removing the extra one.

Suppose we have a product of some members and we want members  with a lesser degree to stand in front of of the members with a greater degree. Here is the procedure that does this:

SortingProduct:=proc(Expr::{`*`,`^`})
local L, L1;
if type(Expr,`^`) then return Expr else
L:=[op(Expr)];
L1:=sort(L, (x,y)->degree(x)<=degree(y));
`*`(map(t->`if`(degree(t)<=1,t,`if`(type(t,`^`),(``(op(1,t)))^op(2,t),t)), L1)[]) fi;
end proc:


Example of use:

SortingProduct((s+1)*(s+2)^3*(s-4)*(s-1)^2*(s+5)*4*(s^2+3));

                


Edit.

   

In  plots:-matrixplot  command, the matrix must consist of numbers, not functions.

See help on this command.

Use  plots:-spacecurve  command.

Example:

plots:-spacecurve([1, t, 1], t=0..10, color=red, thickness=3, axes=normal);


In brackets - parametric equations of this line.

I called your red subexpression as Expr :

Expr:=(A^2/nu)^(1/3)*g*beta*q2[w]*sqrt(nu^2/A)*T(y, t)/((nu*A)^(1/3)*k)+(A^2/nu)^(1/3)*g*beta*T[infinity]/(nu*A)^(1/3)-(A^2/nu)^(1/3)*g*beta*V[infinity]/(nu*A)^(1/3)+(A^2/nu)^(1/3)*g*beta1*C(y, t)/(nu*A)^(1/3)-(A^2/nu)^(1/3)*g*beta1*C[infinity]/(nu*A)^(1/3);

simplify(Expr)  assuming A>0, nu>0;

                  
 

 

Using procedure  P and  Explore  command, we can investigate how the solution changes when the variable  A  is changed:

restart;
P:=proc(A)
local omega, mu, B, eq1, eq2, eq3, dsys3;
omega := -2.667; mu := 10; B := 1;
eq1 := diff(x(t), t) = omega*x(t)-y(t)^2;
eq2 := diff(y(t), t) = mu*(z(t)-y(t));
eq3 := diff(z(t), t) = A*y(t)-B*z(t)+x(t)*y(t);
dsys3 := {eq1, eq2, eq3, x(0) = 10, y(0) = 10, z(0) = 10};
dsolve(dsys3, numeric);
end proc:

Explore(plots:-odeplot(P(A), [t,y(t)], t=0..10), A=1...10.);


Addition. The same we can do by  plots:-animate  command:

plots:-animate(plots:-odeplot,['P(A)', [t,y(t)], t=0..10], A=1..10, frames=91);

   

``(s-3)*(s+2)^2;
                                     

                                     

See my procedure  NestedSeq  here

Here is it's code with a slight change:

restart;

NestedSeq:=proc(Expr::uneval, L::list)

local S;

eval(subs(S=seq, foldl(S, Expr, op(L))));

end proc:


Addition. Here is an example of applying the procedure to an amusing problem: generate the list of all the lucky tickets. A ticket (received in public transport) is lucky if in the six-digits number of which (numbers from 000000 to 999999, total 1 million different tickets) the sum of the first three digits coincides with the sum of the last three. This numerological game is very popular in Russia (see russian wiki).

T:=[NestedSeq(`if`(i+j+k=l+m+n, cat(i,j,k,l,m,n), NULL), [n,m,l,k,j,i]=~[(0..9)$6])]:  # The list of all the lucky tickets
nops(T);  # The total number of all the lucky tickets
seq(T[i], i=100..50000,2000);  # Examples of the lucky tickets

 

Edit.

 

x:=`3`:
parse(x);
                                     
3

For this example, you can use  print  command also, but only without  cat  command:

Sol1:=1/4: Sol2:=1/5: Sol3:=1/7:
print(`Solution: `*A=Sol1, B=Sol2, C=Sol3);

                                     

When we specify a function by means of a formula, it is usually assumed that the argument takes finite values. We can extend the definition of a function to infinity or to singular points if we use the  limit  function and  piecewise  function.

Example:
f:=x->sin(x)/x;
f(infinity);
limit(f(x), x=infinity);

# Or
f(0);
limit(f(x), x=0);
                                 


f:=x->piecewise(x<>0 and x<>infinity, sin(x)/x, x=0, 1, x=-infinity or x=infinity, 0);
f(0), f(infinity), f(Pi/6);
                         

 

 

 

It can be done if we replace 1/2 with 0.5 and use  cat  command:

ss1:=-2:  ss2:=0.5:  ss3:=-5:
print(`The 3 equation in A, B, C for `*s=ss1,s=ss2*` and `*cat(s,`=`,ss3,` :`));
                    

            

 

P1 := y^2 = x^3+x^2:
P2 := y = 2*x+1:
plots:-implicitplot([P1,P2], x=-2..10, y=-2..10, color=[red,blue], gridrefine=3);
map2(fsolve, [P1,P2], [{x=-1,y=-1}, {x=-0.5,y=0.5}, {x=4,y=10}]);
                           

It's easy:

Eq:=x + y*F(x)=0:
diff(Eq, x);
                                      

                                     

 

The term "Minor of a matrix A of order p" is used in two meanings:
1. As a certain square submatrix of order p of a matrix A.
2. As the determinant of this submatrix.

Two simple 1-line procedures solve problems 1 and 2.

The code of the first procedure:
Minors_submatrices:=[(A::Matrix,p::posint)->seq(seq(A(r,c), c=combinat:-choose([$1..op(1,A)[2]],p)), r=combinat:-choose([$1..op(1,A)[1]],p))]:

The code of the second procedure:
Minors_determinants:=[(A::Matrix,p::posint)->seq(seq(LinearAlgebra:-Determinant(A(r,c)), c=combinat:-choose([$1..op(1,A)[2]],p)), r=combinat:-choose([$1..op(1,A)[1]],p))]:


Examples of use:

A:=LinearAlgebra:-RandomMatrix(3,4, generator = -9 .. 9);
Minors_submatrices(A,2);
Minors_determinants(A,2);

                               
 

 

First 141 142 143 144 145 146 147 Last Page 143 of 290