Kitonum

21006 Reputation

26 Badges

16 years, 185 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;
irem(expand((2 + sqrt(3))^15 + (2 - sqrt(3))^15), 2017);

                                                    685


This number  (2 + sqrt(3))^15 + (2 - sqrt(3))^15  is actually an integer. If you expand the brackets (raise to the 15th power), then all the square roots will disappear.

restart;
V1:=Vector[row]([a*z+b*(x+I*y), -b*z+a*(x+I*y)]);
V2:=Vector([a*z+b*(x-I*y), -b*z+a*(x-I*y)]);
factor(evalc(V1.V2));
simplify(%, {a^2+b^2=1});

The  evalc  command allows you to operate on complex numbers, assuming all parameters (a, b, x, y, z) are real numbers. The signs of these parameters do not matter for this example.

You missed 2 parentheses  draw( [ ... ] )

restart:
S:= {"a", "b", "c", "d", "e", "f"}:
combinat:-setpartition(S, 3);

{{{"a", "b", "c"}, {"d", "e", "f"}}, {{"a", "b", "d"}, {"c", "e", "f"}}, {{"a", "b", "e"}, {"c", "d", "f"}}, {{"a", "b", "f"}, {"c", "d", "e"}}, {{"a", "c", "d"}, {"b", "e", "f"}}, {{"a", "c", "e"}, {"b", "d", "f"}}, {{"a", "c", "f"}, {"b", "d", "e"}}, {{"a", "d", "e"}, {"b", "c", "f"}}, {{"a", "d", "f"}, {"b", "c", "e"}}, {{"a", "e", "f"}, {"b", "c", "d"}}}

Specify the polynomial as a function. Here is an example:

restart;
P:=(a,b,c)->a^3-a^2*b+b*c;
P(b,a,c);

                                      

 

Use the  lightmodel  option. Compare 2 examples:

plot3d(x^2-y^2, x=-1..1, y=-1..1, lightmodel=light1);
plot3d(x^2-y^2, x=-1..1, y=-1..1, lightmodel=light2);

 

When solving equations or inequalities in the real domain, it is better to immediately include conditions on the domains of functions present in this system into the system:

restart;
  eqn:= log[2](x^2 - 6*x) = 3 + log[2](1 - x);
  ans:=solve({eqn, x^2 - 6*x>0, 1-x>0}, x);

                             

Use the  fsolve command for this.  The function  f(n) = 10^n /n!  is decreasing for  n>10 :


 

restart;
epsilon:=0.001;
f:=n->10^n /n!:
N:=fsolve(f(n)= epsilon, n=1..infinity);
plot([f(n),epsilon], n=25..N+2, 0..0.005, color=[red,blue]); # Visual check

0.1e-2

 

31.17012681

 

 

 


So should be  N>=32
 

Download ineq.mw

If you want to simplify an expression using Maple, then you must follow the Maple syntax. In Maple, function arguments must be enclosed in parentheses:

G[ti] := -(v[r]*cos(theta)*cos(phi)+v[r]*cos(theta)*sin(phi)+v[r]*sin(theta)*rho)*(-c^2+(1-A)*(v[phi]^2+v[r]^2+v[theta]^2-(v[r]*cos(theta)*cos(phi))^2-(v[r]*cos(theta)*sin(phi))^2-(v[r]*sin(theta))^2))/(A*c^3)

-(v[r]*cos(theta)*cos(phi)+v[r]*cos(theta)*sin(phi)+v[r]*sin(theta)*rho)*(-c^2+(1-A)*(v[r]^2+v[theta]^2+v[phi]^2-v[r]^2*cos(theta)^2*cos(phi)^2-v[r]^2*cos(theta)^2*sin(phi)^2-v[r]^2*sin(theta)^2))/(A*c^3)

(1)

simplify(G[ti])

v[r]*((v[phi]^2+v[theta]^2)*A+c^2-v[phi]^2-v[theta]^2)*((sin(phi)+cos(phi))*cos(theta)+sin(theta)*rho)/(A*c^3)

(2)

``

Download metriccalculaions_new.mw

NumberOfOccurrences:=proc(d::nonnegint,N::posint)
local L;
uses ListTools;
L:=convert(N,base,10);
Occurrences(d,L);
end proc:


Examples of use:

NumberOfOccurrences(3,1345013);
NumberOfOccurrences(9,1345013);

                                             2
                                             0

1. I did not understand why such a cumbersome construction using the  StringTools  package and loops. This can be made much shorter:

L:="[ (0, 1), (1, 2), (1, 10), (2, 3), (3, 4), (4, 5), (4, 9), (5, 6), (6, 7), (7, 8),(8, 9), (10, 11), (11, 12), (11, 16), (12, 13), (13, 14), (14, 15), (15, 16)]":
L1:=parse(L):
{seq({L1[i],L1[i+1]}, i=1..nops(L1)-1, 2)};


2.  Of course, you can iterate a function of several variables, but the dimension of the function's domain must match the dimension of the domain of this function. For example

f:=(x,y)->(x^2-y^2,x^2+y^2):
(f@@2)(x,y);

 

This can be done programmatically without using palettes in 1D input:

`≈`(a, b);

                                       

 

Perhaps for a beginner, the option using vectors will be more understandable:

restart;
A, B, C := <-3, 1, 2>, <-2, -1, 1>, <0, 3, -3>;
alpha:=[2,-1,1];
G:=(A*alpha[1]+B*alpha[2]+C*alpha[3])/add(alpha);

 

I don't see any equation in your question ( p  is a procedure not an equation). If by equation you mean  p(v)=0  (finding the zeros of  ) , then simply multiply both sides of the equation  p(v)=0  by a common denominator:

restart;
p:=v->R*T/(v-b)-a/v^2;
Eq:=p(v)=0;
Eq1:=expand(simplify(Eq*(v-b)*v^2));

                                 

Using the matrix palette, in 2D mode insert the matrix you need, and then place the cursor at the right places and replace the square brackets with vertical lines. Maple realizes that this is now a determinant, and after pressing enter key, calculates it:

First 11 12 13 14 15 16 17 Last Page 13 of 286