nm

8552 Reputation

19 Badges

12 years, 354 days

MaplePrimes Activity


These are replies submitted by nm

I found an answer, thanks to acer  which seems to do what I want. But I need to try it more to make sure.

 

https://www.mapleprimes.com/questions/204714-Alias-Surpress-Or-Declare-With-Latex-Outputs

 

restart;
aliasedlatex:=proc(e)
  local lookup;
  lookup:=op(eval(alias:-ContentToGlobal)):
  :-latex(eval(e,lookup));
  NULL;
end proc:

alias(C[1]=_C1):
sol:=dsolve(diff(y(x),x)=1,y(x));
aliasedlatex(sol);

               y \left( x \right) =x+C_{{1}}

which is what I want. This should be part of Maple itself. I do not understand why it is not. Or at least an option to latex() command.

 

 

@Joe Riel 

"Alas, the current design of odetest expects that integration constants are named with prefix _C"

Then why I can rename the constant to anything else in some other ode solution and it works just fine for odetest?

ode:=diff(y(x),x)=1+2*x;
my_sol:=y(x)=x^2+x+ C;
odetest(my_sol,ode);

            0

I can use "B" or "C[1]" or any other letter, and Maple is happy with it in the above example. odetest gives 0.  Maple own solution does use _C

dsolve(ode,y(x));
       y(x) = x^2+_C1+x

Are you saying it is hardcoded in some places and not in other places? 

This is all so confusing for a user who is trying to learn Maple.

 


 

@vv 

I am not able to follow what you are saying. 

I want 

RootOf(signum(0, _Z, 1));

to become

RootOf(signum(0, n, 1));

I read the help, but do not see why one can't do the above. (Maple help is really hard to follow. No example there for the 3 argument version for example. Maplesoft should invest some resources to improve help.)

It can be done using subs

expr:=RootOf(signum(0, _Z, 1));
subs(_Z=n,expr);

           RootOf(signum(0, n, 1))

Can't use subs, since do not know what the _symbol is before hand. This is just for formating purposes. I like to see "n" there instead of "_Z" when I print it.

 

 

 

@vv 

<"Blow-up" is not defined.>

Well, I guess Wikipedia and all the engineering Professors at my school who used this term have no clue what they are saying.

 

From https://en.wikipedia.org/wiki/Singularity_(mathematics)

The term blow up is a just a "loose" way to describe this and very common. At least in engineering.  As I said, there are other cases where a function is said to be singular at a point and the above article talks about those cases aslo. But the above is the most common one and what I was interested in when using singular for my needs. 

@vv 

I am using the basic definition of singularity: The points where the function  blows up. Sometimes called a pole also. I know there are different types of singularities and this can get complicated.

But I simply wanted to know the points where the function "blows" up. Excluding +- infinity.

So using this, the function sqrt(x) does not blow up (excluding +- infinity). singular does give these points correctly, but not discont(). At least not for every function I tried. So can't use discont() to find where the function "blows" up.

I like singular(), it works OK. Only question I had is about the real domain part. But it is not a big problem, as I could always filter out the complex poles it finds by post-processing the result. 

@Kitonum 

But this does not give singularites. Compare:

discont(sqrt(x),x);
          {0}
singular(sqrt(x),x);
                {x = infinity}, {x = -infinity}
 

Zero is not a singular point for sqrt(x). Sqrt(x) has no singularites (ignoring the +- infinities)


 

 

@vv 

I tried your function, but may be I am not using it correctly:

r:=singular(sqrt(x),{x});
cleanInfty(r);

              r := {x = infinity}, {x = -infinity}
                            {0 < 0}

I do not know why the function is returning 0<0. What does this actually mean?

putting r into a set or list, it gives error

r:=singular(sqrt(x),{x});
cleanInfty({r}); #same error with cleanInfty([r]);

Error, invalid input: cleanInfty expects its 1st argument, L, to be of type ({list, set})(relation), but received {{x = infinity}, {x = -infinity}}

I do not know how it worked in the first example above, since "r" is an expression sequence in that
case but cleanInfty is defined to take in a set or a list. But it did call it.

I was expecting to get an empty set or NULL from the above, since by removing all infinities, nothing is left. Am I using your function in the wrong way?

 

@Kitonum 

Thanks. But could you please explain to newbies why this works and not the other? I can't program like this, without an idea of why something works in one case and not the other, by using trial and error.

Also your adjustment, not do not now give same result as with x*ln(y)

restart;
f:=x*ln(y);
solve(map(Im, evalc(f)), {x,y});

While the earlier method from 

https://www.mapleprimes.com/questions/225083-Maple-Command-To-Find-Domain-Of-Function

Worked on the above (but not on sqrt(x)*ln(y) )

restart;
f:=x*ln(y);
solve(evalc(Im(f)), {x,y});

The method needs to  work on all cases, since the function is not known before hand. 

Thanks

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

First 45 46 47 48 49 50 51 Last Page 47 of 71