Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • harvard1
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Development of a basic/simple simulator of mechanical behavior in 3 dimensions
KTH, School of Engineering Sciences (SCI), Mechanics.
2013 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesisAlternative title
Utveckling av en enkel mekaniksimulator i 3 dimensioner (Swedish)
Abstract [en]

This paper concerns the development of a simple simulator of mechanical systems, a basic program to model a body acted on by an outside force and extrapolate what is going to happen in the next moment. It should also be able to present the results graphically, in this case with 3D-graphics, as well as be reasonably faithful to what would actually happen.

To achieve this, the programming language Java, with a heavy reliance on the code package Java 3D, was used. Java was chosen for the fact that it is well documented, and Java 3D because it provided useful tools that would be difficult to re-create from the ground up.

In the model the simulator uses, solid bodies are treated as particles with a mass, position and velocity, while forces act as a point force on the body’s center of mass. The bodies are graphically represented by spheres.

Each body also contains an algorithm to update its position from its current velocity and the forces acting upon it in the current time-step. This is accomplished through Euler’s Method, via Newton’s law connecting mass to acceleration.

The simulator has purposefully been written in the simplest possible form, but has left room for adding more features in the future.

Three example simulations have been included in the code in order to demonstrate the simulator. These are explained in this paper.

Abstract [sv]

Denna rapport syftar till att dokumentera utvecklingen av en mycket enkel mekaniksimulator, ett program som ska kunna modellera en kropp som utsätts för en kraft och extrapolera sig fram till vad som händer i nästa ögonblick. Den bör även kunna redovisa resultatet av denna modell grafiskt, i detta fall med 3D-grafik, samt stämma någorlunda väl överens med verkligheten.

För att uppnå detta används programmeringsspråket Java, och i synnerhet kodpaketet Java 3D. Språket valdes för att det är så pass väldokumenterat, och Java 3D för att det gav ett antal användbara verktyg som vore svåra att skriva på egen hand,

I den modell som programmet ställer upp betraktas stela kroppar som partiklar med massa, position och hastighet, medan krafter fungerar som punktkrafter verkande på kroppens masscentrum. Grafiskt representeras de stela kropparna av sfärer.

Varje kropp har även en algoritm för att uppdatera sin position och hastighet utifrån de krafter som verkar på den vid det aktuella tidssteget. Detta görs via Eulers metod, via Newtons grundläggande samband mellan kraft och acceleration.

Simulatorn har avsiktligen skrivits i enklast möjliga form, och lämnar utrymme för att skriva till fler funktioner vid ett senare tillfälle.

Tre exempel har inkluderats i koden för att demonstrera simulatorns funktionalitet. Dessa förklaras närmare i rapporten.

Place, publisher, year, edition, pages
2013. , 26 p.
National Category
Engineering and Technology
Identifiers
URN: urn:nbn:se:kth:diva-133330OAI: oai:DiVA.org:kth-133330DiVA: diva2:660594
Supervisors
Available from: 2013-10-30 Created: 2013-10-30 Last updated: 2013-10-30Bibliographically approved

Open Access in DiVA

Martin Mossler Rockström kandidatex SA104X, CTFYS(827 kB)150 downloads
File information
File name FULLTEXT01.pdfFile size 827 kBChecksum SHA-512
52611b8769be362bb4fc7204d26ca9e284db90ff8b76d19fad7e89ec79d220c5f7680123b79414f5b74cf34b9b114e0aad194f4562e1e8b75111beb6d5b17502
Type fulltextMimetype application/pdf

By organisation
Mechanics
Engineering and Technology

Search outside of DiVA

GoogleGoogle Scholar
Total: 150 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 86 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • harvard1
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf