Maple 2015 Questions and Posts

These are Posts and Questions associated with the product, Maple 2015

Let E be a random variable of expectation mu and A an algebraic expression containing no random variable.
If E has any known Maple distribution, then  Mean(A+E) = A+mu.

But if E is an "abstract" random variable, Mean doesn't seem capable to compute the expectation of A+E.
Notional example:

restart:
with(Statistics):
E := RandomVariable(Normal(mu, sigma)):
Mean(f(x)+E)
                           f(x) + mu
E := RandomVariable(Distribution(PDF = (z -> f(z)), Mean=mu)):
Mean(f(x)+E); 
     int((f(x) + _t) f(_t), _t = -infinity .. infinity)

IntegrationTools:-Expand(%);
        f(x) (int(f(_t), _t = -infinity .. infinity)) + (int(f(_t) _t, _t = -infinity .. infinity))

Questions:

  • Why does Mean not behave as expected for an abstract random variable?
  • Is there a simple way to obtain the expected result (Mean (A+E) = A+mu) (maybe by completing the definition of the distribution of E, or by any other means)?

TIA

PS: I know that I can replace Mean(A+E)  by A+Mean(E)  to obtain the desired result: this is not the type of answer I look for.

PS: I know (since Carl Love showed me how long ago) that I can define a "random variable" plus an operator Expectation such that Expectation(A+E)  by A+Expectation(E) ... but it's not a way I would call simple

Expectation := proc(e::algebraic)
     local a,b;
     if not hastype(e, RV) then e
     elif e::RV then 'procname'(e)
     elif e::`+` then map(thisproc, e)
     elif e::`*` then
          (a,b):= selectremove(hastype, e, RV);
          b*thisproc(a)
     else 'procname'(e)
     end if
end proc:

#------------------------------------------------------------------------

TypeTools:-AddType(
     RV, 
     {RandomVariable, 
     'RandomVariable^posint', 
     '`*`'({RandomVariable, 'RandomVariable^posint'})
     }
):
eval(Expectation(f(x)+E), Expectation=Mean)
                           f(x) + mu

 

Hello everyone. I took part in a project in which we had to solve problems with Maple 2015. The managers gave us a permanent license. However recently I had trouble on my computer and now Maple doesn't work anymore because it somehow lost the license. The project ended last year, so I can't really ask them anymore. Is there any way to get the license working again? I checked on the site but didn't found anything useful and I'd really need it for the final exam of the last year of high school...

Thanks in advance!

Dear Users!

For a given piecewise function S(x)

I want to generate the following functions phi[1], phi[2],... for n = 9

I shall be very thankful for your positive response. Please take care and thanks in advance.

I'm solving this equation:

eq3 := 2*lambda*(q[1]+p[1]*exp(t))*(q[2]+p[2])^2*p[1]*exp(t) = s[1]

eq4 := 2*lambda*(q[1]+p[1])^2*(q[2]+p[2]*exp(u))*p[2]*exp(u) = s[2]

solve({eq3, eq4}, {t, u})

This is what I get:

{t = ln(RootOf(-s[1]+(2*lambda*p[2]*q[1]+2*lambda*q[1]*q[2])*_Z+2*lambda*_Z^2)/((q[2]+p[2])*p[1])), u = ln(RootOf(-s[2]+(2*lambda*p[1]*q[2]+2*lambda*q[1]*q[2])*_Z+2*lambda*_Z^2)/((q[1]+p[1])*p[2]))}

I'm completely new at maple.

I can't find what _Z  and _Z^2 mean. Can anybody help? and how I can solve this _z and _Z^2

Thanks in advance

I've finally decided to see what I could to do with DocumentTools.
I started with these simple lines from ?DocumentTools:-Do 

restart:
with(DocumentTools):
Do(int(%expression, x=%from::integer..%to::integer));
Error, (in DocumentTools:-GetProperty) Attempted to retrieve property of unknown component expression.

These next ones return the expected plot but an alert window 

restart:
with(DocumentTools):
Do(%Plot1=plot(x^2, x=0..1));


However the Click and Drag icon is disabled in the plot toolbar and invisible in the plot menu.

The behaviour of these commands do not depend on whether they are written in a worksheet, a section or a code edit region.

Could you detail me the very first steps do use DocumentTools features?

TIA

DT-Do.mw

Is there like https://oeis.org/   Library available in maple for enumerate in for loop?

i would like to like shift 9 times and create 100 mapping for each sequence 

Hello Users!

I want to assign some specific names of elements in a vector A:

A:=Vector[row](19, {(1) = 14.9057064333276, (2) = 14.4384716751962, (3) = 14.0155569170648, (4) = 13.6381346589334, (5) = 13.3075724008020, (6) = 13.0254476426706, (7) = 12.7935628845392, (8) = 12.6139606264079, (9) = 12.4889383682765, (10) = 12.4210636101451, (11) = 12.4131888520137, (12) = 12.4684665938823, (13) = 12.5903643357509, (14) = 12.7826795776196, (15) = 13.0495548194882, (16) = 13.3954925613568, (17) = 13.8253703032254, (18) = 14.3444555450940, (19) = 14.9584207869626});

like

y[1,1]:=14.9057064333276;

y[1,2]:=14.4384716751962;

y[1,3]:=14.0155569170648;

...

y[1,19]:=14.9584207869626;

Later, I have to use y[1,1], y[1,2],...,y[1,19] for further calculations. I used op command but it does not work. Please help me how I can assign the name. 

I am waiting for your respone. Thanks in advance.

Dear Users!

Hope everyone is fine here. I want to formulate the table like give bellow (Table 5.17) in maple so that I can copy it in word file and can edit.

The values of y[1,1],y[2,1],y[2,2],y[3,1],y[3,2],y[3,3]...y[nops(HAq),nops(HAq)] present in the following maple code. Thanks in advance

Refine_Extrapolation.mw

Hi,

I want to solve this system of PDEs. Please let me know how I can solve it.

Kindly find both my code written in Maple and the image of the problem.

Best,

 

PDE.mw

Is there a way to make a library file that automatically has the functions/procedures loaded on startup and after it any new or open ".mw" can use functions/procedures from library with no redefinition?

It's ok isolate command? I need the solution sin(a)=+-1/(3^0.5)

Let A a (linear) partial differential operator and f=f(x, y, t) a function of space (x, y) and time (t).
Let DXY=[a, b] x [c, d], DT=[0..e] and  dXY the boundary of DXY.
Is it possible, with Maple 2015, to solve numerically the pde Af=0 in the open domain  DXY * DT
with Dirichlet conditions on dXY and initial condition f(DXY, 0)?
It seems that the option 'numeric' of pdsolve doesn't work with more than 1 "non time" independent variable:
Error, (in pdsolve/numeric/process_PDEs) can only numerically solve PDE with two independent variables, got {t, x, y}

Nevertheles I seem to remember seeing this on Mapleprime (?)
If Maple 2015 can't do it, can Maple 2020?

Thanks in advance

  • Remark: Af=0 is the heat equation with rho=Cp=lambda=1.
    I guess I could code the alternate directions method to transform  Af=0 into a sequence Axf=0,  Ayf=0 Axf=0 ... of 1D diffusion equations but I'm a little bit lazzy and I'm waiting for your feedback before doing this.

 

Dear Users!

Hope everyone fine here. I want to collocate Vector IntXYZ1 and IntXYZ2 present in file Q1 in such a way that the first M1M2 + 2(M3-1)M2 + 2(M3-1)(M1-2) rows are zero and other rows are collocated at x=(i-1)/(M1-1), y=(j-1)/(M2-1), t=(k-1)/(M3-1) for i = 2,3,…,M1-1, j = 2,3,…,M2-1, k = 2,3,…,M3 as given as XX (of order 27 by 27 with first 25 rows are zero) for M1=M2=M3=3

I am waiting for positive response to fix this issue. Thanks in advance

Q1.mw

Hi, 

Why does the use of  global  at the top level of a worksheet is no longer accepted in the most recent versions of Maple (it still was in Maple 2015), but only within procedures?

TIA

Hi 

How to add a legend to Statistics:-Histogram?

This could be particularly useful to compare histograms, for instance in

S := Statistics:-Sample(Normal(0, 1), 1000):
T := Statistics:-Sample(Normal(1, 1), 1000):

plots:-display(
  Statistics:-Histogram(S, color=gold, transparency=0.3, legend="N(0,1)"),
  Statistics:-Histogram(T, transparency=0.3, legend="N(1,1)")
);

But doing this generates the error Error, (in Statistics:-Histogram) display does not accept the legend option

And yes indeed, even this command

h := Statistics:-Histogram(S, legend="N(0,1)")

already produces the same error.

After having examined the structure of h and using a way Carl Love gave here How to change the colour inn Statistics:-Sunflower?  I finally obtained the expected plot.
 

HS := Statistics:-Histogram(S, color=gold, transparency=0.3):
HT := Statistics:-Histogram(T, transparency=0.3):

hs := evalindets([op(HS)], specfunc(COLOUR), c-> (c, LEGEND("N(0,1)")) ):
ht := evalindets([op(HT)], specfunc(COLOUR), c-> (c, LEGEND("N(1,1)")) ):

PLOT(op(hs), op(ht))



But this rather long a way to proceed (Note: it seems that the overrideoption  that acer suggested in this prevous thread doesn't "work" here?)
Do you have any idea if there is a simpler solution?

TIA

First 6 7 8 9 10 11 12 Last Page 8 of 72