nm

11413 Reputation

20 Badges

13 years, 72 days

MaplePrimes Activity


These are replies submitted by nm

@ecterrab 

Thanks. A small suggestion on namings. It is not a good idea to have spaces in files names. For example

    PackageTools : -GetProperty("Physics Updates.maple", version);

The file name above have a space. It would be better to use underscore as in "Physics_Updates.maple". Or just "PhysicsUpdates.maple".

White Spaces in file names and folder names is not recommended and can cause problems when using the command line or on OS's such as Linux and care will be needed in working with file that have spaces in their names.

@ThU 

I have activatived initially. Then my student status was verified, and I activated again OK.

Still the problem exist, and now with Maple 2018. Once I turn off my internet, I am not able to start Maple, as it tells me it needs to activate. 

I close Maple. Connect to the internet, then open Maple again, and now it works.

This is ridiculous desktop software that requires one to be connected to the internet to use it. What if I lose my internet access or I wish not to be connected to the net? I can't use software I paid for becuase I have no internet access?

 

 

@Rouben Rostamian  

I tried this ODE in Maple 2018, it still can't solve it. I get

 

restart;
pde := diff(u(x,t),t) + u(x,t)* diff(u(x,t),x) = 0;
ic :=u(x,0) = PIECEWISE([0,x<=0],[1,x>0]);
pdsolve([pde,ic],u(x,t));

 

 

@Mariusz Iwaniuk 

 

Thank you, This is very good finding. Actually it only needed t>0 added to solve it.

restart:
pde := diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = mu*(diff(u(x, t), x$2));
ic := u(x, 0) =  PIECEWISE([0,x>=0],[1,x<0]);
sol := pdsolve({pde, ic},u(x,t)) assuming mu > 0,t>0;

Yes, the solution given by Maple contains unresolved integrals, but this is better than before.  I noticed also solution comes out not formatted well.

 

a loop? I see no loop in your "formula".

 

 

@Rouben Rostamian  

Thanks. Can I ask how did you know one needed to separate the variables by sum? Since the standard separation of variables is by HINT=`*` . Was is a trial and error, or is something one should have known before?

If I were to solve this by hand, the normal separation of variables is product not sum. 

But now I wil try `+` when pdsolve failes to solve a PDE.

Thanks

@Kitonum 

Thanks. But I am looking for symbolic solution, not numerical. I know Maple can solve this numerically ofcourse.

Do I understand correctly from the title of your post that I have a syntax error? Where is my syntax error?

 

 

 

@dharr 

Thanks for the hint about the Hint=`*`, but your method does not work for me. I get

Error, (in PDEtools/eval/2) numeric exception: division by zero

I copied/pasted your code as your showe it. I am using Maple 2017.3, using Physics:-Version() of `2018, March 9, 22:54 hours`

Which Maple as you using?

 

 

ALso the solution should be a Fourier series solution, as shown in screen shot in the original question.

@John Fredsted 

Why not just

number := (x::integer) -> length(x):

 

@acer 

 

sorry for the typo in the example code I posted. I corrected that later on my PC but forgot to correct it here. I just did. The warning messages still show up btw. I do not know why, even though the code works now as expected and I see the output written to the file correctly. 

read("proc.mpl");
Warning, incomplete string;  use " to end the string
Warning, incomplete string;  use " to end the string
Warning, incomplete string;  use " to end the string
Warning, incomplete string;  use " to end the string
 

It must be due to the string being on multiple lines.

Sorry you think my question was not clear. I thought It was. The reason I did not explain why I am doing, is because I did not think it is needed to answer the question and will cluter things.

I have good reason for generating Latex as I am doing it from a running program. And the question gave a very small example of the problem I am having.

 

 

@acer

But the whole point is that I do not want to write it as

str:="\n\t\\begin{align*}\n\tA =& B \\\\\n\t=& 3\n\t\\end{align*}\n ";

becuase this is meant to be plain latex code, and I wanted it to appear as it would be inside a Latex editor  or any other plain text editor.

So when I write the latex to generate, I want to write it the same way as I do in plain text editor. No one writes "\n" for carriage-return in an editor, but they hit the carriage return key and start on a new line, like this

str:="
    \\begin{align*}
       A =& B \\\\
          =& 3
    \\end{align*}
  ";

The above looks the same as it would in Latex editor. Only difference is to escape the \ with extra \.

Imagine one is writing 20 lines of Latex like the above.

I do this all the time in Mathematica with no problem. I can use writebytes() now in Maple to bypass this issue. I just find Maple handling of \ at end of line very strange. Multiline strings are widely supported these days in many languages.

Please see

https://en.wikipedia.org/wiki/String_literal#Multiline_string_literals

 

 

@vv 

Thanks again. writebytes() works. So replaced FileTools[Text][WriteString] with writebytes().

Have to rememeber to add " ", as in "\\\\ " each time. But I put a yellow stick on side of my monitor to remind me to add space " " when using Maple strings that ends with "\\".

 

@vv 

Thanks, but this Maple behaviour makes no sense at all:

When a backslash character appears as the last character on an input line, whether typed at the Maple command line, or read from a file, the backslash, and the following line ending, is ignored. In other words, the subsequent line is treated as a continuation of the current line.

So how is a user supposed to write this string in Maple:

str:="This is line 1 \\\\
      This is line 2";

And have it show up in the text file as

This is line 1 \\
This is line 2

If this is not possible, then I will forget about doing this in Maple and stick to Mathematica.

I am also not looking for reading, I simply want to emit some Latex strings from inside a Maple proc() to try something. But stuck on this first step.

 

@vv 

You can blame this on Maplesoft help pages. I was copying stuff from the web help pages, written in that awful fonts, which is hard to read and not easily copyable. I must have copied that funny looking :: from there to my worksheet.

On my PC,I use worksheet, not the document mode. All my input is plain Maple code.  It happend this time I copied some things from the Maplesoft help web pages. This must have come from there.

 

@Kitonum 

very nice. You should make this as answer. Your method is only one which splits (x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*sqrt(x^2*y-y) 

I tried both other solutions and not able to make them split the above into separated functions.

Your method:

expr:=(x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*sqrt(x^2*y-y):
r:=Splitting(expr):
xPart:=op(r)[1];
            (x^2+1)*sqrt(x^2-1)*exp(-x)*3^(-x)
yPart:=op(r)[2];
             y^(9/2)*exp(-y+1)*3^(-y)

But why I do not get back zero when I do this?

    simplify(xPart*yPart-expr);
I am sure the splitting is correct, but was wondering why it does not simplify to zero.

Also when I tried it on

expr:= -Pi*(1-cos(x)^2)*sin(y)^3/exp(1);
r:=Splitting(expr);
Error, (in Splitting) ambiguous multiple assignment
 

On the other hand, trying Acer solution on the first example above gives

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

I was expecting splitting like your result.

And trying John solution on your example did not seem to split it either

 

restart;
expr:=(x^2*y+y)*y^3*exp(-x-y+1)*3^(-x-y)*sqrt(x^2*y-y):
s,r := selectremove(z -> has(z,x) and has(z,y),expr):
simplify(select(has,r*expand(s),x));
                      exp(-x-y+1)*sqrt(x^2*y-y)*y*(x^2+1)*3^(-x-y)
simplify(remove(has,r*expand(s),x));
                       y^3

The first answer above contains both x and y in it !

It is clear this is functionality that really should be build in Maple itself and it should work for all expressions.

 

 

 

 

 

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