MaplePrimes Questions

given 

r1:=   -1 <= x and x <= 0;
r2:=   0 <= x and x <= 1;

We see that the above can be simplified to one inequality

-1<= x and x<=1

The closest I found to do this is

r1:=-1 <= x and x <= 0;
r2:=0 <= x and x <= 1;
solve(r1 or r2,x);

which gives RealRange(-1, 1) but I'd like to get the form  -1<= x and x<=1 similar to:

I tried convert to piecewise and simplify and few other things. Is there a trick in Maple to simplify/combine/join inequalites like the above? i.e. convert RealRange(-1, 1) to -1<=x and x<=1 

everything is on the real line.

Maple 2023.2

> kernelopts(version)
   Maple 2023.2, X86 64 LINUX, Nov 24 2023, Build ID 1762575

I got results I did not expect using &^ and mod. So, I created a simple example.

powermod.mw

&^ ... mod does not seem to allow () to set order of execution where ^ ... mod does.

How does &^ ... mod arrive at the values that are different than ^ ... mod?

Tom Dean

How to solve this type of ode in maple

need the value of S, Q, E

how do i change the decimal separator, i cant find the setting anywhere. I already changed all the settings in windows related to this. It displays numbers the way i want it to, by separating decimals using a comma, since that's what I'm used to. My regional settings on windows are also correct, however I can't seem to get maple to use the same separation. It looks like 123.13 when i want it to be 123,13. I couldn't find a solution online so I made an account here in the hope of finding a solution. Thanks

Does anyone know the difference between the standard inv(A)*b to solve A*x=B linear system vs. the A\b usage by Matlab?  I believe they are different in method.

I can correctly solve with MatrixInverse(A).b for x but was wondering the differences, accuracy and overall shortcut command versus typing the full MatrixInverse function.

Just trying to improve my portability knowledge.    

Thanks in Advance,
Bill

Here is a toy example

L:=<<1 | 2 | 3>; <4 | 5 | 6>>; 
(L[1,2], L[2,3]):=(0 $ 2):

As expected, L now equals <<1 | 0 | 3>; <4 | 5 | 0>>

Now I want to make a bulk assigment with the use of seq operator

(seq('L'[q,  q+1] , q=1..2)) := (0 $ 2);

but it fails. Nevertheless

seq('L'[q,  q+1] , q=1..2)

works as needed and returns unevaluated L[1,2], L[2,3]

I would like to simulate the evolution of the so-called B, C, K, W system and SKI combinator calculus in Maple.
The rewrite rules of them are simple: 

S(x)(y)(z)=x(z)(y(z))
K(x)(y)=x, and 
I(x)=x. (Note that since  is protected, I shall use  hereafter.)

However, if I try to evaluate the following example given in the  article, 

Maple will only return an unchanged result: 

restart;
applyrule([cS(x::anything)(y::anything)(z::anything) = x(z)(y(z)), 
   cK(x::anything)(y::anything) = x, cI(x::anything) = x], 
  cS(cK(cS(cI)))(cS(cK(cK))(cI))(x)(y)); # Unable to reduce??? 
 = 
              cS(cK(cS(cI)))(cS(cK(cK))(cI))(x)(y)

I believe that this is not an outlier.
Here are two additional instances: 

> rls := [cS(x::anything)(y::anything)(z::anything) = x(z)(y(z)), cK(x::anything)(y::anything) = x]:
> map2(applyrule, rls, [cS(cS(cS)(cS))(cS)(cS(cS))(cK), cS(cS(cS))(cS)(cS)(cS)(cS(cS)(cK(cK)))]);
                       [cS(cS(cS)(cS))(cS)(cS(cS))(cK), cS(cS(cS))(cS)(cS)(cS)(cS(cS)(cK(cK)))]

>

So why can't `applyrule` apply rules as desired? Meanwhile, how to automatically and thoroughly (like :-eval['recurse'] or MmaTranslator:-Mma:-ReplaceRepeated) apply those transformation rules to 

  1. , and

I have read something like How to apply a recursive rule in an expression? - MaplePrimes, but they are not the same issue.

I have this overloaded function foo(). 

restart;

foo:= overload(  
        [
        proc(A::integer,$)option overload;
            print("first one, _passed = ", _passed," _npassed = ",_npassed);             
        end proc,

        proc(A::integer,B::integer,$)option overload;
            print("second one  _passed = ", _passed," _npassed = ",_npassed);
        end proc
       ]);

Which works OK. so I can now do 

foo(1)
foo(1,2)

But I wanted to indicate that the proc returns say ::integer , and this where I am stuck, I do not know where to add this ::integer

With non-overloaded proc's, this is the syntax

foo:=proc(A::integer,$)::integer;
     ......
end proc;

but I can't do this with the overloaded function. If I type

foo:= overload(  
        [
        proc(A::integer,$)option overload;
            print("first one, _passed = ", _passed," _npassed = ",_npassed);             
        end proc,

        proc(A::integer,B::integer,$)option overload;
            print("second one  _passed = ", _passed," _npassed = ",_npassed);
        end proc
       ])::integer;

Maple simply does not like it. typing foo(1) now it just echos the definition back.

And these give syntax errors

foo:= overload(  
        [
        proc(A::integer,$)::integer option overload;
            print("first one, _passed = ", _passed," _npassed = ",_npassed);    
        end proc,

        proc(A::integer,B::integer,$)::integer option overload;
            print("second one  _passed = ", _passed," _npassed = ",_npassed);
        end proc
       ]);

Tried many other variations and looked at help but see nothing to far.

Can one add ::type to indicate type proc returns with overloaded proc?

Maple 2023.2.1

I tried to solve differential equations with boundary conditions, but I boundary conditions are tends to infinity. How to sol;ve this?N1.mw

I want to execute a function at least one time. So, I use do ... until ...

However, the function sometimes returns FAIL. So, I looked at help FAIL.

FAIL.mw

The while loop works. The until loop returns an error. evalb(testeq(...)=FAIL) seems overly complicated.

Tom Dean

hello maple team,

i'd really like to know more about the differences among the products ticked above in their different license types

thank you very much in advance for your help dear friends and some who are brothers in Christ Jesus

much Love and regards to you all

julio

I am starting a course on differential forms. They have introduced the wedge product by comparing it to the curl product. I can do it by hand. But I would like to do it in Maple. I tried to read the help page of with(difforms) but I cannot see how to do it. And to add to the complication, since my keyboard is in French, I don't know how to insert the circumflex accent right after &. Maybe I should just wait that more theory is done, but just for the principle, I would like to be able to do it. For example, the vectors are:

a=(1, 3,-2)

b=(5, 2, 8)

Thank you in advance for your help.

Mario

Hi Dear

Is it possible to know the algorithm and method behind a specific Maple command? 

Thank you in advance.

The attached integral is plotted quite quickly, but the search for the maximum and for the inverses of function values takes time. Can the search be accelerated or is the integrand simply too complicated?

Int(22.89730452*exp(-3.373250126*10^6*x^2)*sqrt(2)*(erf(1298.701299*sqrt(2)*(sqrt(2.500000000*10^(-7)-x^2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*sqrt(2)*(sqrt(2.500000000*10^(-7)-x^2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc)

Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc)

(1)

plot(Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc), y = 0 .. .25)

 

unapply(int(op(1 .. 2, Int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3, method = _d01ajc))), y)

proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*x^2)*2^(1/2)*(erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*2^(1/2)*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc

(2)

CodeTools:-Usage(Optimization:-Maximize(proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*(x^2))*(2^(1/2))*(erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc, 0 .. .15))

[HFloat(0.0356073228322897), Vector[column](%id = 36893490875463313756)]

(3)

CodeTools:-Usage(fsolve((proc (y) options operator, arrow; int(22.89730452*exp(-3373250.126*(x^2))*(2^(1/2))*(erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)+(1/40)*y-0.1540000000e-2))+erf(1298.701299*(2^(1/2))*((0.2500000000e-6-x^2)^(1/2)-(1/40)*y+0.1540000000e-2))), x = -0.5000000000e-3 .. 0.5000000000e-3) end proc)-0.5e-2, 0 .. .15, maxsols = 2, method = subdivide))

0.2456248637e-1, 0.9863751363e-1

(4)

Download slow_maximize_and_fsolve.mw

I am trying to solve three nonlinear equation for A, B and P. f solve is not working for them.

File ling: SOlve.mw

First 25 26 27 28 29 30 31 Last Page 27 of 2308