Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Algorithmus I already submitted a report in the form of an SCR (= Software Change Request).

@Algorithmus I already submitted a report in the form of an SCR (= Software Change Request).

@Algorithmus Clearly a bug!

@Algorithmus Clearly a bug!

@Carl Love In Maple ln represents a one-valued function: The principal branch. So the identity is an identity modulo 2*Pi*I:
a:=-1+I: b:=-1-I;
evalc(ln(a)-ln(b)-ln(a/b));
#Result 2*Pi*I
Since the logarithm appears in exp this is no problem.

@MartinHepperle On this page at the top the menu item 'More' has 'Submit Software Change Request'.

You don't want randomness?
If you did you could use RandomTools as in this example, which also doesn't perturb 0:

Q:=proc( p,{ span::positive := 0.1 ,
             digits::posint:=4,
             number::posint:=1,
             method::name:=logarithmic})
    local q,i;
    q:=RandomTools:-Generate(
       float(range=abs(p)*(1-span)..abs(p)*(1+span),
       :-digits=digits,:-method=method),makeproc=true);
    signum(p)*[seq(q(),i=1..number)]
end proc;
Q(10);
Q(-.09,number=8,digits=5,method=uniform);

@Carl Love Thanks!

@Carl Love Thanks!

Carl, I admit to not knowing about `?()`. Could you give me a reference?
It seems to do the same as
map(apply,gg,2);

######################
In the programming guide (3.6) I see for `?[]` the description:
"The constructor for indexed expressions is the name ?[]."
with the example
`?[]`( S, [ a, b, c ] );

So I suppose that `?()` similarly is the constructor for function application?

Carl, I admit to not knowing about `?()`. Could you give me a reference?
It seems to do the same as
map(apply,gg,2);

######################
In the programming guide (3.6) I see for `?[]` the description:
"The constructor for indexed expressions is the name ?[]."
with the example
`?[]`( S, [ a, b, c ] );

So I suppose that `?()` similarly is the constructor for function application?

I submitted an SCR yesterday following the format used. But the essence is this:
restart;
assume(mu>0,k>0,nn>0); #nn used later
s:=sqrt((k*mu)^(1/4)/x);
a:=s*(k*mu-sqrt(k*mu));
b:=s*k;
c:=sqrt(k/mu)*s;
V:=(b-a/mu)/c;
simplify(V);
map(simplify,V); #OK
simplify(eval(V,{k=213})); #OK
for x in [1,2,213,0.12345,Pi,sqrt(2),gamma,nn] do [x,simplify(V)] end do;

restart;
s:=sqrt((k*mu)^(1/4)/x);
a:=s*(k*mu-sqrt(k*mu));
b:=s*k;
c:=sqrt(k/mu)*s;
V:=(b-a/mu)/c;
simplify(V) assuming positive;
simplify(simplify(V),assume=positive);
######################################
#Actually a safer test than the first seems to me to be:
restart;
assume(mu>0,k>0,nn>0);#nn used later
for x in [1,2,213,0.12345,Pi,sqrt(2),gamma,nn,mu,mu^2,k,k^2] do
   s:=sqrt((k*mu)^(1/4)/x);
   a:=s*(k*mu-sqrt(k*mu));
   b:=s*k;
   c:=sqrt(k/mu)*s;
   V:=(b-a/mu)/c;
   print([x,simplify(V),map(simplify,V)]);
end do:



I submitted an SCR yesterday following the format used. But the essence is this:
restart;
assume(mu>0,k>0,nn>0); #nn used later
s:=sqrt((k*mu)^(1/4)/x);
a:=s*(k*mu-sqrt(k*mu));
b:=s*k;
c:=sqrt(k/mu)*s;
V:=(b-a/mu)/c;
simplify(V);
map(simplify,V); #OK
simplify(eval(V,{k=213})); #OK
for x in [1,2,213,0.12345,Pi,sqrt(2),gamma,nn] do [x,simplify(V)] end do;

restart;
s:=sqrt((k*mu)^(1/4)/x);
a:=s*(k*mu-sqrt(k*mu));
b:=s*k;
c:=sqrt(k/mu)*s;
V:=(b-a/mu)/c;
simplify(V) assuming positive;
simplify(simplify(V),assume=positive);
######################################
#Actually a safer test than the first seems to me to be:
restart;
assume(mu>0,k>0,nn>0);#nn used later
for x in [1,2,213,0.12345,Pi,sqrt(2),gamma,nn,mu,mu^2,k,k^2] do
   s:=sqrt((k*mu)^(1/4)/x);
   a:=s*(k*mu-sqrt(k*mu));
   b:=s*k;
   c:=sqrt(k/mu)*s;
   V:=(b-a/mu)/c;
   print([x,simplify(V),map(simplify,V)]);
end do:



To get a slightly more general solution you could change A to:
f:=unapply(z,x,y);
A := textplot([seq([fsolve(f(x,-3+.5*k)=L[k],x), -3+.5*k, L[k], align = right], k = 1 .. 10)]):

To get a slightly more general solution you could change A to:
f:=unapply(z,x,y);
A := textplot([seq([fsolve(f(x,-3+.5*k)=L[k],x), -3+.5*k, L[k], align = right], k = 1 .. 10)]):

First 165 166 167 168 169 170 171 Last Page 167 of 231