Preben Alsholm

MaplePrimes Activity

These are replies submitted by Preben Alsholm

Have you contacted Customer Service?
Does this only happen for plot3d?

@Zeineb Your syntax is still wrong. Please have a closer look at my code and compare it to yours.

There are problems with = instead of := and with the syntax of mod.
(assume still has the space I mentioned.

In your 2D-math you have a space between assume and (a>0 ). In 2D-math input that space is interpreted as multiplication.
So remove the space.
Furthermore, you are making assumptions on a twice. They need to be in the same call to assume:
See ?assume, where it says:
"When the assume function is used to make an assumption about an expression x, all previous assumptions on x are removed."

There are more syntactical problems, e.g. that a loop cannot run unless the upper limit (here N) is concrete.

@Kitonum plot uses numerical integration thus never sees the symbolict result.

Compare to:

G:=int(eval(sqrt(1+((k*Pi)/l*cos((Pi*x)/l))^2),{k=2,l=2}), x);
plot(G, x=0..6,discont=true);

From G you can construct a differentiable (thus continuous) F using piecewise:

plot(F, x=0..6);


Then check:

diff(F,x) assuming x<6;
simplify(%-eval(sqrt(1+((k*Pi)/l*cos((Pi*x)/l))^2),{k=2,l=2}));  # 0

@amirhadiz Using dsolve/numeric with the parameters option is better than using your current approach.
Here is what you can do:

   {-0.1*a*diff(u(z),z,z) + 
     (z-2*diff(v(z)^(-1/2),z))*diff(u(z),z)+(3-2*b*diff(v(z)^(-1/2),z,z))*u(z)= 0, 0.1*diff(v(z),z,z)+0.01*z*a*diff(v(z),z)+0.02*v(z)-u(z)*b*v(z)^(1/2)=0,u(0)=c0, v(0)=0.1, D(u)(0)=c1, D(v)(0)=0};
sol:=dsolve(ode12, numeric,parameters=[a,b,c0,c1]);
sol(parameters=[1,1,0,1]); # Setting parameters
FindSingularity:= proc(params::list(realcons), max::realcons)
     try sol(max)
     catch "cannot evaluate the solution further": 
          return lastexception[-1]
     end try;
end proc:

FindSingularity([1,1,0,1], 4);
FindSingularity([3,2,0,-1], 4);
## I would prefer not to assign to a and b. They are names appearing in dsolve.
## Thus I use aa and bb below:
for aa from 0.1 by 0.1 to 1 do
  for bb from -1 by 0.1 to 1 do 
    print(a=aa, b=bb, `singularity at` = FindSingularity([aa,bb,0,1],5))
  end do
end do;

In the loops above c0 = 0, c1 = 1 as you see.

Since I cannot reproduce the behavior you describe in any version of Maple that I have checked, I think you should tell us which version (release) you are using.

@vv  I tried doing rsolve({req, x(1)=1}, x, makeproc);   in the first worksheet by acer.

But I hadn't noticed that you used a different name (req) than his (eqa) for the recurrence relation.

What I got surprised me:  {req = 0, x(1) = 1}, x, makeproc

I was expecting either an error or a return unevaluated.
The call is sent to `rsolve/makeproc`, which returns unevaluated, but then rsolve itself strips rsolve from the result (called solution):
return op(solution)


@Jan Jensen I should point out the worst problem with the exact solution: It doesn't satisfy the initial condition given x(0) = 0, and yet odetest claims that it does:

evalf(%); # 0. = 2.664536887
odetest(sol3,[eval(ode,{k=1,a=1,b=3}),x(0)=0]); # [0,0]

The [0,0] from odetest means that (1) the ode is satisfies and (2) the initial condition is.

The blame is probably to be put on solve (not really dsolve).

@Jan Jensen To get the same use the option implicit in dsolve:

ode := diff(x(t), t) = k*(a - x(t))*(b - 2*x(t))^2;

There are problems with this approach in this case as you will find out (or have already).

So I suggest solving numerically:

res(parameters=[a=1,k=1,b=3,c=1.1]); # In this form the order is irrelevant
Q:=proc(a,b,c,k,R::range(realcons):=0..10) if not [a,b,c,k]::list(realcons) then return 'procname(_passed)' end if;
end proc;

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

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