## 13613 Reputation

19 years, 254 days

## Wrapping II...

@nm Wrapping works in your rule0 example:

```restart;
applyrule(f(A::anything)+f(B::anything) = f(A)+1/2*f(B),f(A)+f(B));
eval(%,f=(x->x)); # A+B/2
```

## An option for count max...

@nm Since you can in fact look at the procedure I did that and allowed myself to change its input to this:

`ap:=proc (_rules, expr,count::nonnegint:=100)`

Notice the default for count. Then I introduced a local variable j. The 'while' do loop I changed to

```j:=0;
while answer <> i and j<count do
j:=j+1;
et cetera```

Then I did:

```rule0:=A::anything+B::anything = A+1/2*B;
ap(rule0,A+B,1); # Result 1/2*A+B
ap(rule0,A+B,5); # Result1/16*A + 1/2*B
ap(rule0,A+B); # Result 1/633825300114114700748351602688*A + 1/2*B
### You wanted A+1/2*B
### Now your first rule (the_rule)
rule1:=A::anything+B::anything = A*B;
ap(rule1,A+B,1); # B
ap(rule1,A+B,2); # 0
```

applyrule is copyrighted so I don't bring the rest.
So making applyrule stop is easy, but it won't help in these cases.

## Wrapping in some unassigned f...

@nm Inspired by the link you gave I noticed that it helps for the_rule to be wrapped in some unassigned f as here:

```restart;
rule1:=A::symbol+B::symbol=A*B;
rule2:=map(x->map(_f,x),rule1); # Wrapping in _f
res:=applyrule(rule2,map(_f,a+b));  # Also wrapping the input in _f
eval(res,_f=(x->x)); # Evaluating res at _f = the identity operator.
```

It works the same for the types 'name', 'algebraic', and 'anything'.

## Wondering...

Since your name is clearly Danish, I wonder if you are using packages or anything from a Danish university or school?
The reason I ask is that there has been quite many similar problems coming from Danish schools or universities, e.g. DTU.
In my opinion your only hope is that the eminently capable user acer will find time to look at your file.

## Assumptions in a set or list...

I don't see any documentation for putting assumptions in a set or list.
I tried this:

```restart;
ode:=diff(diff(y(x),x),x)+diff(y(x),x)^2+diff(y(x),x) = 0;
ic:=y(0) = 0;
sol:=y(x) = -ln(exp(x))+ln(-1+_C1*exp(x))-ln(-1+_C1);
odetest(sol,[ode,ic]) assuming {_C1>0};
simplify(sqrt(x^2)) assuming {x<0};
sol2:=dsolve({ode,ic});
odetest(sol2,[ode,ic]) assuming {_C2>0};
```

and got this (type of) response:

Error, (in assuming) when calling 'assume'. Received: '{0 < _C1} is a set without a property; it is not a valid assumption'

Maybe you could give an example of an actual use of a nonempty and relevant assumption enclosed in a set.

## Gray boxes...

@Oliveira When you write something you will see (as I do at this moment) a bunch of icons in two rows.
Go to the second row. Click on the fourth from the end. It looks somewhat like this < >.
Now doing it:

`Something;`

## Converting error.mw into error.mpl...

First I removed all ouput by doing Ctrl+D.
Under the "Files" tab I then tried "Export as ..." and chose Maple Input (.mpl).
On my computer that file opened in NotePad++ , which is free to download, and in my view excellent.
The file looked like this:

```# Using the Expression palette:
#
cos(5.) ;
NULL;
# Using the Expression palette:
NULL;
sqrt(4);
# Using Command Completion:
NULL;
sqrt(4);
NULL;```

Because I always use Worksheet mode and Maple 1D input, I chose to copy that code and paste it into error.mw under the present content in that file.
The result is this after executing the whole sheet (using !!!):
Error_gone_via_mpl.mw

PS. Using NotePad++ as before but removing "NULL;" using Find and replace all, where you just have an empty box for 'Replace by' you get a neater looking input:

Error_gone_via_mpl2.mw

PPS. Exporting as text and then using Notesblok (Danish for NotePad, same text editor).
Then removing besides what is mentioned above also '>'  and proceeding as above, works too.

## Using a regular procedure definition ins...

@mmcdara My immediate reaction to this is that it looks more confusing.
To me a less complicated looking way to achieve the same flexibility would be something like this:

```restart;

fp:=proc(A::Vector,F::Vector,Theta::Vector) local n, i,x;
if not nops(numelems~({A,F,Theta}))=1 then error "The three vectors in input must be the same size" end if;
n:=numelems(A);
end proc;
#####
f:=fp(<1,2,3>,<7,9,13>,<-3,89,5.>); #Example
f(8.9); # Test
plot(f,0..30); #Test
fp(<6,7,8>,<6,8>,<4,5,9>); #Check of error message
```

## Two values of w...

@WA573 There are two values of w in the solution!
You can write the solution as a linear combination instead:

That the image has &* instead of plain * is done to prevent the scalars from going back inside.
The work was actually done in Maple, but copied as an image.

## An embarrassment...

This infamous warning coming overwhelmingly from Danish students has been an embarrassment to Maple for years and years.

Your only hope is that someone like MaplePrimes user acer will have a look at your worksheet. He has helped quite a few over the years.
Godt Nytår!

## No content...

I see no content except four rectangles.

## Maple 2022.2 OK too...

@Kitonum On my computer with Maple 2022.2 the computation took only 0.047 seconds.

I started by just copying from the code as written in the question. (Only changing LinearSolve to LinearAlgebra:-LinearSolve as you did).
It went fine and with no errors. So there aren't any syntax errors in his code.

## 1/x = 0...

Maple's solve returns NULL on 1/ x = 0:

`solve(1/x=0,x);`

Mathematically, that is what I would expect: Infinity is not a real number.

## Customer Service...

You need to contact Customer Service via maplesoft.com.

They will probably require that you uninstall the existing version from your old computer.

## Yes...

@tomleslie Certainly simpler. My sneaking suspicion because of their being two loops is that he wanted this:

```restart;
n:=5:
M:=Matrix(n,n);
for i from 1 to n do
for j from  1 to n do
M[i,j]:=sin(i*j)
end do
end do:

M;
```

Thus in the simpler way:

```restart;
R:=Matrix(5,5,(i,j)->sin(i*j));```

 First 12 13 14 15 16 17 18 Last Page 14 of 229
﻿