## Simple code for MonteCarlo approximation of Pi...

Hello everybody,

But for starting easy, I try this:

with(RandomTools[MersenneTwister]);
directpi := proc (n)
local i, x, y, N;
N := 0;
Digits := 2;
for i to n do
x := GenerateFloat();
y := GenerateFloat();
if x^2+y^2 < 1 then
N := N+1:
end if:
end do:
N;
end proc;

evalf(directpi(4000)/(1000.0), 4);

3.176

I would like to know if this code is appropriate and if it is possible to have a random number between -1 to 1 so it will be easier to plot the points in the square with the circle inside.

Thank you.

```--------------------------------------
Mario Lemelin```
```Maple 18 Ubuntu 13.10 - 64 bitsMaple 18 Win 7 -  64 bits
messagerie : mario.lemelin@cgocable.ca
téléphone :  (819) 376-0987```

## Solving system of ODEs by Laplace transform...

I'm trying to solve this system of ODEs by Laplace transform.

> de1 := d^2*y(t)/dt^2 = y(t)+3*x(t)

> de2 := d^2*x(t)/dt^2 = 4*y(t)-4*exp(t)

with initial conditions

> ICs := y(0) = 2, (D(y))(0) = 3, x(0) = 1, (D(x))(0) = 2

Using

> deqns := de1, de2

and

> var := y(t), x(t)

I need to solve it for both y(t) and x(t), I have tried this by:

> dsolve({ICs, deqns}, var, method = laplace)

And

> dsolve({ICs, deqns}, y(t), method = laplace)

> dsolve({ICs, deqns}, x(t), method = laplace)

However I get this error message:

Error, (in dsolve/process_input) invalid initial condition

Any help is appreciated

## automatically simplify results?...

Hi Maple friends.

Maple tends to spit out results(which comprise of variables) in very complicated forms, and I have to use the context menu to select 'simplify' to reduce them.

Is there a setting which will automatically simplify Maple's output?

## trying to call a procedure.........

test.mw

can someone please look at this modified C.Love code, hopefully the problem i'm having is self explanatary.

## FeynmanDiagrams...

I remember to have seen and used a command to make the graph of the output of FeynmanDiagrams but I can not find more sample files. Someone can tell me how to do (plot a Feynman graph using the result of FeynmanDiagrams).

Thanks and sorry for my english.

## Current directory...

How do I permanently change the current directory on a MAC computer?

Kind regards

Per Kirkegaard

## How to generate superscript/subscript characters i...

Hello,

I would like to know how to generate super/subscript characters in axis label. I have tried the double underscore (atomic variable style) and the super/subscript under "Format" in document mode but no luck at all. Any comment/suggestion is truly appreciated.

Yu-Hung Lien

## Eigenvalues of non-commuting objects...

Hi guys,

If I have a Hermitian 4x4 Matrix with elements that behave like complex numbers except that they do NOT commute. Is it possible to diagonalize this Matrix using Maple and the Eigenvectors - method of the LinearAlgebra package?

Cheers

NOh

P.S.: I am using Maple 18

## IT Solutions for the Next Generation of Engineers

Maple 18

Presented at the National University of Trujillo - CUICITI 2014.

IT Solutions for the Next Generation of Engineers

Descarga aqui los Slides de la presentación/mw CUICITI-2014

CUICITI_09102014.pdf

Soluciones_Informáticas_para_la_siguiente_generación_de_Ingenieros.mw

Lenin Araujo Castillo

Physics Pure

Computer Science

## QM perturbation theory: too many levels of recursi...

Hello everyone,

I've been trying to do some perturbation theory and ran into some problems I don't quite understand. I implemented the Hamiltonian of the Bose-Hubbard model and treated the hopping as a perturbation. Calculating the second order energy shift is easily accomplished, but when I'm only interested in one of the two occuring terms, I run into problems. The calculation takes minutes to finally fail, giving me an "too many levels of recursion"-error. I need to be able to just pick a few terms for some calculations, I'm doing, and can't figure out what I might be doing wrong. Here is the source code (download is below):

 >
 >
 >
 (1)
 >
 >
 (2)
 >
 >

It would be great, if someone could point out the mistake, I'm making. I copy/pasted the last line, so there shouldn't be any typos.

Sören

## solving for x gives me x->...

Every time I try to solve for a variable it gives me an arrow.

ex solve(5.6*10^-4=((x)(x))/(0.2-x),x)

gives me

x -> 7/62500 - 7/12500 x

How do I get it to stop giving me the x -> ?

Or at least reset some options so I don't have to reinstall the whole thing?

## How to calculate eigenvalues of complex symbolic M...

Hello,

first of all, this is my very fist question in this forum, so please excuse some formal mistakes I may make...

Using Maple 18.01 on Windows 7 64bit

To the topic: I want to calculate the eigenvalues of a complex matrix like this (just as an example):

M := Matrix(2, 2, {(1, 1) = a+2.5*I, (1, 2) = 1-I*a, (2, 1) = 4, (2, 2) = a})

When I try to calculate

Eigenvalues(M)

I get

Error, (in LinearAlgebra:-Eigenvalues) expecting either Matrices of rationals, rational functions, radical functions, algebraic numbers, or algebraic functions, or Matrices of complex(numeric) values

Strange, because if I replace the "2.5" with just "2", so an integer instead of a float, I get results:

I don't understand this strange behavior, since Mathematica i.e. calculates everything just fine...:

Thanks in advance for any suggestions.

## How to tell Maple that |a,b,c> is an eigenvector o...

Hi everyone,

I am exploring the physics package a bit. However, in the documentation I didn't find anything about how to setup operator-ket relations like:

A | l,m,n > = f(l,m,n) | g(l,m,n), h(l,m,n), z(l,m,n) >

The Creation and Annihilation operators were the only predefined ones I found.

Cheers

NOh