The aim of this thesis was to find a way of doing optimizations based on FEM-simulations and further to parallelize the computations in order to decrease the execution time. If proven possible the difficulty setting up these simulation and the expected decrease in runtime, would to be evaluated. Optimizations of magnet field strength and torque utilizing FEM simulations were conducted by using the particle swarm optimization (PSO) algorithm and the Matlab "partial differential equation toolbox" (PDE-toolbox). Two cases were optimized with and without parallel processing, and runtimes were measured for all runs. The aim was to run all simulations 10 times on three different computers. This was achieved to the majority of the simula...