## 20374 Reputation

16 years, 35 days

## combinat:-setpartition...

```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. He...

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);```

## lightmodel...

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);
```

## Domains of functions...

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);
```

## fsolve...

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
 >

So should be  N>=32

## Syntax...

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:

 (1)

 (2)

## Procedure for this...

```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

## Re...

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);```

## In 1d math input...

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

````&approx;`(a, b);
```

## Option...

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];
```

## A way...

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));```

## A way...

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:

## Multiple assignment...

Probably this can be done in different ways. Below is one way:

 (1)

Here is another way in which variables and parameters are specified not by sets, but by lists. This allows us to maintain their order in the way we want, and not as Maple chooses:

 (1)

I'm used to always ending the line, the result of which should be displayed, end with a semicolon:

```# Using the Expression palette:

cos(5.);

# Using the Expression palette:

sqrt(4);

# Using Command Completion:

sqrt(4);

```

```restart:
with(geometry):
with(plots):
_EnvHorizontalName = 'x':
_EnvVerticalName = 'y':
R := 5:
ang := [3/4*Pi, -(3*Pi)/4, -Pi/6,4*Pi/9]:
seq
( point
( `||`(P, i),
[ R*cos(ang[i]), R*sin(ang[i])]
),
i = 1 .. 4
):
seq
( dsegment
( `||`(seg, i),
[ `||`(P, i),
`||`(P, irem(i, 4) + 1)
]
),
i = 1 .. 4
):
triangle(Tr1,[P1,P2,P4]):
EulerCircle(Elc1,Tr1,'centername'=o1):
triangle(Tr2,[P1,P2,P3]):
EulerCircle(Elc2,Tr2,'centername'=o2):
triangle(Tr3,[P3,P2,P4]):
EulerCircle(Elc3,Tr3,'centername'=o3):
triangle(Tr4,[P1,P3,P4]):
EulerCircle(Elc4,Tr4,'centername'=o4):
circle(cir, [point(OO, [0, 0]), R]):
ngon1 :=[P1,P2,P3,P4]:

poly1:=polygonplot(coordinates~(ngon1),color=blue,filled=true):
ngon2 :=[P1,P2,P3,P4]:
poly2:=polygonplot(coordinates~(ngon2),color=yellow,filled=true):
display
(draw
( [P1(color = black, symbol = solidcircle, symbolsize = 12),
P2(color = black, symbol = solidcircle, symbolsize = 12),
P3(color = black, symbol = solidcircle, symbolsize = 12),
P4(color = black, symbol = solidcircle, symbolsize = 12),
o1(color = black, symbol = solidcircle, symbolsize = 12),
o2(color = black, symbol = solidcircle, symbolsize = 12),
o3(color = black, symbol = solidcircle, symbolsize = 12),
o4(color = black, symbol = solidcircle, symbolsize = 12),
seg1,
seg2,
seg3,
seg4,
Tr1(color=green),Tr2(color=green),Tr3(color=green),Tr4(color=green),
Elc1,Elc2,Elc3,Elc4,
cir(color = blue)]

),
textplot
( [ seq
( [ coordinates(`||`(P, i))[],
convert(`||`(P, i), string)
],
i=1..4
)
,
seq
( [ coordinates(`||`(o, i))[],
convert(`||`(o, i), string)
],
i=1..4
)]
,

align=[above, right]
)
,
axes=none
);
```

 First 7 8 9 10 11 12 13 Last Page 9 of 282
﻿