mmcdara

3743 Reputation

17 Badges

6 years, 75 days

MaplePrimes Activity


These are questions asked by mmcdara

Given this "pattern" to transfporm an expression into an arrow procedure

e := 1/b:
f := unapply(e, b):
f(3)
                               1
                               -
                               3

I would like now to use this same "pattern" to transform an expression e which depends on 2 indeterminates a and b into a "double layered arrow procedure" f.
Here is a notional example

e := a/b:
f := unapply(unapply(e, b), a);
                     a
           a -> b -> -
                     b

 f(A)(B)
                              a  
                              -
                              B  

How can I proceed in order that f(A)(B) gives A/B ?

TIA

Hi, 

This chunk of code gives me almost instantly the desired result with Maple 2015 but fails returning a result after 5 minutes when ran from  Maple 2020.
Changing the method or trying to tune their options doesn't fix the issue (for a larger value of the absolute tolerance the result, close to 1, is even obviously false).

Could you please help me to fix this?
TIA

restart;

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

with(Statistics):

Model_1 := (X, Y, Z) -> 1.3479120558270161+(-1)*.3390713110446567*X+1.0332964944900824*Y+(-1)*.8046331250569234*Z+0.9028899142595827e-1*X^2+(-1)*.28022910356641223*Y^2+1.3698461513469624*Z^2+0.6023630210658247e-1*Y*X+(-1)*.1988111077193626*Z*X+.6782902277463169*Z*Y+(-1)*0.7589729001497135e-1*X*Y*Z:

Model_2 := (X, Y, Z) -> .7215754021067852-.961682838202105*X+.4890842364596477*Y-.8214961524335734*Z+.15745942215497866*X^2-1.8023544416693338*Y^2+.36598799463016246*Z^2+1.3957614823018496*Y*X+.725398415577742*Z*X+1.9474707393604542*Z*Y-1.1780201448596594*X*Y*Z:

ExpMod_2 := unapply(expand(Model_2(Model_1(X1, Y1, Z1), Y2, Z2)), (X1, Y1, Z1, Y2, Z2)):
 

fy1 := PDF(Normal(0.1055, 0.0297), Y1):
fz1 := PDF(Normal(1, 0.2/3), Z1):
fy2 := PDF(Normal(0.17, 0.0476), Y2):
fz2 := PDF(Normal(1, 0.2/3), Z2):

C   := evalf(
         (1-eval(CDF(Normal(0.1055, 0.0297), Y), Y=0))
         *
         (1-eval(CDF(Normal(0.17, 0.0476), Y), Y=0))
         *
         (eval(CDF(Normal(1, 0.2/3), Z), Z=1.2)-eval(CDF(Normal(1, 0.2/3), Z), Z=0.8))^2
       ):

J  := Int(
        fy1*fz1*fy2*fz2*(1+tanh(10^4*(ExpMod_2(2.14, Y1, Z1, Y2, Z2)-1.25)))/2,
        Y1=0..0.4,
        Z1=0.8..1.2,
        Y2=0..0.4817,
        Z2=0.8..1.2,
        method = _CubaDivonne, methodoptions=[absepsilon=1e-8]
      ):

Prob(X__2 > 1.25) = nprintf("%1.3e", evalf(J)/C);
 

Prob(1.25 < X__2) = `8.462e-08`

(2)

 

Download 2020_issue.mw

A question by @Shameera  I was working on has disapeared meanwhile.
It was related to this previous thread 233822-How--To-Solve-This-Equation-By-Using but has not been displaced in it.
Did a regolaror do this or was it  @Shameera ?

When using the Statistics package to declare a variable, let's say A,  as random, this variable is associated (assigned?) to a variable of name _R or _Rn with n a non-negative integer.
Subsequently, each expression you construct that contains the name A is displayed in a form where A has been replaced by its "alias" name _Rn.
Here is an example
 

restart:
with(Statistics):
A := RandomVariable(Uniform(0, 1)):
B := RandomVariable(Uniform(0, 2)):
C := RandomVariable(Uniform(1, 2)):
F :=  (A+2*B)/C
                          _R + 2 _R0
                          -----------
                              _R1    

Is it possible,  to display F under its original form?
Is it possible to recover that _R is in fact A, that _R0 is in fact B and so on?

Maple (2015) fails to instanciate a Matrix with a list of elements of type string
(for instance Matrix(2, 2, ["A", "B", "C", "D"]) )

Matrix(2$2, [1$4]):    # ok
Matrix(2$2, [A$4]):    # ok

Matrix(2$2, ["A"$4]);  # not correctly understood by Maple (2015) 
Error, (in Matrix) initializer defines more columns (4) than column dimension parameter specifies (2)

Is this a bug?
Maybe something corrected in earlier versions?

1 2 3 4 5 6 7 Last Page 1 of 33