nm

11413 Reputation

20 Badges

13 years, 72 days

MaplePrimes Activity


These are replies submitted by nm

@acer 

The return result is confusing. It returns a set of 3 items

expr := -(x^2+1)*y^3*exp(-x-y);
F( expr, [x,y] );

   [(x^2+1)/exp(x), y^3/exp(y), -1]
 

But it should be only 2 functions. Yes, the product is correct. Using the Mathematica function posted at the link I showed in my question returns the two searated functions only as follows

expr=-(x^2+1)*y^3*Exp[-x-y];
getGX[ftest[x,y],x,y]

       E^-x (1 + x^2)

getHY[expr, x, y]
      -E^-y y^3

I guess the question if the minus sign should go with the function which depends on x or if the minus sign should go with the function that depends on the y. This is arbitrary.

If the third entry returned by your function will always be -1 when it is there, then this is no problem. I can always handle this case separatly, so it is not an issue.

@Christopher2222 

 

This does not work correctly.   There is a missing minus sign.

expr := -(x^2+1)*y^3*exp(-x-y)
r:=F( expr, [x,y] );
[op(r)][1];

    ``((x^2+1)/exp(x))

[op(r)][2];
    ``(y^3/exp(y))

 

I also do not understand why all these expressions returned has these `` stuck to them.

 

 

 

@acer 

Thanks. But is it possible to modify this slightly in order to make it easier to use by having your function return the 2 separated functions in a list?  So instead of

expr := -(x^2+1)*y^3*exp(-x-y);
F( expr, [x,y] );

Returning this expression 

          ``((x^2+1)/exp(x))*``(y^3/exp(y))*``(-1)

It will return a list

           { -(x^2+1)  ,  - (y^3/exp(y)) }

This way one can more easily pick each function separatly after the call.

 

@Scot Gould 

 

I do not use math mode and will never do. math mode i.e. document mode, 2D input, etc.. all of this is not the Maple language.

I only write pure Maple code.  Something that will show as is in plain text file.

Maplesoft wants everyone to switch to clickable things and use 2D math fonts and such and not use the Maple programming language as it was originally. That is why I do not use Maple any more as my main tool. There is basically now two languages/systems packages into one.

 

it works for me. Maple 2017.2 on windows

 

@Seb1123 

if it is any help, mathematica also can't solve it. It gives warning message

ode=y''''[t]+10*y''[t]+169*y[t]==0
bc={y[0]==0,y'[0]==1,y[Infinity]==0};
DSolve[{ode,bc},y[t],t]

   {}

 

DSolve::bvlim: For some branches of the general solution, unable to compute the limit at the given points. Some of the solutions may be lost.

In Maple, you can see something similar as follows

restart;
diffeq := diff(y(t),t$4)+10*diff(y(t),t$2)+169*y(t)=0;
bc:=y(0)=0, D(y)(0)= 1;
sol:=dsolve({diffeq,bc},y(t));
limit(rhs(sol),t=infinity);

Which gives  "UNDEFINED"

 

@Seb1123 

A 4th ODe does not need 4 boundary conditions

At school the teacher told us that an nth order ODE needs n boundary/or initial conditions for complete solution. If you do not provide these, the solution will contain constants of integrations instead. Since you have 4th order ODE, but you only supplied 3 conditions. That is why I said you probably need another conditions to fully satisfy the ODE.

btw, I do not see anything wrong with the syntax you used. When maple returns nothing it means it can't figure how to solve the ODE with these boundary conditions.

 

4th order ODE needs 4 boundary conditions?

dsolve({diffeq,y(0)=0,D(y)(0)=1,D(y)(infinity)=0},y(t)) 
Returns nothing.

May be becuase the boundary conditions at infinity makes Maple not able to find a solution?

 

@vv 

Thanks but Iam little confused about how is this suposed to be used. Does one have to supply value at which these function evaluate? How does one know which x,y values to use? For example

facxy(1/(x-1)*y,x=1,y=1);

Here it is separable. {  1/(x-1)  , y }   I picked say x=1,y=1 but this gives

    Error, (in facxy) numeric exception: division by zero

How is user supposed to figure what x,y to use? if I pick x=0, but later do

facxy(1/x * y,x=0,y=1);

Same problem shows up. I do not know in advanced what the functions are.

 

 

@Mac Dude 

"It isn't quite clear to me why you would want to do that, but of course there maybe perfectly valid reasons I just haven't encountered yet. "

In cases when a proc() wants to construct a mathematical expression, which uses symbol not passed by user. Consider for example dsolve. It returns constant of integration. Maple calls that _C1, _C2. etc... These symbols were not passed in by user.

One can carry this for more symbols than just _C1...

Thanks for the hint about exporting the symbols. This is useful. I only use simple proc() now and not advanced enough to use modules yet.

@Kitonum 

Thanks. But this does not work on all cases. For example

Separation( exp(x+y))  should return [exp(x), exp(y)]

I'd also like it to separate sqrt(x*y) to sqrt(x)*sqrt(y) with ofcourse the assumption that both x,y are positive. But your function is still very useful.

 

Do not use 2-D Input mode.

It is not Maple code.

Stick to using pure Maple code.

@vv 

I see. So Maple moved the whole 3*(y^2+1) to the left side. Ok. No problem. But then why it did not do the same for y'=3*x*y^2  case? Since one can't write Latex here, I attach image

So following same logic, I would expect Maple to give solution y=-1/(x^3+3c). 

Again, both solutions are correct. But I was trying to see if I figure what Makes Maple decides which terms to separate.

 

@Rouben Rostamian  

Why numerical solution when it can be solved analytically?

sol:=pdsolve([pde,Bcs,ics],u(t,x)); 

sol := u(t, x) = sin(x)*exp(-t)

@tomleslie

"fopen() is successful so carry on. Why/what would you check?"

humm... How would you know fopen() was successful in first place in order to "carry on"? That was my question. Maple help does not show one single example of how to check and what to do. It just says fopen raises an error. Ok. How does one know this in a script?

No eyes. Non interactive.

Imaging one is blind. How would they know fopen has failed? Also imagin one is also deaf so the can't hear an error beep coming when an error is printed on screen. That is what I am asking.

You showed one method is to use trap. Ok. So one should not check fd? Is using trap/catch the official method to check for fopen failing? Is this documented any where? I have not seen one example in Maple help using fopen() doing any check on status of the open. Using trap or otherwise. But if using trap is the correct way in Maple to check for fopen, I have no problem using it.

 

First 71 72 73 74 75 76 77 Last Page 73 of 91