Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Carl Love I quite agree. I don't get those warnings though. My setting for warnlevel is 3 (the default).
I wonder why nm gets them and I don't.

convert(179.9087476,'units','arcdeg','rad');

 

@nm You can submit a bug report directly from MaplePrimes:
Go to the top of the page just under the MaplePrimes heading.
There you find the horizontal list starting with Questions and ending with More.
Click on More and you will see "Submit Software Change Request".
Software Change Request (SCR) is a euphemism for bug report.

Are you able to do anything at all to begin with? Like just typing 2+2; and getting 4 when you press enter.
If not it might be a license issue. You could talk to the person at your school who takes care of such matters.

@abert Maybe another example can throw some light on this.
 

restart;
q:=proc() local z; z end proc;
q(); # returns an 'escaped' local
%-z; # z - z
z1:=q();
z1;
addressof(z1);
addressof(z);

You see that there are two different names: the global z and the escaped local also printed as z.
You could continue with this:
 

z2:=q();
addressof(z2);
z-z1-z2; # z-z-z

The idea of creating local names for use in some context is actually exemplified in a very old and undocumented procedure called `tools/gensym` ("generate (local) symbol"):
 

showstat(`tools/gensym`);

There is correspondingly this one:
 

showstat(`tools/genglobal`);

Thus if you continue with this:
 

z3:=`tools/gensym`(z);
z-z1-z2-z3; # z-z-z-z
z4:=`tools/genglobal`(z1);
z-z1-z2-z3-z4; # z-z-z-z-z0

Looking at the addresses of the global z1 and the loval it evalutes to:
 

addressof('z1');
addressof(z1);

They are different.

@nm Tho see the procedure set interface(verboseproc=3);
It responds with 1, which is the default.
Now do eval(applyrule),  print(applyrule), or lprint(eval(applyrule)).
The latter is easier to copy, Ctrl+c.
Dump that on an input line call it something (not applyrule).
Make the changes I suggested above.

@Carl Love I tried this on nm's other example rule0 :=A::anything + B::anything = A + 1/2*B:

restart;
rule1:=A::nonunit(anything) + B::nonunit(anything) = A + 1/2*B
applyrule(rule1,x+y);

This never finishes. We can make it finish by making some simple changes in applyrule as I have pointed out above.
Let ap be the name of that procedure, which has a third optional argument count::nonnegint:=100.
 

ap(rule1,x+y,1);  # x+y/2
ap(rule1,x+y,2);  # x+y/4
ap(rule1,x+y,16); # x + 1/65536*y
etc,etc

 

@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

 

@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.

@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'.

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.

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.

@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;

 

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.

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