nm

8552 Reputation

19 Badges

13 years, 31 days

MaplePrimes Activity


These are questions asked by nm

Is there a place to read about rules for naming constants of integrations for solution of ODE so that Maple odetest will not have problem verifying solution of an ODE?

It seems Maple does not like some constant names. If I use C or C1 or C[1] or A etc... odetest does not give back zero, even thought the solution is exactly the same as Maple's, except Maple uses _C1.

I read one is not supposed to use _ constants in own code, since these are reserved for Maple.

So what is one supposed to use? Here is an example

restart;
ode:=2*sqrt(x)*diff(y(x),x)=sqrt(1-y(x)^2):
my_sol:=y(x)=sin(sqrt(x)+(1/2)*C1);

Compare to Maple own solution

maple_sol:=dsolve(ode,y(x));

You can see, there is no difference, except the name of the constant.  Yet, Maple does not odetest my solution

odetest(my_sol,ode);

I tried naming my constant to C, C[1], A, Z, etc.. I got tired trying. Only when I use _C1 does Maple give zero for odetest.

What is so special about _C1?  And if one can't use _ symbols as Maple says, what is one to to do? 


Maple 2018.1, Physics version `2018, July 21, 4:16 hours, version in the MapleCloud: 78, version installed in this computer: 78`

 

From answer posted in https://www.mapleprimes.com/questions/225137-Internal-Symbol-Z1--Causes-Error-

I've learned to use

subsindets(expr, 'suffixed(_)', f->n);

To replace in a Maple generated solution which contains system suffix, such as _Z, _Z1, etc... returned by Solve and Maple calls, with a symbol that I find easier to read. The above works in some cases but not others. For example, it works on this result

restart;
expr:=signum(0, _Z, 1);
subsindets(expr, 'suffixed(_)', f->n);

                      signum(0, n, 1)

But not on this one

restart;
expr:=RootOf(signum(0, _Z, 1));
subsindets(expr, 'suffixed(_)', f->n);

             RootOf(signum(0, _Z, 1))

I do not want to use pattern matching, since the result is something I do not know what it will be. I just want to replace all those Maple symbols that start with _Z in the solution by another symbol. I can't use subs() either, since I do not know what the symbol will be.

What is the correct way to do this?

 

Should this generate an error?

restart;
r:=evalc(Im(1/ln(x)));
solve(r,{x});

 

This did not help. Same error as above.

restart;
r:=evalc(Im(1/ln(x))):
solve(r,{x}) assuming x::real;

This made Maple not give an error

restart;
r:=evalc(Im(1/ln(x))):
solve(r,{x}) assuming x::real, x>0;

       {x = x}

Also this worked, but NULL returned

restart;
r:=evalc(Im(1/ln(x))):
solve(r,{x}) assuming x::real, x<0;

Also this worked with NULL returned

restart;
r:=evalc(Im(1/ln(x))):
solve(r,{x}) assuming   x<0;

Is this how Maple generally works? i.e It generates an exception error when it is not able to solve something? Or does it normally echo back the input back if it can't solve something? Or at least return NULL if it can't solve it? I am havin hard time figuring which method to use to check if Maple is able to solve something or not, because each time it seems to do something different.

Should one then put a try/catch around each Maple call, and treat the try section as if Maple was not able to solve the equation whatever it was?

 

 

singular(ln(y^2+1),y);

        {y = -I}, {y = I}, {y = infinity}, {y = -infinity}.

But if "y" was real, then there are no finite singularities, since y^2 is always positive and hence y^2+1>0 always. Adding assumptions did not help

singular(ln(y^2+1),y) assuming y::real;

gives same result. RealDomain does not support singular.  But I am no longer using RealDomain as it seems bugy.

I know I could filter out these complex results using remove(), but it would be nice if there was a way to singular supports assumptions. Is there a way to do it?

Why are the following 2 commands produce different result?

restart;
RealDomain:-solve({y=y,y<>0},y);
solve({y=y,y<>0},y);

                            [y = 0]
                            {y <> 0}
 

Should not the result be the same?

solve({y=y,y<>0},y) assuming y::real;
                           {y <> 0}


Maple 2018.1. 

First 115 116 117 118 119 120 121 Last Page 117 of 164