## Can't understand how Statistics[Likelihood] works...

Asked by:

Hi,
Can somebody explain me these strange results ?

restart:
with(Statistics):
X := RandomVariable(Normal(1.0, 1.0)):
S := Sample(X, 10):

# naively... but it's not what I was expecting for
#                maybe a misuse of the 'normalize=truefalse' option ????
Likelihood(Normal(1.0, 1.0), S);
# a strange answer

# 2nd way
A := Likelihood(Normal(m, 1.0), S):
evalf(subs(m=1.0, A));
# this is the good answer
0.004387

# third way
Likelihood(Normal(1.0, 1.0), S, 'normalize=false');
4.48e-7    # a wrong answer

Thanks for your enlightenment

## Can we use this euler lagrange command for the sys...

Asked by:

Can we use this euler lagrange command for the system of pde's?

If we have a system without lagrangian then euler opertor is applied corresponding to three dependent variables.

so we have three equations but in this euler lagrange command no dependent variable is mentioned.

## Fermionic Operators on a Lattice...

Asked by:

Using the Physics package (the newest updates for Maple 2016), I am trying to get a basic setup of fermions on a lattice. My lattice is indexed j=1,...,L for some length, L (I'm trying just for L=4 by hand). Using combinat and arraytools and lsit tools, I can generate my entire list of configurations from [0,0,0,..,0], [1,0,0,...,0], ..., [1,1,...,1]. I read through this https://www.mapleprimes.com/questions/151320-Creation-And-Annihilation-Operators# which should be even more general than my problem, but I'm not getting the anti-commutation relationships to work out properly. In that link, the original poster is putting the kets in by hand, I would like to generate them.

So I have this:

```restart with(Physics): with(combinat): with(LinearAlgebra): with(ArrayTools): with(ListTools):```

```Setup(mathematicalnotation=true): Setup(quantumop={cre,ann}, algebrarules={%AntiCommutator(cre[j],ann[k])=I*KroneckerDelta[j,k],%AntiCommutator(cre[j],cre[k])=0, %AntiCommutator(ann[j],ann[k])=0})```

and my algebra is defined. But if I try to compute AntiCommutator(ann,ann) is doesn't evaluate it but computes AntiCommutator(cre,ann) perfectly fine.

Okay. The algebra is defined, then I create my configurations by using a traingular array and then permutations (and some list/array tools to product vectors that look like [0,0,0,0],[0,0,0,1],...,[1,1,1,1])

```Config_Gen := proc(Length) global Configurations; local fermionarray,n_n,V,Ln,i_i; fermionarray:= Array(triangular[upper],1..Length+1,1..Length,fill=1); for n_n from 1 to Length+1 do V[n_n] := fermionarray(n_n,1..Length); Ln[n_n] := permute(convert(V[n_n],list)); end do; Configurations := Ln; for i_i from 2 to Length+1 do     Configurations := [op( Configurations), op(Ln[i_i] ) ]; #    Configurations := Reverse([op( Configurations), op(Ln[i_i] ) ]); end do;  print("Table of configuratons is", fermionarray);  print("The table written as a set of vectors is", V);  print("Permutations of generators is", Ln);  print("Full list of Configurations is", Configurations); end proc;```

For Config_Gen(4) this makes the configurations perfectly fine. Then I need to translate these configurations into creation operators acting on the 0-particle vacuum:

```for i_i from 1 to 2^4 do Ket(psi,Configurations[i_i]):= product(cre[j_j]^Configurations[i_i][j_j],j_j = 1 .. 4)* Ket(psi,Vacuum); nnn:= sum(Configurations[i_i][j_j],j_j=1..4) : fff:=(-1)^(nnn*(nnn-1)/2): Bra(psi,Configurations[i_i]):= fff* Bra(psi,Vacuum) * product(( ann[j_j] )^Configurations[i_i][j_j],j_j = 1 .. 4); #[seq(ann,j=1..4)]; end do; value(Simplify(Bra(psi,[1,1,0,1]) *Ket(psi,[1,1,0,1]) ));```

Which generates the bras and kets. The factors of (-1) are chosen to give the correct bracket. A problem: For some reason, the product in Maple gives the same when I do `Configurations[i_i][(4+1)-j_j]`.

Some other problems: When I go to evaluate `AntiCommutator(ann,ann) `or more explicitly` ann*ann + ann*ann`, the worksheet doesn't simplify. Is there a nice way to use the built in Annihilation and Creation operators of the physics package into the tensorproduct space on which I'd like to do calculations?

## Can I find which of my worksheets reference a spec...

Asked by:

I would like to find which of my approximately 150 recorded worksheets reference the VariationalCalculus package.

Instead of tediously displaying these one at a time, is there a search mechanism that will list the names of all my worksheets containing the command with(VariationalCalculus)?

## How to verify this solution in the given pde....

Asked by:

restart;
with(DEtools);
assume(r::real, a::real, b::real, upsilon::real, sigma::real, x::real, y::real, t > 0);
assume(sigma > 0); assume(-b^2-r+2 > 0);
V := -2*exp(I*(sqrt(-b^2-r+2)*x+b*y+r*t))*sqrt(1/sigma)*sech(-t*(-2*sqrt(-b^2-r+2)-2*b)-x-y):
pde := I*(diff(V, t))+diff(V, x, x)+diff(V, y, y)+sigma*abs(V^2)*V = 0: evalc(pde);

solution.mw

## Maple 2016 loads and vanishes ...

Asked by:

I am new to Maple and recently installed the software. Surprisingly, it attempt to load by bringing the splash screen and later open the interface but goes off without any error or warning. Can anyone help me out as I really need to use it?

## Summation procedure involving multiplication and l...

Asked by:

Hi everyone again

This one is linked to my previous 2 question.

Essentially I am trying to use a procedure to reproduce the formula:

S(j) = (1 + sum(H_j*T_j,j=1..n))/(1 + sum(1/(H_j*T_j),j=1..n))

BigProc:= proc(H::list,T::list)
local Form, i;
Form:=[];
for i from 1 to nops(H) do
Form := [op(Form),(1 + [sum(H[1..i]*~T[1..i],i=1..5)])/~(1 + [sum(1/~(H[1..i]*~T[1..i]),i=1..5)])]
end do:
end proc:
MainProc([1,3,5],[3,6,8])

Error, (in sum) summation variable previously assigned, second argument evaluates to 1 = 1 .. 5

The actual answer should be (3, 396/25,22320/509)

ie

S(1) = (1+ 3)/(1+(1/3)) = 3

S(2) = (1 +(3+18))/(1+1/3 + 1/18)) = 396/25

S(3) = (1 +(3+18+40))/(1+1/3 + 1/18 +1/40) = 22320/509

I feel like I am missing a few things to my procedure. Any help would be greatly appreciated!

## Sorting a list based on another list...

Asked by:

Hi

This question may have been asked before but I cannot find it!

I am currently have 3 lists:

L:= [1,3,5,2,3]

M:=[4,2,4,6,2]

R:= [5,3,2,1,4]

I would like to be able to come up with a way (I assume a procedure) where I can order L and M based on the numerical order of R. So in this case that would be:

R:=[1,2,3,4,5]

L:=[2,5,3,3,1]

M:=[6,4,2,2,4]

I hope this makes sense? Any help would be greatly appreciated!

## How can I improve this use of DirectSearch?...

Asked by:

The uploaded worksheet animates a cam formed of two Archimedean spirals as the cam rotates, creating vertical motion in a circular cam follower.

DirectSearch is used to locate the centre of the follower, however I experience two problems with this use.

First: DirectSearch places the follower centre sometimes above and sometimes below the cam surface, seemingly at random.

Second: seemingly at random, DirectSearch produces completely wrong values for the follower centre unless its SolveEquations command is executed with the initialpoint values stated in the worksheet. I arrived at these by extensive trial and error.

Why does the first problem occur and is there a way to code SolveEquations to avoid it?

Is there a writeup anywhere which can guide me to correct initialpoint values for a particular SolveEquations attempt?

Archimedian_spiral_cam_follower.mw

## maple can not integrat an expression...

Asked by:

I can not integrate the following integral using maple 2016. Please guide me how to do it. I am a new user.

int(12.*x^3*c+6.*x^2*c+x^2*exp(x^3*c)*exp(x^2*c), x = 0. .. 1.)

## Why Maple does not simplify...

Asked by:

Why Maple does not simplify to 1

beta^(1/2)*(1+beta^(1/2))/(beta+beta^(1/2))

## How do I collect & match polynomial coefficients f...

Asked by:

I have several functional equations in equally many unknown functions of at least two variables, plus parameters.  ("collect" works just for single equations, right?)

I know that for certain parameter ranges, all the functions involved will be quadratic, and I know some coefficients are zero.  That gives me some  coefficients to determine.  I want to

1. specify the functional equations [done in a very primitive low-tech way in the attachment, using atomic variables rather than indices ... have I done correctly?!?]
2. get Maple to collect coefficients (the K's and the L's in the attachment; the variables are (y,z))
3. get Maple to state an equation system these coefficients have to satisfy (these will unfortunately be coupled quadratics)
4. get Maple to solve that equation system if possible, and if not: to tell me when (= for what parameter values, parameters being the "remaining letters" in the attachment) I have specified enough coefficients
5. in case of a solution, get Maple to tell me which coefficients are real and positive (for those that are solution of quadratic eq's: whether a positive solution exists)

Phew. I am still a complete newbie. Edit: Attachment link: STcoeff2match.mw where the equations themselves are EQ0, EQ1 and EQ2 at the bottom. Copying and pasting them, they look like this (download STcoeff2pastedEQs.mw) >  >   ## How I can plot a square ...

Asked by:

Dear All, If I have a square with lenght b and width 2a .The question is how can I make Maple plot this square as points

.I want to define a function f(x_[i],y_[i]) for all sides.

Thanks

## How do i solve hard spring ode in maple 2016....

Asked by: ## How to substitute this transformation in the given...

Asked by:

restart;
with(PDEtools);
assume(k::real, x::real, omega::real, t::real, theta::real, c::real);
tr0 := c*(t*upsilon+x) = xi;
tr1 := I*(k*x+omega*t+theta);
tr2 := phi(lhs(tr0))*exp(tr1);
PDE := proc (u) options operator, arrow; I*(diff(u, t))+diff(u, x, x)-I*sigma*u*(conjugate(u)*(diff(u, x))-u*(diff(conjugate(u), x))) end proc;
Eq1 := PDE(tr2);
Eq2 := simplify(convert(expand(subs(tr0, Eq1)), diff));

for_maple_prime.mw

﻿