nm

11353 Reputation

20 Badges

13 years, 10 days

MaplePrimes Activity


These are replies submitted by nm

The error says clearly that it can not find the procs getOccures which you are using

It must worked in worksheet since you had these defined before. You need to add all procs you are using to the MLA, unless you define these again in global context again.

One nice thing I like about Maple error message is that they tell the user the exact reason for the error and also the line number where the error happened in the mpl source file.

@acer 

This is all great and wonderful techniques you show. But how many normal users know to do all of this? Does a user need 20 -30 years of deep knowledge in advanced Maple manipulations to do this?

Should not the software just automatically do this using the simplify command is really the question.

Using another software, it takes one simple command. Just Simplify to obtain what the user asked for:

Which is exactly what the user wanted (without that typo Rac term)

What you are asking for is impossible to do, even for Maple. 

Your simplified expression has term called  Rac  which do not even exist in the first expression. So these two can not be the same.

@Carl Love 

The timelimit bug makes it nearly impossible to effectively run things in "batch mode";

My guess is that there is no actual testing department inside Maplesoft.

In other software companies, there is normally one or more engineers (depending how large the company is) that do nothing but extensive tests (regression, unit tests, integration tests, system wide stress testing, batch mode and interactive tests) all the time and report bugs back to the developers.

There should be millions and millions of unit tests done each time.  Each function in Maple should have dedicated unit tests for it. This is how bugs are found before releasing it to the public.

Some companies even set up 24-hrs, 7 days per week automated test software, where software is always being tested, so any new checkins are tested as soon as it is checked in the source control system.

I am using Maple on my home kitchen table and find so many bugs. So I always wonder  why did not Maple with all the engineers it has not find these bugs? 

Only explanation I can think of is that Maplesoft has no dedicated dept/person(s) for just software testing. So each individual developer inside Maplesoft do their own basic testings on their functions they write and that is it.

But many bugs only show when different parts of the software interact with each other in unforeseen ways.

Yes, the timelimit hanging is the worst. one can work around most other bugs in Maple. But can't work around timelimit itself hanging. Even though timelime has improved over the years, it still sometimes hangs so it is still work in progress.

 

@Carl Love 

Fyi, your proc gives same result as subsindets on the examples I tried it on on that help page.

SubsIndets:= proc(e, T::type, f)
local X:= [sort([indets(e,T)[]], key= length)[], e];

    while nops(X)>1 do
       X:= subs(X[1]= f(X[1]), X[2..])
    od;
    X[-1..][]

end proc:

tests:=[ [ exp(x) + exp(2*x) + sin(x),exp(anything), f -> ln(f) ],
         [ F( G( x ), F( x, y ) ), 'specfunc( anything, F )',f -> subsop(0 = H, f ) ],
         [F( G( x ), F( x, y ) ), 'specfunc( symbol, F )', f -> subsop( 0= H, f ) ],
         [[sin( x ), cos( y ), tan(z)], 'symbol', y -> y + Pi ],
         [ sin(x+y) + x*(x+1)+(x+1)*(x+2), '`*`', expand ],
         [ sin((3+I)*Pi) + (x+y)^100, 'sin( anything )', expand ],
         [ 2 + f(4, g(h(6))),function, fn -> subsindets(fn, integer, i -> cat(i, " in ", op(0, fn))) ]]:
 

T:=map(X->[subsindets(X[1],X[2],X[3]),SubsIndets(X[1],X[2],X[3])],tests):
Matrix(T);
 

Matrix(7, 2, {(1, 1) = ln(exp(x))+ln(exp(2*x))+sin(x), (1, 2) = ln(exp(x))+ln(exp(2*x))+sin(x), (2, 1) = H(G(x), H(x, y)), (2, 2) = H(G(x), H(x, y)), (3, 1) = F(G(x), H(x, y)), (3, 2) = F(G(x), H(x, y)), (4, 1) = [-sin(x), -cos(y), tan(z)], (4, 2) = [-sin(x), -cos(y), tan(z)], (5, 1) = sin(x+y)+2*x^2+4*x+2, (5, 2) = sin(x+y)+2*x^2+4*x+2, (6, 1) = -I*sinh(Pi)+(x+y)^100, (6, 2) = -I*sinh(Pi)+(x+y)^100, (7, 1) = 2+f(`4 in f`, g(h(`6 in h`))), (7, 2) = 2+f(`4 in f`, g(h(`6 in h`)))})

map(X->evalb(X[1]=X[2]),T)

[true, true, true, true, true, true, true]

 


Download test_subsindets.mw

@Carl Love 

Maybe instead of key=length,   an option is to use  key=MmaTranslator[Mma]:-LeafCount  to see if it gives results similar to subsindents for all cases.

@Alfred_F 

It sounds like you wanted to do symbolic linear algebra? As far as I know, Maple does not have specific support for this sort of thing.  ie. to declare a symbolic matrix or vector of size n, with n being symbol and not have specific value.

Maple's main competitor introduced new in V 14.1  symbolic arrays where one can do basic linear algebra operations on them. I have not use these myself, but here is examples.

X is every real multiple of the unit/identity matrix, i.e. the main diagonal is occupied by a constant and all other matrix elements are zero.

Are you sure about this? Here is random A matrix of 3,3, size (i.e. n=3) and X matrix which satisfies X - A^(-1).X.A=0 and you see X is not what you describe above.



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/a.mw .
 

Download A.mw

 

@janhardo 

The second argument in 

subsindets(expr, exp, f -> ln(f));

has to be a maple type. But exp is not name of type. This makes it work

 subsindets(expr, 'specfunc'(exp), f -> ln(f));

As to why your second example

subsindets(expr, exp(anything), f -> ln(f));

worked. I am not sure. My guess is has to do with the fact that  exp(anything) has type function, but exp on its own (which you used in the first example has type procedure.

Either way, I always use 'specfunc'(name_of_function)  or 'specfunc'(anything,name_of_function)  and not the raw name of the function as you did. Reference: structured types in Maple.

@Axel Vogt 

What do I need to try it with no Physics? Is just changing the libname and removing the Physics from the path is enough? or do I need to do something more?

Btw, are you also on windows? it is possible it might not hang on mac or Linux. I only have Maple on widnows 10. Also, did you try increasing the timelimit to longer values? say 60 or 100 seconds? as it depends on the speed of the CPU also.

btw, I just removed Physics from libname, and it still hangs just the same. Unless you mean by no Physics something other than just doing this.

fyi, V 2024.1 gives what you show as expected result.

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

restart;

J2 := Int(sin(p*x), x);

Int(sin(p*x), x)

K2 :=eval(J2, Int = ((a, b) -> Int(mtaylor(a, x=0, 5), b)));

Int(p*x-(1/6)*p^3*x^3, x)

 

 

Download int_sept_21_2024.mw

Your code makes no sense to me. Why are you substituting x into the ode? There is no x at all anywhere. The independent variable is y and not x.  Also what does this BC mean?

D(psi)(-1 - x^2/2) = 1,

?  What is x here?

You are doing numerical dsolve. So you need numerical value for x at least.

You are also specifying BC at too many points. Maple can only solved two point boundary value problem, not 3 or 4. So you need to fix your BC/IC also.

 

@Laurenso 

How can I change all \frac into \dfrac?

Just add this line at the very end after s was calculated

s:=StringTools:-SubstituteAll(s,"\\frac","\\dfrac"):

The result will be

\begin{enumerate}[label=\arabic*)]
\item $\sqrt{-5 x^{2}-5 x -1} = -4 x -1 $\hfill Answer: $\left\{-{\dfrac{2}{7}}, -{\dfrac{1}{3}}\right\}$
\item $\sqrt{-5 x^{2}-5 x -1} = x +1 $\hfill Answer: $\left\{-{\dfrac{2}{3}}, -{\dfrac{1}{2}}\right\}$
\item $\sqrt{-5 x^{2}-5 x -1} = 4 x +3 $\hfill Answer: $\left\{-{\dfrac{5}{7}}, -{\dfrac{2}{3}}\right\}$
\item $\sqrt{-5 x^{2}-5 x +4} = -5 x +3 $\hfill Answer: $\left\{{\dfrac{1}{2}}, {\dfrac{1}{3}}\right\}$
\item $\sqrt{-5 x^{2}-4 x +2} = -5 x +2 $\hfill Answer: $\left\{{\dfrac{1}{3}}, {\dfrac{1}{5}}\right\}$
\item $\sqrt{-5 x^{2}-4 x +2} = -2 x +1 $\hfill Answer: $\left\{-{\dfrac{1}{3}}, {\dfrac{1}{3}}\right\}$
\end{enumerate}

 

@Carl Love 

It is like this:

RootOf(9*x1-5+RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808), x1, 171590466306199/562949953421312 .. 343180932612401/1125899906842624);

Error, (in property/ProbablyNonZero) cannot determine if this expression is true or false: ln(.1e11*abs(-.304805898398896+1.*RealRange(.304805898398895,.304805898398897)))/ln(10) < -6

RootOf(9*x1-5+RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808), x1, 171590466306199/562949953421312 .. 343180932612401/1125899906842624);

5/9-(1/9)*RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808)

restart;

RootOf(9*x1-5+RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808), x1, 171590466306199/562949953421312 .. 343180932612401/1125899906842624);

Error, (in property/ProbablyNonZero) cannot determine if this expression is true or false: ln(.1e11*abs(-.304805898398896+1.*RealRange(.304805898398895,.304805898398897)))/ln(10) < -6

RootOf(9*x1-5+RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808), x1, 171590466306199/562949953421312 .. 343180932612401/1125899906842624);

5/9-(1/9)*RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808)

restart;

RootOf(9*x1-5+RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808), x1, 171590466306199/562949953421312 .. 343180932612401/1125899906842624);

Error, (in property/ProbablyNonZero) cannot determine if this expression is true or false: ln(.1e11*abs(-.304805898398896+1.*RealRange(.304805898398895,.304805898398897)))/ln(10) < -6

RootOf(9*x1-5+RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808), x1, 171590466306199/562949953421312 .. 343180932612401/1125899906842624);

5/9-(1/9)*RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808)

 

 

Download twice_rootof.mw

@Rouben Rostamian  

Thanks. good point. I overlooked this reformating of the ode. Now it makes sense.

First 11 12 13 14 15 16 17 Last Page 13 of 91