Preben Alsholm

13603 Reputation

22 Badges

19 years, 201 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Ronny Yes, MultiSeries is implemented as a package.
Technically, this means it is a module with option package.
Executing with(MultiSeries) makes its content:
[AddFunction, FunctionSupported, GetFunction, LeadingTerm, RemoveFunction, SeriesInfo, asympt, limit, multiseries, series, taylor]

available in the short form as in this case limit.

This can be very convenient.

Even after having executed with(MultiSeries), the usual limit is still available as :-limit
 

with(MultiSeries);
limit(CylinderU(0,CylinderU(0,x)),x=0); # Fine
:-limit(CylinderU(0,CylinderU(0,x)),x=0); # The old wrong result.

 

int(A,x=0..xx,method=_RETURNVERBOSE);

The only successful are ftoc and msftoc with result xx*exp(-1/2).

The same result if simplify(A) is the input. Somewhat strange!

Well, it's somewhat better if you assume that n::posint:
 

is(G(2*n) = G(2*n + 1) + G(2*n + 2)) assuming n::posint;

Certainly checking concrete cases results in true:
 

{seq(is(G(2*n) = G(2*n + 1) + G(2*n + 2)),n=1..100)}; # a set of one element: true

 

@nm In your "counter example" dsolve returns a solution, which odetest verifies:
 

ode:=exp(diff(y(x), x) - y(x)) - diff(y(x), x)^2 + 1 = 0;
sol:=dsolve(ode);
odetest(sol,ode); # 0

If I understand you correctly, by counter example you mean an example showing that this general statement is false:
"It is always better to use PDEtools:-Solve rather than solve".

Just a remark.

dsolve(ode) returns
y(x) = Int(RootOf(-x + ln(_Z) + sin(_Z)), x) + c__1.

odetest is made so that it certainly verifies solutions coming from dsolve.
PDEtools:-Solve, odetest, and dsolve have the same author as I believe you know.

@Axel Vogt Yes, indeed. That was a long time ago.
The procedure is here:
 

PolarForm:=proc(tal::{algebraic,list,set},e::name:='useexp')
description "Input a complex number or a list or set of complex numbers. Output the polar form r*'exp'(I*v)
or, if 'useExp' is given as a second argument, r*Exp(I*v)";
local EXP;
if type(tal,{list,set}) then return map(procname,tal,e) end if;
if type(tal,specfunc(anything,polar)) 
   then 
      if e='useExp' then op(1,tal)*Exp(I*op(2,tal)) else op(1,tal)*'exp'(I*op(2,tal)) end if
   else
procname(radnormal(polar(tal)),e)
end if
end proc;

`print/Exp` := proc(z) 'e'^z end proc;
## Examples:
PolarForm(1+I);
%;
PolarForm(1+I,useExp);
%;
eval(%,Exp=exp);
PolarForm([1+I,I,5,-3+1/2*I]);
%;
PolarForm([1+I,I,5,-3+1/2*I],useExp);

Actually, I also added this simple extension of value:
 

`value/Exp`:=proc() exp(args) end proc:
### Example
PolarForm(1+I,useExp);
%;
value(%);

 

In Maple 2024 solve treats this equation the same as in Maple 2018.

@nm I happen to be in the beta forum. I'll report this as a weakness and give a link to this page.

Note: SCR submitted.

@nm In my reply I incorrectly referred to the statement listed for definite integration. I have now corrected that.
About method = _RETURNVERBOSE the statements under definite and indefinite integration are identical.

method=_RETURNVERBOSE applies all of the known methods and reports the results for each.

It is puzzling why the "default" result isn't identical to the _DEFAULT result.
So, yes, I agree that that is strange.

But try this:
 

int(integrand,x,method=default);

Output: 2*arctan(tan(1/2*x)) + 2/(tan(1/2*x) + 1)

So method = default is different from method =_DEFAULT.

Correction: The following statement is about definite integration:
In the help page for Integration Methods we find this somewhat cryptic statement:
method=_DEFAULT forces use of the default integration method.  It runs all of the integrators in sequence and returns the first answer found.

 

Under Indefinite Integration it says

method=_DEFAULT is equivalent to not specifying a method, exactly like definite and numeric integration.

But try this:
 

restart;
integrand:=sin(x)/(sin(x) + 1);
maple_result_1 :=int(integrand,x);
int(integrand,x,method=_DEFAULT);

The results are exactly the same.

Actually no assumptions are needed:
 

#But this is a solution
SOL:=y(x)=2*arctan(1+x)+Pi/2;
odetest(SOL,[ode,ic]) ;

 

@Mathrookie94 I played a little with it. Notice that the exponential terms in sol like exp(17/2500 - 17/2500*x)
can be split since exp(x+y)=exp(x)*exp(y):
Thus we can do:

expand(sol);
evalf(%);

You will see that the constant part exp(17/2500) becomes just a float.
You get
f(x) = 426.8577244 + 300.733958*exp(-0.006800000000*x) - 48.5791876*exp(-0.01020000000*x) - 620.5737973*exp(-0.003400000000*x)

Please upload a worksheet instead of or in addition to a screenshot.

Go to the fat green uparrow in the editor you use to post questions, answers, or replies.

I have seen other cases where it pays to consider a more general version.
Anyway, here are two animations in b. The first shows that of the 2 solutions found only the second solves the equation on some interval.
 

restart;
sol:=int(1/sqrt(sin(y)),y);
solve(sol=x+b,y):
res:={%};
numelems(res); #2
res1b:=simplify(eval(sol-x-b,y=res[1]));
res2b:=simplify(eval(sol-x-b,y=res[2]));
plots:-animate(plot,[res1b,x=-10..10],b=-5..5,trace=24);
plots:-animate(plot,[res2b,x=-10..10],b=-5..5,trace=24);

Here is an image of the end of animation 2:

@charlie_fcl I only had to fight to get rid of the .txt in maple.ini.txt.

When I did your worksheets ran.

1 2 3 4 5 6 7 Last Page 1 of 228