
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main topics for this course are Brownian dynamics, chaos, fluctuation, genetic algorithm, modelling and simulations, moments and variance, Monte Carlo modelling of neutron motion. This is code for assigned task. Its main points are: Lattice, Function, Magnetization, Average, Energy, Return, Single, Site, Input, Matrix, Z-component, Axis
Typology: Exercises
1 / 1
This page cannot be seen from the preview
Don't miss anything!

function Mz = avgMagnetization(lattice) %avgEnergy: Returns the averge magnetization of a single % site in a lattice % Input: % lattice - a matrix representing the lattice of spins % containing the z component of those spins % Output: % Mz - the average magnetization of a site along % the z-axis Mz = sum(sum(sum(lattice)))/prod(size(lattice)); return