nm

11353 Reputation

20 Badges

13 years, 13 days

MaplePrimes Activity


These are replies submitted by nm

@mehdi jafari 

sorry, but this makes no sense. I am trying to find where the function is real.

It is Maple which is supposed to tell the interval where x is real.

If one tells it to assume x>0, then this takes the whole point out of asking Maple to find the region the function is real in x.

Here is Mathematica's answer

@Carl Love 

unfortunately your code seems to be dropping some solutions. Here is an example

restart;
sys:=x <> 0, x < infinity, -infinity < x:
solve({sys},{x});

So I expected to get the same thing using your call.

expand(thaw(solve(subsindets({sys}, suffixed(_), freeze@``) ,{x})));

The second part of the solution is gone.

I replaced all my use of solve with your code, but noticed I am losing solutions. I do not know before hand where _Z1 or such symbol will pop-up.  There is probably an easy fix, but your code is too advanced for me at this time to fully understand it to fix it myself.

 

I found the problem! It is the thaw which is throwing solution:

restart;
sys:={x <> 0, x < infinity, -infinity < x};
solve(sys,x)

solve(subsindets(sys, suffixed(_), freeze@``) ,{x})


thaw(%);

So to fix this, I added a {} like this

expand(thaw({solve(subsindets(sys, suffixed(_), freeze@``) ,{x})}));
 

 

@Preben Alsholm 

Thanks. That is a good workaround also.

@vv 

I tried your first example in Mathematica, and it can do it using Reduce command.

Reduce is really a very powerfull command. 

@Kitonum 

thanks. But could you please explain what is the difference? what is the sematic difference of writing solve({x>-infinity, x<infinity, x<>1/2}, x); vs solve(x>-infinity and x<infinity and x<>1/2, x); ?   is {x>-infinity, x<infinity}  different from x>-infinity and x<infinity?

 

Is this explained somewhere to read more about it?

 

I am answering myself.

I thought of a small trick, to make an interval around the point, using epsilon, then set epsilon=0. 

restart;
real_domain :=  x>-infinity and x<infinity:
singlarity_pt := 1/2:
sol:=solve(real_domain and not(x>(singlarity_pt-epsilon) and x<(singlarity_pt+epsilon)),{x}) assuming epsilon>0;

map(z->subs(epsilon=0,z),[sol]);

This seems like a hack for me, but I was desperate. Strange thing is that taking limit(epsilon=0) did not work. It seems Maple does not like to take limit on inqualities.

I am sure someone can come with better answer.

 

@Kitonum 

Mathematica gets this correctly

     FunctionDomain[x*Log[y],{x,y},Reals]

gives

        y > 0

But I also do not understand some of results from solve(evalc(Im(f).. method. For example, if I wanted to find the real domain of sec(x). Maple says it is all of x

restart;
solve(evalc(Im(sec(x))), {x});
               {x = x}

But that is wrong. Mathematia gets this right

FunctionDomain[Sec[x], x, Reals]

Lets take something little more complicated

restart;
f:= (x-1)*y^4/(x^2*(2*y^2-1));
solve(evalc(Im(f)), {x,y});

      
Compare to Mathematica's result

f = (x - 1)*y^4/(x^2*(2*y^2 - 1));
FunctionDomain[f, {x, y}, Reals]

Maple was supposed to be good in Math. But here it is making basic mistakes. Does Maple have anything close to Mathematica's FunctionDomain?   If not, it should. 

@tomleslie 

thanks, tried  deep copy and worked. But how did you find this in the help? I searched for help for the word "copy" before anything, and it shows only this

When I seach for what you wrote in the help page for Record, it does not find it

 

We must be using different Maple version. I am using 2018.1

 

@ecterrab 

Thank you very much for the explanation. Now it is clear.

I'll post separate question on a problem I found now.

 

@ecterrab 

Hello;

I am really confused now. When I first installed Physics from the cloud, and asked for its version, it said

              /opt/maple2018/lib/update.mla  MapleCloud version: 72

Note the location is /opt/maple2018/lib/update.mla. Now, when I updated to Physics 73, using the cloud install button, and asked for version number, now it says

Physics:-Version();

 "/home/me/maple/toolbox/2018/Physics Updates/lib/Physics   Updates.maple", 2018, April 24, 12:29 hours, version in the
   MapleCloud: 73, version installed in this computer: 73

Note  the location is now my home folder.  Why is Maple now saving the physics package in my home and not in Maple own system location as it did before?

But besides this, I followed your instructions to roll back to version 72 (since I found a new problem in version 73 which did not show in 72) and restarted, but it still says I have version 73. I was expecting it to become version 72.

I do not also understand where the number 5137472255164416 come from? I just copied what you wrote. I got a warning  also. Here is screen shot

I also restarted Maple and it is still saying I have version 73

Did I do something wrong? Why it did not install cloud version 72? or may be it did but it is showing the version on the cloud and not the version on the computer? How does one then find what version is installed on the computer other than what I did above?

Using Maple 2018.1 on Linux

thank you

Example 1, under "Improved handling of piecewise, eval/diff in the given problem" has an inconsistent boundary and initial conditions?

At x=0, initial coditions says that f should be 1.

But boundary conditions says at x=0, f is zero.

If I can provide a small improvement to the specifications of PDE's.

1) It is better to keep order of independent variables as  space first and time last,
i.e. as (x,t) in all the problems as this is much more common.

This problem uses the (t,x) order, but all others used the common order (x,t).

Having the same order for all problems reduces errors and possible confusion.

2) It makes it more clear if the initial and boundary conditions are written in two separate variables, one called ic:=... and the other called bc:=... instead of how it is currently written in one variable iv:=...

This makes it more clear to spot and read what are the initial conditions and what are the boundary conditions.

thanks

@Preben Alsholm 

Thanks. It works very well.

Thank you for the updates to pdsolve.

For example 4, Mathematica gives a simpler answer to example 4 above. Both Maple and Mathematica answers seems equivalent. I plotted them for random time and they look at the same.  So I am assuming they are both correct for now.

I tried to simplify Maple's solution but could not. Maybe you can suggest how to simplify Maple answer to look like Mathematica's.

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]);

gives

In Mathematica

ClearAll[u,t,x,f,g];
f[x]:=3*Cos[42*Pi*x];
g[x,t]:=Exp[3*t]*Cos[17*x*Pi];
pde=D[u[x,t],t]==D[u[x,t],{x,2}]+g[x,t];
bc={Derivative[1,0][u][0,t]==0,Derivative[1,0][u][1,t]==0};
ic=u[x,0]==f[x];
sol=DSolve[{pde,bc,ic},u[x,t],{x,t}]

It gives

{{u[x, t] -> (E^(3*t)*Cos[17*Pi*x])/(3 + 289*Pi^2) - 
    Cos[17*Pi*x]/(E^(289*Pi^2*t)*(3 + 289*Pi^2)) + (3*Cos[42*Pi*x])/
     E^(1764*Pi^2*t)}}

Thanks

@Carl Love 

But making changes to list or sets once constructed is very common. I can come up with 1,000 cases where this is needed.

lets say I have a list of expressions. Now I want to iterate over the list and make some substituion to each entry if needed based on some information obtained after the list of expressions were created, and so on.

May be I need to change my data from using set {} in Maple to something else which is mutable so I can use [i] syntax on it. I will look at using Array instead.

I am newbie in Maple, and now just use list and set. sometimes I used Matrix.

@acer

If I understand you right, you seem to be saying the different syntax is used/needed to remind a user that the set or list being modified is immutable?

In Mathematica a list is also immutable, but one still do "A[[1]]=something". Internally Mathematica makes a copy, changes the copy and replaces the original with the modified copy. There is no need for new syntax.

In[207]:= lst={1,2,3};
lst[[1]]=0;

lst
    Out[209]= {0,2,3}

I do not see how is this any different from Maple's

             A = subsop(1=something,A)

where a new copy is made of the original and returned  to caller. So, In both cases a new copy must be made anyway to make any changes. With Mathematica, it is done under the cover, while with Maple it is done above the cover.

Only difference is that the syntax "A[i]=something" is much more natural to use.

Exposing to the user that the a list or set is immutable by forcing different syntax to be used for such a very common operation is not a good language design IMHO.

First 66 67 68 69 70 71 72 Last Page 68 of 91