Preben Alsholm

13728 Reputation

22 Badges

20 years, 242 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

About putting interface(ansi=true) in my maple.ini file:
It works fine in Maple 2018.1, but in earlier versions it has the effect of making output look real weird.
Thus I now use a construction I already had in place anyway to use for setting ansi=true only in versions 2018.1 and up:
 

proc() local VERSION,ns,N;
VERSION:=convert(kernelopts(version),string);
ns:=StringTools:-Search(",",VERSION); 
N:=parse(VERSION[7..ns-1]);
if N>=2018.1 then interface(ansi=true) end if;
NULL
end proc();

It seems to me to be a bug in the 2D parser. Spaces are not necessary in 1D.
If you want seq(-3...3) to mean seq(-3..0.3) and don't want to write the zero you can insert a space: seq(-3.. .3).
Similarly this returns floats: seq(-3. .. .3);

@stefanv Thank you. I had success with "Standardindstillinger" rather than "Egenskaber" (in English presumably "Preferences" and "Properties", respectively). With "Properties" the font size changed right away, but an error message showed that a shortcut couldn't be established. "Preferences" worked as you described.

I haven't been using the command line interface except for trying it as I just did again.
The first that strikes me in Windows 10 is the ridiculously small text size used. That is enough for me to quit cmaple.
I suspect that it can be made bigger, but I don't know how.

You say that highlighting is the default in Windows. Not so on my version. The command
interface(ansi);
returns false.

@nm You can use combine followed by collect:
 

restart;
f := x->3*cos(42*x*Pi);
g :=(x,t)->exp(3*t)*cos(17*x*Pi);
pde := diff(u(x, t), t)= (diff(u(x, t), x, x)) + g(x, t);
bc := (D[1](u))(0, t) = 0, (D[1](u))(1, t) = 0;
ic:= u(x, 0) = f(x);
sol:=pdsolve([pde, ic, bc]);
##
combine(sol);
collect(%,exp,factor);

 

@panke The code works just the same in Maple 12 (I don't have Maple 13 available).
The line

SOL(eventfired=[1]);

can be left out if you wish. It just shows the same result basically.

@panke I did the following in Maple 2018:
 

restart; 
ode := diff(y(x), x) = 1/(y(x)+1); 
event := [[abs(y(x)+1)-0.1e-1, halt]];
SOL := dsolve([ode, y(0) = 0], numeric, output = listprocedure, range = -10 .. 10, events = event);
SOL(-2);
SOL(eventfired=[1]);
tlast := rhs(SOL[1](last));

 

@9009134 You have a line mentioning casesplit and I tried that. From only considering the general case I ran into a contradiction with your boundary conditions:
 

restart;
L:=0.75e-4:
eq1:=0.2079268293e-3*(diff(psi(x), x, x))-101.2059621*(diff(u(x), x, x))-101.2059621*(diff(w(x), x))*(diff(w(x), x, x));
##
eq2:=0.2079248162e-3+29.57317072*psi(x)-29.57317072*(diff(w(x), x))-1.996189024*10^(-9)*(diff(psi(x), x, x))-1.996189024*10^(-9)*(diff(w(x), x, x, x));
##
eq3:=151.8089432*(diff(w(x), x))^2*(diff(w(x), x, x))+101.2059621*(diff(u(x), x, x))*(diff(w(x), x))+101.2059621*(diff(u(x), x))*(diff(w(x), x, x))-0.2079268293e-3*(diff(psi(x), x, x))*(diff(w(x), x))-0.2079268293e-3*(diff(w(x), x, x))*(diff(psi(x), x))+29.57317070*(diff(w(x), x, x))-29.57317072*(diff(psi(x), x))-1.996189024*10^(-9)*(diff(psi(x), x, x, x))-1.996189024*10^(-9)*(diff(w(x), x, x, x, x))-p*(diff(w(x), x, x));
sys:={eq1,eq2,eq3}:
bcs:=psi(0) = 0, psi(L) = 0, D(psi)(0) = 0, w(0) = 0, w(L) = 0, D(w)(0) = 0, D(w)(L) = 0, u(0) = 0, u(L) = 0;
with(DEtools):
res:=casesplit(convert(sys,rational),[u,w,psi]):
nops([res]); # 5
for i from 2 to 5 do res[i] end do; #Special cases (of interest?)
SYS:=op(1,res[1]); #The general case
indets(SYS,specfunc(diff)); #Out of curiosity
indets(sys,specfunc(diff));   #Out of curiosity
## The following leads to a contrdiction:
eval[recurse](convert(SYS[1..2],D),{x=0,bcs});

The output incudes the equation 0 = 27224/3872072675.

@digerdiga Don't expect to be enlightened by the information from infolevel[int] unless you already know quite a lot about methods for indefinite integration. If you are really interested there is a book by Manuel Bronstein, Symbolic Integration I, dealing with this topic. He also has a short tutorial: https://www-sop.inria.fr/cafe/Manuel.Bronstein/publications/issac98.pdf

The freezing that goes on is just a Maple technicality, which doesn't go to the essence of what is really going on.

@digerdiga To get some insight into what is going on try setting infolevel[int]:=5 as done here:
 

restart;
f := ((1/2-I*t)^(-s)-(1/2+I*t)^(-s))/(2*I);
fc:=evalc(f);
infolevel[int]:=5:
F:=int(f,t) assuming s>1, t>0;
Fc:=int(fc,t) assuming s>1, t>0;

It appears that the paths to the results F and Fc are quite different.

@Fabio92 Sorry, I have no experience with actually using this option.

@digerdiga That I cannot reproduce the error for ftoc and ftocms for f probably just means that I made a mistake when I wrote in my answer that " For f the "successful" methods are ftoc and ftocms as for fc, but in addition the correct meijerg.".
Whas I take back is the claim that ftoc and ftocms gives the same results for f and fc.

The results from ftoc and ftocms for fc are equal and wrong.
You use Maple 2015 I see. Also there the results for f are correct for all the three metods ftoc, ftocms, and meijerg as is shown by the result of
 

int(f,t=0..infinity,method=_RETURNVERBOSE) assuming s>1;

which is

@digerdiga FTOC: Suppose F is an antiderivative of the continuous function f on an interval I=[a,b], i.e. F'(x) = f(x) for all x  in I. Then int(f(x),x=a..b) = F(b)-F(a).
Basically I believe that is the method used: Find F and evaluate at the ends of the interval.
But the function F actually found by Maple may not be an antiderivative on all of the given interval (here [a,b] ), but only piecewise so. Thus Maple (or you) will have to change this F into a continous F1 as illustrated in this example:

f:=1/(cos(x)+2);
F:=int(f,x);
simplify(diff(F,x)); # OK generically
plot(F,x=-3*Pi..3*Pi,discont=true); # discontinuous
F1:=int(f,x=0..xx) assuming xx>Pi;
plot(F1,xx=0..3*Pi);

Another problem is that F may not be defined at one or both endpoints of the interval. Thus eval(F, x=a) must be replaced by limit(F, x=a, right) and similarly at the other end point.
An example of that is:

f:=1+ln(x);
int(f,x=0..2);
F:=int(f,x);
eval(F,x=0); #Error
limit(F,x=0,right);# Fine


 

@Carl Love Surely you are aware of the following special behavior of evalf, but I shall use the opportunity to point it out nevertheless.
evalf accepts a sequence if not actually typed in as arguments one at a time.

seq(Pi^k,k=1..7);
evalf(%); #OK
evalf(seq(Pi^k,k=1..7)); #OK
evalf(seq(Pi^k,k=1..0,-1)); #OK 
seq(Pi^k,k=1..0,-1);
evalf(%); #OK
evalf(Pi,1); # the old alternative to evalf[1](Pi)
evalf(1,2,3,4); # Error


 

@Carl Love The wrong integral has fc as integrand. So you ought to add the corresponding lines for fc. But the result is indeed correct:
 

fc:=evalc(f); # Your f
int(fc, t= 0..infinity) assuming s > 1, r > 0:
simplify(eval(%, r= 1/2));

 

First 43 44 45 46 47 48 49 Last Page 45 of 230