## 610 Reputation

14 years, 256 days

## Use NULL....

@Luca3544 Are you trying to make your procedure to do a print out of a search? If so then attach "NULL;" as last statement to the procedure code.

M := proc(a)
local Grundstof, c;
description "Side 302, 303";
c := convert(a, string);
Grundstof := [(1.0079*g)/(mol) + "H", (4.0026*g)/(mol) + "He",
(6.941*g)/(mol) + "Li", (9.0122*g)/(mol) + "Be", (g)/(mol),
(10.811*g)/(mol) + "B", (12.0107*g)/(mol) + "C", (14.0067*g)/(mol) + "N",
(15.9994*g)/(mol) + "O", (18.9984*g)/(mol) + "F", (22.990*g)/(mol) + "Na",
(24.305*g)/(mol) + "Mg"];
# (proc(E, n, s) if has(E, s) then print(E); n fi end)~(Grundstof, [\$1..nops(Grundstof)], c);
# or
map(proc(n, c) if has(args) then print(n) fi end, Grundstof, c);
NULL;
end proc;

## Include the index....

That should be "assuming 0 < k[2];"

I do not believe you can define an assumption like "for all i k[i] is positive".

## See ?unapply...

f1 := unapply(diff(g1, x), x);

or

gf := unapply(g1, x);
f1 := D(gf);

Thumb if You like.

## Geometry module....

This should be:

geometry:-RegularPolygon(gon,5,geometry:-point(o,1,1),2);
#or
use geometry in RegularPolygon(gon,5,point(o,1,1),2) end use;

Thumb if You like.

Deleted.

## One attempt:...

If this does not work please let me know:

``` F1 := (X, Y) -> [X, Y+abs(X*K+sin(ap))/abs((X*K+sin(ap))^2-1)^(1/2)];

plottools[transform](F1)(p1);
```

Thumb if You like.

## Use assume....

First convert to piecewise. D(abs)(x) is defined as abs(1, x) and is undefined at x=0. Avoid 0 of the abs function like this:

```collect(diff(I2, c), abs, normal);
evalindets(%, 'abs(1, anything)', x -> normal(convert(x, piecewise, c))) assuming (c<>-1, c<>-0.9, c<>.9000000000, c<>1);

#or

diff(convert(I2, piecewise, c), c):
map(collect, normal(%), ln, normal@simplify) assuming (c<>-1, c<>-0.9, c<>.9000000000,c<>1);
```

Thumb if You like.

## What result are you anticipating?...

I am assuming that the answer I got from Maple is correct.

```restart;
with(Student:-MultivariateCalculus);
A := [0, 0, 0];
B := [c, 0, 0];
S := [x, 0, z];
solve([Distance(S, A) = a, Distance(S, B) = b], [x, z], explicit = false) assuming (a > 0, b > 0, c > 0);
```

Perhaps the answer expected is meant to include the domain of real solutions (?). Then:

```restart;
with(Student:-MultivariateCalculus);
A := [0, 0, 0];
B := [c, 0, 0];
S := [x, 0, z];
Q := a > 0, b > 0, c > 0;
solve([Distance(S, A) = a, Distance(S, B) = b], [x, z], explicit = true);
ANS := (R -> [R, map(solve @ `union`, [solve]([op(evalc(subs(R, [Im(x), Im(z)])) assuming Q), Q]), {Q}) ]) ~ (%);
%[1];
```

The result given is:
[x = (1/2)*(a^2-b^2+c^2)/c, z = (1/2)*(-a^4+2*a^2*b^2+2*a^2*c^2-b^4+2*b^2*c^2-c^4)^(1/2)/c]
[{a = -b+c, 0 < b, 0 < c, b < c}, {0 < b, 0 < c, a < b+c, b < c, -b+c < a}, {a = b+c, 0 < b, 0 < c, b < c}, {b = c, 0 < a, 0 < c, a < 2*c}, {a = 2*c, b = c, 0 < c}, {a = b-c, 0 < c, c < b}, {0 < c, a < b+c, c < b, b-c < a}, {a = b+c, 0 < c, c < b}]
[x = (1/2)*(a^2-b^2+c^2)/c, z = -(1/2)*(-a^4+2*a^2*b^2+2*a^2*c^2-b^4+2*b^2*c^2-c^4)^(1/2)/c]
[{a = -b+c, 0 < b, 0 < c, b < c}, {0 < b, 0 < c, a < b+c, b < c, -b+c < a}, {a = b+c, 0 < b, 0 < c, b < c}, {b = c, 0 < a, 0 < c, a < 2*c}, {a = 2*c, b = c, 0 < c}, {a = b-c, 0 < c, c < b}, {0 < c, a < b+c, c < b, b-c < a}, {a = b+c, 0 < c, c < b}

From the above we have abs(b-c) < a < b+c.

Thumb if You like.

## Coeffs....

Haven't you answered this one in previous posts already? Try something like this:

```E := {x, sin(x), ln(y), ln(x+y), exp(z)};
P := randpoly(E, degree=4,terms=8);
F := P -> frontend(proc(E, x) local c; [coeffs(collect(E, x, distributed), x, 'c')], [c] end, [P, indets(P, {'ln(anything), exp(anything)'})], [{Non}(function), {}]);
F(P);
F(expr);
```

Thumb if You like.

## Sample object....

I am guessing, but this might be the only way:

```null_record:=Record(name, age);
foo:=proc() #some proc that uses same Record layout
global myrecord;
local S:=Record[null_record]();
S:-age:=20;
return S;
end proc:
```

You may want to look at packed option.

Thumb if You like.

## One point....

Never mess with builtin functions like D. Use d instead.

```restart: with(plots):
alias(c[0]=c0, c[1]=c1, c[2]=c2);
PDE:=diff(C(x,t),t)=d*diff(C(x,t),x,x);
IBC:={C(x,0)=cx0, C(0,t)=ct0, D[1](C)(10,t)=0};
ct0:=1;
cx0:=0;
d:=1;
pds:=pdsolve(PDE,IBC,numeric);
L1:=[0.01, 0.1, 1, 5, 10];
L2:=[red, green, yellow,  blue, magenta, black];
for i from 1 to 5 do
pn[i] := pds:-plot(t=L1[i], color=L2[i]):
end do:
display({seq(pn[i], i=1..5)}, title=`Numerical solution at t=0.01, 0.1, 1, 5, 10`);
```

## RLC....

So that is supposed to be the RLC circuit?
If you need then this is from google: https://en.wikipedia.org/wiki/RLC_circuit

L*(diff(x(t), t, t)) + R*(diff(x(t), t)) + (x(t))/(C) = 0;
dsolve(%);

I presume all the other questions You posted are solve the same.

Thumb if You like.

## Subsop....

subsop(1=1, expr); #for multiplication