16 years, 8 days

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

```restart;
with(geometry):
with(plots):
_EnvHorizont:lName = 'x';
_EnvVerticalName = 'y';
Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc;
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);
pts:=[seq(P || 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'=o);
circle(cir, [point(OO, [0, 0]), R]);
dist := proc(M, N) sqrt(Vdot(M - N, M - N)); end proc;

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),seg1,
seg2,seg3,seg4,Tr1,Elc1,
cir(color = blue)]),
textplot([seq([coordinates(`||`(P, i))[], convert(`||`(P, i), string)],i=1..4)], align = [above, right]), axes = none);
```

I fixed some bugs in your code:

```restart;
with(geometry):
with(plots):
_EnvHorizontalName = 'x':
_EnvVerticalName = 'y':
Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc:
R := 5:
ang := [2/3*Pi, -3*Pi*1/4, -Pi*1/6]:
seq(point(`||`(P, i), [R*cos(ang[i]), R*sin(ang[i])]), i = 1 .. 3):
seq(dsegment(`||`(seg, i), [`||`(P, i), `||`(P, irem(i, 3) + 1)]), i = 1 .. 3):
circle(cir, [point(OO, [0, 0]), R]):
dist := proc(M, N) sqrt(Vdot(M - N, M - N)); end proc:
display(draw([P1(color = black, symbol = solidcircle, symbolsize = 12),
P2(color = black, symbol = solidcircle, symbolsize = 12),
P3(color = black, symbol = solidcircle, symbolsize = 12),
cir(color = blue)]),
textplot([[coordinates(P1)[], "P1"],
[coordinates(P2)[], "P2"],
[coordinates(P3)[], "P3"]], align = [above, right]), axes = none);

```

## Plotting curves in the space...

1. You are trying to plot a curve in space as the intersection of two implicitly defined surfaces. The plotting of such lines is based on sign changes. But in your example, these 2 surfaces only touch each other, i.e. no sign changes.
2. Lines in space are best plotted using the  plots:-spacecurve  command, in which the line is given by its parametic equations.

```restart;
P1:=plots:-implicitplot3d( [x^2 + b*x + c=0 , b^2 - 4*c=0], b = -4..4, c = -4..4, x = -4..4, style=surface, color=["Green","Yellow"],grid=[50,50,50]):
P2:=plots:-spacecurve([b, b^2/4, -b/2], b = -4..4, color=red, thickness=5, view=[-4..4,-4..4,-4..4], labels=[b,c,x]):
plots:-display(P1, P2);
```

## Numerical solution...

```restart;
sol:=dsolve({diff(y(x),x,x)+2*diff(y(x),x)^2+8*y(x)=0, y(0)=0 , D(y)(0)=1}, numeric);
plots:-odeplot(sol,[x,y(x)], x=0..10);
```

## InertForm:-Display...

```restart;
for oo to 2 do
M[oo] := InertForm:-Display(EI/L,inert=false)*(4*theta(oo) + 2*theta(oo + 1));
end do;```

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