nm

8552 Reputation

19 Badges

12 years, 352 days

MaplePrimes Activity


These are replies submitted by nm

@Carl Love 

Thanks for such a great insight into the problem. Your solution and Kitonum's are both very valuable as they give different light to the same issue.

@Kitonum 

But again, I do not know I need to solve for "u".  

I do not know that u is under sqrt on both sides of equation, on one side it is happend to be in numerator and on the other it is in the denomator.  I have a black box function that gets an expression, and would like to simplify it. I do not know what is inside it, without having then to parse it to do what you suggest.

And I do not know why you say I am confusing solving with simplifying.  The expression can be "simplfied" clearly as is. That is what we do by hand. But I will see if I can figure how to use solve for this to simplify it in my code, since the code is generic now for any expression.  I was hoping some sort of "simplify" with option would do it.

 

 

@acer 

I did not know there is abs(n,x). But this will not show up in what I am doing. Only normal abs() will show up in the input expression.

 

@acer 

And that produces zero (in my Maple 2020.1 at least) even before simplify is called.

No, it does not on my Maple 2020.2, that is why I used simplify.

Maple 2020.2 on windows 10

But case A, was not calling odetest with the assumption. It was first calling odetest, getting back the resullt, then calling simplify on that result, with the assumptions.

So the assumptions should be applied to the result on the stack from odetest, which is used by symplify. not by odetest.

I expected odetest not to see the assumption at all.   But I guess this is not the case, and that is what I find strange. Maple rules are sometimes are strange.

 

@Kitonum 

Yes, I saw I could also do what you did 

tickmarks=[default,default,10]

But becuase it then added empty major ticks, I did not like how it looked. Major ticks should all be labeled.

 

@dharr 

Thanks for the answer. 

"I'm guessing that odeadvisor's result is more of a hint"

I am sure this is not meant to be a hint, but a concrete result. odeadvisor is pretty good at determining the correct ode type. But I think it missed this one for some reason. 

What I have seen instead is that sometimes odeavisor does not detect all possible ode types. But not give wrong type. For example, the ode y'*y=x-1 is separable, but it is also d'Alembert. It is d'Alembert because it can be written as   y=x*f(p)+g(p) where both f,g are non-linear function in p.   Where  y=x*1/p-1/p where p=y'. So here f(p)=1/p and g(p)=-1/p. But odeadvisor says this is only separable. 

 

@vv 

two things. I tried before solving for _C1 but solve gives no solution.

solve((1 + sqrt(_C1*x^2 + 1))/(_C1*x)=0,_C1)

I tried allsolutions and other things.  But it gave no solution that is why I asked. (may be solve is not meant to find infinity as solution).

second: I have thought constant of integrations have to be finite. That is why I did not even think of trying infinity (using limit).

I have to ask the teacher at school about this, even though Maple say it can. I see now Maple says the constant of integation can "apperach infinity".

https://www.math24.net/singular-solutions-differential-equations/

For me infinity is not a "particular value". But I see now that

http://www.cfm.brown.edu/people/dobrush/am33/Mathematica/ch2/singular.html

Say that infinity is allowed. So may be Maple is correct.  But I still have to ask the teacher when I get the chance.

 

@vv 

"algsubs should return an error (division by 0). 1 is out of the question."

but that is what it returns. It returns 0. I did not make this up.

"ode:=diff(y(x),x)^2+2*x*diff(y(x),x)/y(x)-1 = 0;
sol:=y(x)=0;
odetest(sol,ode);

         0

is also wrong (division by 0 too)"

That is what odetest gives.  I did not make this up.

"Which is 0/0 but this is 1 in the limit. This is nonsense."

What I really meant is this

limit(z/z,z=0)

                    1

 

 

@Kitonum 

Yes it does simplify lhs, but FullSimplify is needed. Not Simplify.  So internally Simplify may be uses some of the code from FullSimplify to help it when presented with equation. I do not know, since I only used Simplify on the equation itself and it worked. But not when used on lhs alone. So Simplify may be internally rearranged the equation to be lhs(eq)-rhs(eq) automtiacally and that helped. 

ClearAll[x, a, C0]; 
f = (9*(x^((-2/3)*a))^2*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]^2*C0^2 - 6*(x^((-2/3)*a))^(3/2)*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]^2*C0^2*a + 
     (Exp[(6/a)*(x^((-2/3)*a))^(1/2)]^2*C0^2*a^2)/x^((2/3)*a) + 18*(x^((-2/3)*a))^2*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]*C0 - 
     (2*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]*C0*a^2)/x^((2/3)*a) + 6*(x^((-2/3)*a))^(3/2)*a + a^2/x^((2/3)*a) + 9*(x^((-2/3)*a))^2)/
    (3*C0*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]*(x^((-2/3)*a))^(1/2) - Exp[(6/a)*(x^((-2/3)*a))^(1/2)]*C0*a + 3*(x^((-2/3)*a))^(1/2) + a)^2; 

FullSimplify[f]

                                                   x^((-2*a)/3)

@Kitonum 

Thanks. I know this. I was doing   

eq:= f=g;
res:= simplify(eq);
if evalb(res) then
    print("same");
else
   print("not the same");
fi;

and was expecting to see "same" printed.  It worked for many other equations but not for this one. So Maple could not simplify one side to the same as the other side. 

But when I did this

eq:= f=g;
res:= simplify( lhs(eq)-rhs(eq) );
if res=0 then
    print("same");
else
   print("not the same");
fi;

it worked. 

That is my point. Compare to Mathematica, it was able to simplify lhs of the equation to be the same the rhs of the equation and it returned True automatically.

No help or side substitutions was needed as you can see.

Simplify[f==g]  returned True. Which means it was able to determine that lhs of the equation is the same as rhs of the equation. May be Mathematica automatically does  Simplify[f-g] internally and checks for zero or does something more. I do not know. The point is that it worked as is.

But I am ok now. I am using the second method above and it is working better now. I have not used  "is" before but will also look at it to see if it does better.

ps. if you have Mathematica and like to try it, here is the plain text code.

ClearAll[x, a, C0]; 
f = (9*(x^((-2/3)*a))^2*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]^2*C0^2 - 
     6*(x^((-2/3)*a))^(3/2)*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]^2*C0^2*a + 
          (Exp[(6/a)*(x^((-2/3)*a))^(1/2)]^2*C0^2*a^2)/x^((2/3)*a) + 
     18*(x^((-2/3)*a))^2*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]*C0 - 
          (2*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]*C0*a^2)/x^((2/3)*a) + 
     6*(x^((-2/3)*a))^(3/2)*a + a^2/x^((2/3)*a) + 9*(x^((-2/3)*a))^2)/
       (3*C0*Exp[(6/a)*(x^((-2/3)*a))^(1/2)]*(x^((-2/3)*a))^(1/2) - 
      Exp[(6/a)*(x^((-2/3)*a))^(1/2)]*C0*a + 3*(x^((-2/3)*a))^(1/2) + 
      a)^2; 
g = x^((-2/3)*a); 
Simplify[f == g]

 

@Carl Love 

Well, this is what I really meant. I said

      "post an image of the problem from the textbook than posting incorrect Maple code."

I see many people here post asking to solve a problem and know little Maple.

So instead of people wasting their time guessing what the code they typed mean, which has errors and try to guess where the error is, it is better to post an image of the actual problem from the text book so it is at least the equation are clear and people do not have to sit and guess what they meant as the case here.

Ofcourse it is better to post correct Maple code that works in first place. But in reality in this forum, I see many who do not Maple much but want their problems solved.

So that is why I suggest to post the problem image. This does not mean OP should not also post their Maple code attempt as well and what they tried even if it is wrong. 

 

@SUA 

it will make life much easier for yourself and others if you simply post an image of the problem from the textbook than posting incorrect Maple code.

How could this be BC possible:  D[1](C)(0, t) = VMK*D[1](C)(t)/ZRTWA;

Even after correcting the RHS to this (which may be what you meant)

                                             D[1](C)(0, t) = VMK*D[1](C)(t,0)/ZRTWA;

it makes no sense. You are say that   A =  VMK * A / ZRTWA; Where I used A for  D[1](C)(0, t).

This means A=0.   So D[1](C)(0, t)=0 ?

You are also using VMK as one variable, but then you say each letter is different variable. Also you are using Z and there is allready z in the pde. This can be confusing, as someone might think this is a typo.

           V, M ,K ,D Z, R, T, W, A are emprical constant of the equation.

In Maple you need to add * for multiplication.  VMK is not the same as V*M*K.

Again, posting an image of the actuall problem from the textbook will be much simpler than posting things that are wrong or makes no sense.

I am also wondering why do you care how Maple solves the PDE? Why does it have to be using Laplace transform? Maple do not show step-by-step solution. It shows only the final result. So if you obtain the final result, why is it important how it solved it?

As far as I know, pdfsolve does not support infinity as BC. So you might have to change that to L.

After reading all the above, may be this is what the PDE specs should be:

restart;
pde := W*diff(C(z, t), z$2) = diff(C(z, t), t);
IC  := C(Z,0) = 0;
bc  :=  D[1](C)(0, t) = V*M*K*D[1](C)(infinity,t)/(Z*R*T*W*A), C(infinity, t) = 0;
pdsolve([pde,bc,IC],C(z,t)) assuming t>0

But Maple can't solve it. It is possible there is a HINT which will make it solve it. But I could not find it myself.

 

 

@vv 

Thanks. I will add 

expand(rationalize(...

in case Q fail. 

It is no problem if Q does not work on all functions. I am also using solve and also adding other checks on my own. If all these fail, then it is more likely it is not isobaric. So your Q function is now one additional check I am using to help with this problem.   

@vv 

Thanks. I will try it now and see. I have to test it on many cases to see if it gives same result as solve and also when solve fail.

"You have changed the problem,"

As I mentioned in my post "edit. Simplified question is restated below" but you must have overlooked it. I did not want to delete the original top post.  

Thanks again for help.

edit 

Your new method does not find p for this one of the 5 examples I posted in my original question., where solve does. This has p=-2

restart;
f:=(x,y)-> (-(x*y)/2+sqrt(x^2*y^2-4*y)/2)*y;
eq:= subs([x=alpha*x,y=alpha^p*y],f(x,y))- alpha^(p-1)*f(x,y)=0;
PDEtools:-Solve(eq,p) assuming alpha>0;

   # p=-2

Q := (F,x,y) -> simplify( (F + diff(F,x)*x)/(F - diff(F,y)*y) ):
Q( f(x,y), x,y);

But your Q function found the correct P for the other 4 examples. Where solve finds the correct P also for 4 out these 5 examples.  What I will do, is first try solve() and if that do not find p, I will try your Q and if that also do not find P, then I will call the function as not isobaric. But so far, I have not found one method that always works and not give negative false.

@vv 

Thanks again. But I think there is some misunderstanding here or I did not explain things well. First for example 1, it is p=3 not p=2 which Maple gives. I must have copied it wrong. But this is the problem again

Since solve does not work for all cases (it gives false negative), I am asking if there is a better method to find such p without giving false negative. We can assume alpha>0 if needed, or use symbolic option for solve. Notice that many functions will fail to be isobaric, which is OK. But I'd like to avoid the false negative which happens as in example 5 above where solve failed to find p=2 as solution.

 

First 21 22 23 24 25 26 27 Last Page 23 of 71