nm

8552 Reputation

19 Badges

12 years, 349 days

MaplePrimes Activity


These are replies submitted by nm

is it really hard to make a small minimal example of your table including code that generated it?  This will make it more clear what kind of table you are talking about.

@Kitonum 

Thanks for the workarounds. I know I can do the above ofcourse. But  this means I have to duplicate a very long string, which I do not want to do. Also, I could have more than one `if`(...)  

Here is an example

str:="A";
x:=10;
if x=10 then
   str:=cat(str,"some very long string here"," it was 10 ",
         "another very long string");
   x:=11;
else
   str:=cat(str,"some very long string here"," it was not 10 ",
         "another very long string");
   x:=9;
fi;

I use these string to build long Latex expressions.   Currently, I just build the string without the assignments, if any, and after that I check again outside, using standard if then else.   But it is awakward, since I duplicate the same check in two places.

 

@vv 

What exactly is the purpose of [] at the end of sort(...)[] command? I've seen it before, but I can't find any explanation of it in help as I can't find where this is explained.

I know   `%+`(sort(..)) does not work. It has to be `%+`(sort(...)[ ]) 

Is the whole thing a map like operation?

I am using Maple 2020.2

 

@robertocooper 

epspdf and pdfcrop are not Latex commands. These are commands to run from the terminal.   On Linux or on windows 10 under the Linux subsystems (Ubuntu). These are free/open source programs which can be easily installed.

it will be better to just type the differential equation here with any IC/BC instead of having one to read all that to figure which ODE you want solved.  I could not figure which ODE needs to be solved.

I know this form does not allow Latex, which is a pity for a forum supposed to be used for asking questions about math. Stackexchange supports Latex.

@jat741 

I do not use maple numeric solver much. But Maple can only solve PDE's numerically with 2 independent variable, while your PDE has 3 (r,z,t)

restart;
a := 35.5*0.0254: a:=convert(a,rational);
b := 36.5*0.0254: b:=convert(b,rational);
L := 0.0254*30*12: L:=convert(L,rational);
alpha := 0.000026972: alpha :=convert(alpha,rational);
Psi_s := 0.0440: Psi_s := convert(Psi_s,rational);
flux_b := 5.1/12: flux_b := convert(flux_b,rational);

h := 0:
the_laplacian_in_cylinderical :=VectorCalculus:-Laplacian( u(r,z,t), 'cylindrical'[r,phi,z] );
pde := diff(u(r, z, t), t) = alpha*the_laplacian_in_cylinderical + h;

bc:= u(r,L,t)=Psi_s, 
     -alpha*(D[2](u)(r,L,t))=0,
     -alpha*(D[1](u)(a,z,t))=0,
     -alpha*(D[1](u)(b,z,t))=flux_b;

ic:=  u(r, z, 0) = Psi_s;

#infolevel[pdsolve]:=5;
sol := pdsolve(pde,{bc,ic},u(r, z, t),numeric,time=t) ;

Error, (in pdsolve/numeric/process_PDEs) can only numerically solve PDE with two independent variables, got {r, t, z}
 

May be someone who knows more Maple's numerical solvers might have workaround.

 

 

@jat741 

One way might be to convert the solution to a function of x,t, and k (since k is not specified). Then take derivative w.r.t x and evaluate at x=1.    You could also plot it (for given k). You'd need to replace infinity by some finite value to make this work.   15 is good enough. The larger, the more accurate. 

restart;
h:=(x,t)->0;
pde := diff(u(x,t),t) = k*diff(u(x,t),x$2)+h(x,t);
bc  := u(0,t) = 10,u(1,t) = 20;
ic  := u(x,0) = 60*x -50*x^2+10;
sol:=pdsolve([pde,bc,ic],u(x,t));
sol:=subs(infinity=15,sol);
sol:=unapply(rhs(sol),[x,t,k]);
plot(eval(diff(sol(x,t,1),x),x=1),t=0..5,labels=["time","u'_x at x=1"])

Or if you just want numerical values

restart;
h:=(x,t)->0;
pde := diff(u(x,t),t) = k*diff(u(x,t),x$2)+h(x,t);
bc  := u(0,t) = 10,u(1,t) = 20;
ic  := u(x,0) = 60*x -50*x^2+10;
sol:=pdsolve([pde,bc,ic],u(x,t));
sol:=subs(infinity=15,sol);
sol:=unapply(rhs(sol),[x,t,k]);

seq( [t,evalf(value(eval(diff(sol(x,t,1),x),x=1)))],t=1..10)

gives

[1, 9.997903738], [2, 9.999999892], [3, 10.], [4, 10.], [5, 10.], [6, 10.], [7, 10.], [8, 10.], [9, 10.], [10, 10.]

so at t=10, u'_x at x=1 is 10, which is what the plot also shows.

There could be better/shorter ways to do the above ofcourse. 

 

@mmcdara 

thanks. updated. I did not notice that h(x,t)=0.

@ecterrab 

Thanks for the information. Maple sometimes makes videos to show things, like Maple youtube channel

It will be useful to have one Video showing what you just explain there. Will be easier to follow that way. 

My code is all in a library. (.mla) and all source is in .mpl files. I do not use code in worksheet, other than to open a worksheet in order to call the functions I want in the .mla from the worksheet. 

I am trying to see if I can reproduce what you described. I do not know how to use emacs. Last time I used it, was many many years ago now. 

 

 

@vv 

I did not know about Not(symbol). But is 

                 type("abc", Not(symbol));  

better than writing the following, which for me is more clear also:

                  not type("abc",symbol)

 

 

@Karishma 

While the interface for Maple’s debugger is still very command-line oriented, it is very powerful.

Yes, the Maple debuggers have many useful commands. Just like gdb, but it is hard to use, since it is command line based.

As one steps in the code, they do not see the actual listing of the code itself, only an echo of the current line. This what makes it hard to use. Adding more commands, does not help with this core issue.

I keep hitting "showstats" to see the listing of the code I am stepping in and to see which line I am on within. Then scroll and search for that small "!" marker on the left to see the line I am in.  And keep repeating this every few steps. Sometimes I do not see the "!" so had to do "where" then read the line number and scroll back to that line.

This what makes it hard to use.  Few people use gdb these days, since people have put a nice easy to use GUI interface on top of it to make it more user friendly.

Btw, your main competition in CAS, do not have a good build-in debugger (well, there is one, but only one person in the world have figured how to use it I read).

So since Maple already have a good debugger, but not a good interface on it, this is a chance for Maplesoft to build on one of its strength here and put a simple user friendly interface on top of Maple debugger which at least shows the line number as one steps into the code, and market this as one main feature against your competition in market place. 

You will also be pleased to know that Maple 2021 addresses the timelimit() issue that you mentioned.

This is great. I now look forward to trying it in next version. This is the most critical problem in Maple for me, since it makes running long scripts unpredictable, as timelimit() now can hang in some random places and have to restart the script many times until it completes. Sometimes it takes 2-3 days to complete instead of 2-3 hrs.

And good luck with MapeLearn. I just wish the few critical resources  that Maplesoft has are allocated on core Maple issues first, before these external apps.

Thanks for the link. 

I tried it. I did not find it useful for me. For an example, I typed an ODE and got solution OK, but could not figure how to ask it to show the steps used to obtain the solution.  I also found it hard to use.

But this app might be of use for some high school students. 

I just wish Maple have used the few resources and the money it has on making this app on something much more critical and important for developers.

Like improving the Maple debugger, which is very hard and frustrating to use and not user friendly with very little change in it for years.

Also fixing major problems where Maple sometimes hangs on timelimit() calls and do not time out and server just hangs. This problem has been there for years now and is completely ignored by Maplesoft. 

There are also many improvements that can be made to basic math inside Maple, such as improving the integrator and fixing many bugs in the software instead of spending resources on making yet another click/slider apps. 

I do not know what Maple strategy is in all of this but Maplesoft does not seem to have its product priorities right.

 

what is the domain?

@Kitonum 

Thanks to all the answers. 

I added combine to the list to try. (now my list is about 15 items in it, which I try each time I want to simplify an expression).

But this is really more of a design issue. For simplify(), as a user, I would expect simplify() to try all these different ways to simplify the expression. Compare to Mathematica, where all one needed to do is tell it that x>0 and nothing more. I am sure internally Mathematica used combine at one point. It did not need to be told to do that.

With Maple, Why is a  user expected to try 10 different ways until one works with simplify()? I am not taking about assumptions, but about manipulating the expression before calling simplify, such as combine, expand, collect, and such.

I think CAS sould internally try any mathematically allowed operation to make the expression as simple as possible. Having the user tell it what to do each time, it becomes not easy to use, specially for users who might not know all the tricks to use each time.

Suggestion to Maplesoft: Introduce a new fullsimplify() function, or add an option try_hard=true to current simplify(), so that it will try harder.

I like that Maple does not rearrange expression on its own unless asked. That is something I want. But simplify() is a special case. The user is basically telling the software do whatever is legally needed to simplify this expression,

 

 

Posting your code in plain text is better. You can use the "insert code snippet" icone to past code in plain text.

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