Preben Alsholm

11664 Reputation

22 Badges

15 years, 227 days

MaplePrimes Activity

These are replies submitted by Preben Alsholm

@vv Thank you, this is very interesting. I shall keep looking into this.

@Carl Love Your statement, " Operations between exact rationals get done first. " confuses me.

Consider the results of the following sums.

(10^12+1e-12)-10^12; # 0.
10^12+(1e-12-10^12); # 0.
10^12+1e-12-10^12;   # 0.
10^12-10^12+1e-12;   # 1e-12
'10^12-10^12+1e-12'; # 1e-12
'10^12+1e-12-10^12'; # 0.
(a+f)-a; # 0.
a+(f-a); # 0.
a+f-a;   # 0.
a-a+f;   # 1e-12
'a-a+f'; # f
'a+f-a'; # f
%;       # 1e-12

If operations between exact rationals were done first then we should be getting 1e-12 (or f) in all the cases or what?

I must be misunderstanding you.

@Axel Vogt You wrote:
NB: For me the following is a bug:

evalf[2](1014 - 1007);


But automatic simplification kicks in before evalf can do anything.

'1014 - 1007';

evalf[2]('1014 - 1007');

Thus this is not a bug. (The same with floats instead).

With m=1 adding the general dsolve option event_doublecross=1e-8 (or whatever) appears to help.

See ?dsolve, events under Event triggering (details).

In the proces of downloading your file Maple 2019.2.1 came up with a window with the title:
"Recover Corrupt File and Save As".

It suggested a name having the number 1 attached to your file's name.

That froze Maple. I had to use Ctrl+Alt+Del to shut down Maple.

I did this once again and the same thing happened.

Trying to load the "recovered" file had the same effect.

PS. It is safe to open your original file as well as the "recovered" file in a text editor like NotePad.

Your file takes up 13023 KB; the "recovered" takes up 5574 KB.

It would be an oddity if two keyword arguments both had effect as is implied in your display example.

In the help page "Argument Processing" under "Keyword Matching" we find the statement:

"Whenever a matching keyword parameter is encountered, the right-hand side of the equation becomes the value for that parameter, and the equation is removed from further consideration as an argument. If more than one keyword argument matches a keyword parameter, only the last one takes effect."

This is taken from Maple 2019.

I tried the following 3 different display versions:


In Maple 2019 the first two outputs were identical so follows the rule as explained in the passage I quoted above.

In Maple 8, however, all three outputs were clearly different.

@ecterrab I observed the following behavior when trying to install Physics Updates 426 and  428 from the cloud.

Downloading finished, but installing didn't seem to ever finish. In both cases I ended up closing Maple.

After opening again it appeared in both cases that the update was installed.
It would be more comforting if the window would report "Finished" or equivalent.

@dharr In Maple 12 I tried your code. The only problem came from writedata since cat(currentdir(),"/testfile.txt" )

came up with "C:\Program Files\Maple 12/testfile.txt".

@vv Yes, your last comment is worth mentioning:

to N do
  c:=r(): b:=c*r(): a:=b*r(); n:=rn():
  if (fn) then OK:=OK+1 else ex:=[a,b,c,n]; break fi
'OK'=OK,'N'=N, 'counterexample'=ex;
fn; #seeing the false inequality

Since the counter example is found for n=1 it is worth looking at the inequality for n = 1.
There for b > a it is equivalent to a+b > c, which is obviously not a consequence of the assumptions a<b<c.

@torabi Supposing that your initial conditions are really meant to contain the function itself and its first and second time derivative, then the syntax would be:

ics := T(x, 0) = 300, D[2](T)(x, 0) = 0, D[2, 2](T)(x, 0) = 0;

and a numeric approach could start with:

pde :=  10*diff(T(x, t), x, x) +9.000000000*10^(-10)*diff(T(x, t), x, x, t) = 1200.0*diff(T(x, t), t) + 1.020000000*10^(-8)*diff(T(x, t), t, t) + 4.335000000*10^(-20)*diff(T(x, t), t, t, t);
bcs := T(0, t) = 300, T(10, t) = 300;
ics := T(x, 0) = 300, D[2](T)(x, 0) = 0, D[2, 2](T)(x, 0) = 0; 

This produces a rather puzzling error though, probably having to do with an internal rewriting as a first order system in time.
Now trying that ourselves (and using part of the code above):

ics_sys := T(x, 0) = 300, T1(x, 0) = 0, T2(x, 0) = 0;

This produces, however, the error:

Error, (in pdsolve/numeric/par_hyp) input system is too far from a 'standard' form (see ?pdsolve,numeric for more detail)

So you are out of luck, it seems.



@sarniberliana You can actually find an explicit formula for what Carl called F.

It involves LambertW. With that explicit representation you can test the results found by implicitdiff.
Here is a not very elegant way of doing that:


Sys:= {
   F = 
   c = exp(exp(x*beta)*(r-1)/(1+varphi*exp(x*beta))),
   ln(r) = varphi*exp(x*beta)*(r-1)/(1+varphi*exp(x*beta))-1
Vars:= {F, c, r}(beta, varphi, x);
## The derivative of F w.r.t. beta in terms of c, r, beta, varphi, and x:
Fbeta_imp:=rhs(op( implicitdiff(Sys, Vars, {F}, beta) ));
## Now solve the system:
## An explicit formula for the derivative w.r.t. beta:
Fbeta:=diff(F2,beta): # Large
## Another explicit formula for the derivative w.r.t. beta is obtained from the implicit version:
Fbeta_imp2:=eval(Fbeta_imp,sol): # Large
resB:=simplify(Fbeta_imp2-Fbeta,size); ## Hopefully this is actually zero, but ...
evalf[20](eval(resB,{x=1.234,beta=2.9,varphi=3.7})); # A spot check

@itsme Yes, the space(s) to the left of the escape character \ is(are) ignored by the translator so you get function application:

convert("a \[lambda]",FromMma);

The output is a(lambda), thus in case a = 2 you get 2.

@Mariusz Iwaniuk 
Actually your computations work if you just assume a>0 and n>1/2.
Also Maple returns a result right away with those assumptions:

A:=Int(ln(a^2+x^2)/(a^2+x^2)^n, x = 0 .. infinity);
res:=value(A) assuming a>0,n>1/2;

The result returned appears to be only valid for 1/2 < n < 1 though.
If you add that assumption, i.e. do

value(A) assuming a>0,n>1/2,n<1;

then the result looks shorter. If you try n >1 instead then the integral is returned unevaluated.

Your worksheet only contains this input:

w := 1/2*(beta*eta^2*y + 2*eta^2*y + 2*A*beta + 2*A)/kx + C1*exp(k*y) + C2*exp(-k*y) + C3*exp(-I*k*y) + C4*exp(k*y*I);

I don't see any ode or BCs.

@mmcdara In order to avoid the existence of several local variants of a variable place all assumptions at the beginning, at least before making assignments involving the variables in the assumptions.
As in

assume(r > 0,R>0,R>=r,x__Q>0,d>-R-2*r,d<R);

But I much prefer using assuming rather than assume. Then you don't have that kind of problem.
The assume facility is not perfect either, of course.
Using assuming in your second attempt:

_EnvHorizontalName := x: _EnvVerticalName := y:
circle(A,[P, R]) assuming R>0;


4 5 6 7 8 9 10 Last Page 6 of 201