nm

11558 Reputation

20 Badges

13 years, 135 days

MaplePrimes Activity


These are replies submitted by nm

@sursumCorda 

"since solve ignores assumptions on the variables for which it is solving"

Well,  Help says In most cases, solve ignores assumptions on the variables for which it is solving

Notice the word "in most cases". This makes it not clear really what it does. I do not think help should describe things like this. What does in most cases mean??

When I tried your equation in Maple 2024.2, I got strange result. When adding the option useassumptions to solve command, it produced no result. But without this option it did produce result with RootOf (which convert to radical could not remove the RootOf).

I do not understand this behavior myself but here is the worksheet. I also did not know one can put assumptions inside solve like you did. I always add assumptions after the call, like second example below.
 

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

restart;

eq := 9*(x^2 + 2*cos(x)) = Pi^2 + 9;
solve({eq,x>0},[x]);

9*x^2+18*cos(x) = Pi^2+9

[]

solve(eq,x) assuming x>0;

RootOf(-Pi^2+9*_Z^2+18*cos(_Z)-9)

solve(eq,[x],useassumptions) assuming x>0;

[]

 


 

Download solve_dec_11_2024.mw

@Carl Love 

Thanks, the freeze method worked. I suspect it will but I never learned freeze/thaw in Maple. I should learn these as they seem useful.

So I take it then, it is not possible to do this using evalindets without using freeze?  Becuase When I tried 

evalindets(expr, Not(specfunc(invlaplace)),X->eval(X,t=0))

it still gave

But thow/freeze works well, so will use this instead of what I did before. 

Y:=(s+1)/s^2+Int(sqrt(s^2),s);
expr:=inttrans:-invlaplace(Y,s,t);

evalindets(expr, specfunc(invlaplace),freeze);
eval(%,t=0);
thaw(%)

These functions freeze/thaw seem very useful. 

 It looks to me that the GUI has to do some house keeping from time to time

do you have options->General->auto save on??   This is the first thing I turn off when I install Maple.

Other than this, hard to say. Maple's GUI is written in Java, which is known to be slow for GUI, specially when worksheet gets large.

Do you run this in worksheet or command line maple? (cmaple.exe)?

I stopped using Maple GUI for any long running loops.

I use cmaple.exe now (run a batch.bat) file which runs EACH loop iteration using one single invocation of cmaple.exe.  Now Maple no longer hangs on me and can run 20,000 iteration with no hang. i.e. for 20,000 iterations, it starts new cmaple.exe process for each one. One after the other. So each iteration is completely separate from the next. This avoids any memory buildup and any internal maple caching issues.

Same loop in a worksheet hangs 20-30 times to get to 20,000 iterations. I gave up finding why. 

May be you could try the same. 

This will ofcourse only work if each of your iterations is independent of the other, which you seem to indicate this is the case. 

I read that Maple18 contains the "Adomian Decomposition". 

That is not what they say.  They say

MATLAB and Maple were used to implement the Adomian decomposition method
for the Fredholm integral equation of the second kind

i.e. they seem to have implemented the algorithm in Maple. This is not the same as saying they used builtin algorithm in Maple that is already there. You could try to contact the authors and asks them for more clarification and see if they can send you the code they used in the paper.

Maple's answer is correct. Your answer is wrong.

You can verify that your solution is wrong or not by replacing the solution back into the equation to see if it satisfies it or not, like this:

restart;
equ := u2 - u1/(-u1^2 + 1)=0;
my_assumed_correct_answer:=u1 = (-1 + sqrt(u2^2 + 1))/u2;
eval(equ,my_assumed_correct_answer);
simplify(%)

which gives

which is not identity.

Btw, it is better to use  an equation with =0 at the end of it.

Maple assumes that in solve, but this is not good practice and Maple should really not accept it as an equation must have = in it.  So better be explicit. I do not know if Maple always behaved this way (i.e. automatically adds = 0 to input if it is not equation already, or if this recent change in Maple.

Owner  is not place holder. This is the default user name you get when you buy PC with windows on it from the store.

On my windows 10 PC, this is my name also.  On command line on windows, type whomai

And you will your user name.

To change the user name, just google "windows 10 change owner user name" and you will see step by step instructions how to change it. But it might break things, so I would be careful doing this.

If you mean you want to remove the string "Owner" from the output of libname, then this can be done using StringTools commands.

@Anthrazit 

Same with maple.mla. Its size on disk is 268 MB. But adding the sizes of all .m files is much less than that.

There must be lots of other overheads/information inside the mla besides what ShowContents  shows.

It is binary file and I do not know its internal struct and what else it contains besides what the command LibraryTools:-ShowContents shows to account for the extra storage. 

Someone else might know. 

@ecterrab 

The problem you linked to [this] was fixed in Physics update when using Maple 2024.0, 6 months ago.

I am now using Maple 2024.2, that is two versions ahead.

I thought by installing a new Maple version, all earlier fixes in earlier Physics updates will be now in Maple itself.

I did not know that I need to keep Physics update on path to get fixes for very old bugs.

Second, in Maple 2024.2, if I keep Physics update on path, odetest now hangs on some ode's. As reported [here]

So these are the options I have: 

1. Keep Physics update on path to make latex typesetting work all the time, but live with odetest hanging sometimes.
2. Remove Physics update from path to make odetest not hang sometimes, but live with Latex not working sometimes.

I do not understand why you say I am not clear about things.

I am just reporting problems I see using Maple.

@C_R 

Was there additionally to the Physics Update lib a Physics lib that you removed.

I have not removed or made any changes. I do not ever change anything in Maple. I just installed the update Maple 2024.2 and type Physics:-Version(latest) once in few days to get latest version of Physics. 

Maple automatically adds Physics lib to libname path.

So now I find if I remove Physics from libname then odetest do not hang on this test as you see.

I have same set as you for layout. I just do not use Natural language stuff.

As I said, I do not touch or change any of this.

But clearly having the Physics lib in the libname path causes this problem. So for now I removed it from libname path until I find what is going on. I do not use Physics package directly myself. 

@C_R 

I found the problem. Please see my update. It was the Physics package. Is same Physics package I was using on your libname also? What is your libname looks like?

By removing Physics package from libname, the problem went away. I just do not know for sure what effect this will cause on my main program. I will have to run full test to find out which will take 1-2 days.

@C_R 

Then there is something different. I am using windows 10 PRO with 128 GB, latest Maple.

Which Maple version are you using?

Here is also a movie I just made. I have nothing in my Maple .ini (I do not even use these anymore).

I have each worksheet uses its own engine. This is also after rebooting windows and from clean start of Maple. So I have no idea why it does not do the same on your PC. This is very strange. Could you try with larger timelimit? say 60 instead of 30? in some cases this can make difference.

Right-click on the movie and select OPEN IN NEW TAB to see a larger/magnified  version.

@salim-barzani 

Here is my answer that was in your deleted question that you asked for. 

worksheet below

restart;

data:=[ [P=m^2,Q=-(1+m^2),R=1],
        [P=1,Q=-(1+m^2),R=m^2],
        [P=-m^2,Q=2*m^2-1,R=1-m^2],
        [P=1,Q=2*m^2-1,R=-m^2*(1-m^2)],
        [P=1/4,Q=(m^2-2)/2,R=m^2/4],
        [P=m^2/4,Q=(m^2-2)/2,R=m^2/4]
        ]:
the_result :=Array(1..0):
the_result ,= [P,Q,R,"current ode","solution"]:
ode:=diff(F(xi),xi)^2=P*F(xi)^4+Q*F(xi)^2+R:
for item in data do
    current_ode:=limit(eval(ode,item),m=1,'left'):
    sol:=[dsolve(current_ode)]:
    the_result ,= [rhs(item[1]),rhs(item[2]),rhs(item[3]),current_ode,sol]:        
od:
the_result:=convert(the_result,listlist):
DocumentTools:-Tabulate(the_result,weights=[10,20,20,45,45],width=60):


 

Download ode_answer_oct_26_2024.mw

@salim-barzani 

I do not know what U(xi) is. I see no U(xi) anywhere. I only see G(xi).  You say 

         U(xi)=@ my mean not G(xi) i

But I do not understand what the above means. If you give one example of what U(xi) is meant to be for one the above 4 cases, may be that will help clarify what it is.

@C_R 

Thanks but this method works when the original expression happened to be all additive with no cross multiplication of terms with _C's inside each term.

I wanted it to work on any type of expression. For example given

                        e:=_C1^2+_C1+ _C1*_C2^3+a+b;

Do you agree that the output should be {_C1^2,_C1,_C2^3}  right? since these are the only such terms. But with the code you provided, it gives

e:=_C1^2+_C1+ _C1*_C2^3+a+b;
indets(e, And(symbol, suffixed(_C, nonnegint))^anything);#extract powers of
indets(e-add(%), And(symbol, suffixed(_C, nonnegint))); #remove powers of and scan for remainders
%% union %

{_C1, _C2, _C1^2, _C2^3}

I will add this example to my question. There should be a way to do this directly on the given expression without any post-processing. But not sure how now.

 

First 9 10 11 12 13 14 15 Last Page 11 of 90