1
0
mirror of https://github.com/christiaangoossens/Planetary-Orbit-Simulator synced 2024-11-24 20:04:09 +00:00

Finished writing the leap frog system for calculating orbits

This commit is contained in:
Christiaan Goossens 2016-09-15 13:08:27 +02:00
parent 0428c6c7a8
commit 8cad200525
18 changed files with 419 additions and 192 deletions

6
simulator/.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@ -6,9 +6,21 @@
</artifacts-to-build>
</component>
<component name="ChangeListManager">
<list default="true" id="17f368cb-44f8-4101-9a29-49a0f4ff1f92" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/../.idea/workspace.xml" afterPath="$PROJECT_DIR$/../.idea/workspace.xml" />
<list default="true" id="17f368cb-44f8-4101-9a29-49a0f4ff1f92" name="Default" comment="Update workspace">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/verictas/pos/simulator/dataWriter/DataWriter.java" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/verictas/pos/simulator/dataWriter/WritingException.java" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/verictas/pos/simulator/mathUtils/AU.java" />
<change type="DELETED" beforePath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/nBabel.class" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/src/com/verictas/pos/simulator/nBabel.java" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/Main.class" afterPath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/Main.class" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/Object.class" afterPath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/Object.class" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/Simulator.class" afterPath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/Simulator.class" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/SimulatorConfig.class" afterPath="$PROJECT_DIR$/out/production/simulator/com/verictas/pos/simulator/SimulatorConfig.class" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/verictas/pos/simulator/Main.java" afterPath="$PROJECT_DIR$/src/com/verictas/pos/simulator/Main.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/verictas/pos/simulator/Object.java" afterPath="$PROJECT_DIR$/src/com/verictas/pos/simulator/Object.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/verictas/pos/simulator/Simulator.java" afterPath="$PROJECT_DIR$/src/com/verictas/pos/simulator/Simulator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/verictas/pos/simulator/SimulatorConfig.java" afterPath="$PROJECT_DIR$/src/com/verictas/pos/simulator/SimulatorConfig.java" />
</list>
<ignored path="simulator.iws" />
<ignored path=".idea/workspace.xml" />
@ -29,57 +41,7 @@
<favorites_list name="simulator" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="Main.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="578">
<caret line="34" column="11" selection-start-line="34" selection-start-column="11" selection-end-line="34" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Simulator.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Simulator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="578">
<caret line="34" column="40" selection-start-line="34" selection-start-column="40" selection-end-line="34" selection-end-column="40" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SimulatorConfig.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/SimulatorConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="4" column="33" selection-start-line="4" selection-start-column="33" selection-end-line="4" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Object.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Object.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2822">
<caret line="192" column="41" selection-start-line="192" selection-start-column="41" selection-end-line="192" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
<element signature="method#getSpeed#0;class#Object#0" expanded="false" />
<element signature="method#getPosition#0;class#Object#0" expanded="false" />
<element signature="method#setAcceleration#1;class#Object#0" expanded="false" />
<element signature="method#getAcceleration#0;class#Object#0" expanded="false" />
<element signature="method#setOldAcceleration#1;class#Object#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
@ -109,10 +71,18 @@
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/mathUtils/Vector3dMatrix.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/nBable.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/nBabel.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/Main.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/mathUtils/Test.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/CSVWriter.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/Test.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/WritingException.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/DataWriter.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/dataWriter/WritingException.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/Object.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/mathUtils/AU.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/Main.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/SimulatorConfig.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/Simulator.java" />
<option value="$PROJECT_DIR$/src/com/verictas/pos/simulator/dataWriter/DataWriter.java" />
</list>
</option>
</component>
@ -197,8 +167,22 @@
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="META-INF" />
<option name="myItemId" value="simulator" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="simulator" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="simulator" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@ -219,6 +203,32 @@
<option name="myItemId" value="simulator" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="mathUtils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="simulator" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="simulator" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="simulator" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="dataWriter" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
@ -255,6 +265,26 @@
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="Test" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="com.verictas.pos.simulator.dataWriter.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="MAIN_CLASS_NAME" value="com.verictas.pos.simulator.Test" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="simulator" />
<envs />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="DEPLOY" value="true" />
@ -467,12 +497,14 @@
<listeners />
<method />
</configuration>
<list size="1">
<list size="2">
<item index="0" class="java.lang.String" itemvalue="Application.Main" />
<item index="1" class="java.lang.String" itemvalue="Application.Test" />
</list>
<recent_temporary>
<list size="1">
<list size="2">
<item index="0" class="java.lang.String" itemvalue="Application.Main" />
<item index="1" class="java.lang.String" itemvalue="Application.Test" />
</list>
</recent_temporary>
</component>
@ -490,6 +522,14 @@
<option name="presentableId" value="Default" />
<updated>1467700295902</updated>
</task>
<task id="LOCAL-00001" summary="Update workspace">
<created>1473923710842</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1473923710842</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="ToolWindowManager">
@ -498,22 +538,22 @@
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980973" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2653277" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.81606764" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3668076" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.09375" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17864583" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39934355" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39852008" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@ -534,6 +574,10 @@
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Update workspace" />
<option name="LAST_COMMIT_MESSAGE" value="Update workspace" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="3" />
@ -545,70 +589,6 @@
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Object.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2822">
<caret line="192" column="41" selection-start-line="192" selection-start-column="41" selection-end-line="192" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
<element signature="method#getSpeed#0;class#Object#0" expanded="false" />
<element signature="method#getPosition#0;class#Object#0" expanded="false" />
<element signature="method#setAcceleration#1;class#Object#0" expanded="false" />
<element signature="method#getAcceleration#0;class#Object#0" expanded="false" />
<element signature="method#setOldAcceleration#1;class#Object#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="748">
<caret line="34" column="11" selection-start-line="34" selection-start-column="11" selection-end-line="34" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Simulator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/SimulatorConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="88">
<caret line="4" column="33" selection-start-line="4" selection-start-column="33" selection-end-line="4" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Object.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3652">
<caret line="192" column="41" selection-start-line="192" selection-start-column="41" selection-end-line="192" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
<element signature="method#getSpeed#0;class#Object#0" expanded="false" />
<element signature="method#getPosition#0;class#Object#0" expanded="false" />
<element signature="method#setAcceleration#1;class#Object#0" expanded="false" />
<element signature="method#getAcceleration#0;class#Object#0" expanded="false" />
<element signature="method#setOldAcceleration#1;class#Object#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Simulator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2156">
@ -623,7 +603,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="770">
<caret line="35" column="54" selection-start-line="35" selection-start-column="54" selection-end-line="35" selection-end-column="54" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -672,7 +654,7 @@
<state relative-caret-position="2442">
<caret line="116" column="5" selection-start-line="116" selection-start-column="5" selection-end-line="116" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
<element signature="imports" expanded="false" />
</folding>
</state>
</provider>
@ -681,7 +663,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -699,7 +683,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="836">
<caret line="38" column="23" selection-start-line="38" selection-start-column="23" selection-end-line="38" selection-end-column="23" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -733,7 +719,7 @@
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="imports" expanded="false" />
</folding>
</state>
</provider>
@ -742,7 +728,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -776,7 +764,7 @@
<state relative-caret-position="88">
<caret line="5" column="45" selection-start-line="5" selection-start-column="45" selection-end-line="5" selection-end-column="45" />
<folding>
<element signature="imports" expanded="true" />
<element signature="imports" expanded="false" />
</folding>
</state>
</provider>
@ -785,7 +773,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -819,7 +809,7 @@
<state relative-caret-position="88">
<caret line="5" column="45" selection-start-line="5" selection-start-column="45" selection-end-line="5" selection-end-column="45" />
<folding>
<element signature="imports" expanded="true" />
<element signature="imports" expanded="false" />
</folding>
</state>
</provider>
@ -828,7 +818,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="323">
<caret line="19" column="0" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="0" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -862,7 +854,7 @@
<state relative-caret-position="1173">
<caret line="74" column="46" selection-start-line="74" selection-start-column="46" selection-end-line="74" selection-end-column="46" />
<folding>
<element signature="imports" expanded="true" />
<element signature="imports" expanded="false" />
</folding>
</state>
</provider>
@ -871,7 +863,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
<caret line="12" column="33" selection-start-line="12" selection-start-column="33" selection-end-line="12" selection-end-column="33" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -895,7 +889,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -915,16 +911,6 @@
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/nBable.java" />
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/mathUtils/Vector3dMatrix.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2442">
<caret line="116" column="5" selection-start-line="116" selection-start-column="5" selection-end-line="116" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/nBabel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="88">
@ -932,26 +918,81 @@
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_91/src.zip!/java/lang/Object.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="697">
<caret line="234" column="18" selection-start-line="234" selection-start-column="18" selection-end-line="234" selection-end-column="18" />
<folding>
<element signature="e#10065#10066#0" expanded="false" />
<element signature="e#10148#10149#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Test.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="153">
<caret line="9" column="47" selection-start-line="9" selection-start-column="47" selection-end-line="9" selection-end-column="47" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/mathUtils/Vector3dMatrix.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="681">
<caret line="116" column="5" selection-start-line="116" selection-start-column="5" selection-end-line="116" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_91/src.zip!/java/lang/Exception.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="238">
<caret line="44" column="13" selection-start-line="44" selection-start-column="13" selection-end-line="44" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/mathUtils/AU.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="21" column="26" selection-start-line="21" selection-start-column="26" selection-end-line="21" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/SimulatorConfig.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="4" column="33" selection-start-line="4" selection-start-column="33" selection-end-line="4" selection-end-column="33" />
<state relative-caret-position="102">
<caret line="6" column="0" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="578">
<caret line="34" column="11" selection-start-line="34" selection-start-column="11" selection-end-line="34" selection-end-column="11" />
<folding />
<state relative-caret-position="-65">
<caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/dataWriter/DataWriter.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="612">
<caret line="36" column="73" selection-start-line="36" selection-start-column="73" selection-end-line="36" selection-end-column="73" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Object.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2822">
<caret line="192" column="41" selection-start-line="192" selection-start-column="41" selection-end-line="192" selection-end-column="41" />
<state relative-caret-position="357">
<caret line="42" column="16" selection-start-line="42" selection-start-column="16" selection-end-line="42" selection-end-column="16" />
<folding>
<element signature="imports" expanded="true" />
<element signature="method#getSpeed#0;class#Object#0" expanded="false" />
@ -965,14 +1006,22 @@
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/Simulator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="578">
<caret line="34" column="40" selection-start-line="34" selection-start-column="40" selection-end-line="34" selection-end-column="40" />
<state relative-caret-position="-496">
<caret line="72" column="159" selection-start-line="72" selection-start-column="159" selection-end-line="72" selection-end-column="159" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/verictas/pos/simulator/dataWriter/WritingException.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102">
<caret line="6" column="62" selection-start-line="6" selection-start-column="62" selection-end-line="6" selection-end-column="62" />
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

View File

@ -1,5 +1,7 @@
package com.verictas.pos.simulator;
import com.verictas.pos.simulator.mathUtils.AU;
import javax.vecmath.*;
public class Main {
@ -19,16 +21,19 @@ public class Main {
public static void main(String[] args) {
/**
* Object definitions
* Object definitions (in 1990)
*/
Object object1 = new Object(1/6.67384E-11, new Vector3d(1,0,0), new Vector3d(0,0,0));
Object object2 = new Object(1, new Vector3d(0,0,0), new Vector3d(0,0,0));
Object sun = new Object("Sun", 1.988544E30, AU.convertToMeter(new Vector3d(3.621484938699030E-03,3.203347049968909E-03,-1.609087138389905E-04)), AU.convertToMetersPerSecond(new Vector3d(-1.730306264794065E-06,6.909301960615850E-06,3.332250766613383E-08)));
Object venus = new Object("Venus", 48.685E23, AU.convertToMeter(new Vector3d(-3.786926829662159E-01,-6.122709221027441E-01,1.346180701578967E-02)), AU.convertToMetersPerSecond(new Vector3d(1.703979708314098E-02,-1.075790617185284E-02,-1.130972411646143E-03)));
Object earth = new Object("Earth", 5.97219E24, AU.convertToMeter(new Vector3d(1.000272608326749E+00,-1.305632418724720E-01,-1.614384880329670E-04)), AU.convertToMetersPerSecond(new Vector3d(2.003180730888720E-03,1.698793770993201E-02,5.869001824818362E-08)));
Object mars = new Object("Mars", 6.4185E23, AU.convertToMeter(new Vector3d(8.638055532014732E-01,-1.094520306989018E+00,-4.427515002554464E-02)), AU.convertToMetersPerSecond(new Vector3d(1.154235320339802E-02,9.839355267552327E-03,-7.723750026136471E-05)));
Object jupiter = new Object("Jupiter", 1898.13E24, AU.convertToMeter(new Vector3d(-5.440309619306835E+00,-2.383659935837559E-01,1.226571001615609E-01)), AU.convertToMetersPerSecond(new Vector3d(2.422143907277735E-04,-7.182284468246539E-03,2.440789748210396E-05)));
/**
* Object listing
*/
Object[] objects = {object1, object2};
Object[] objects = {sun, venus, earth, mars, jupiter};
/**
* Run the simulator for the specified objects

View File

@ -10,6 +10,8 @@ public class Object {
public Vector3d acceleration;
public Vector3d oldAcceleration;
public String name;
private double gravitationalConstant = 6.67384E-11;
/**
@ -18,10 +20,16 @@ public class Object {
* @param position The position vector of the object
* @param speed The speed vector of the object
*/
public Object(double mass, Vector3d position, Vector3d speed) {
public Object(String name, double mass, Vector3d position, Vector3d speed) {
this.name = name;
this.mass = mass;
this.position = position;
this.speed = speed;
System.out.println(speed);
this.oldAcceleration = new Vector3d(0,0,0);
this.acceleration = new Vector3d(0,0,0);
}
/**

View File

@ -1,5 +1,9 @@
package com.verictas.pos.simulator;
import javax.vecmath.*;
import com.verictas.pos.simulator.dataWriter.DataWriter;
import com.verictas.pos.simulator.dataWriter.WritingException;
import com.verictas.pos.simulator.mathUtils.AU;
import com.verictas.pos.simulator.mathUtils.Vector3dMatrix;
public class Simulator {
@ -16,49 +20,73 @@ public class Simulator {
*/
System.out.println("========== Simulation Started ==========\n");
// Create a timer
long startTime = System.currentTimeMillis();
/**
* Define the forces matrix for this round
* Define the forces matrix and the DataWriter
*/
Vector3dMatrix matrix = new Vector3dMatrix(objects.length,objects.length);
accelerate(objects, matrix);
try {
DataWriter writer = new DataWriter();
/**
* Start the rounds loop
*/
for(int t = 0; t != rounds; t++) {
/**
* The round has started
* Write begin values
*/
System.out.println("\nRound " + (t + 1) + " started!");
/**
* Define the initial values
*/
double time = SimulatorConfig.time;
for(int i = 0; i < objects.length; i++) {
System.out.println("Object " + (i+1) + " was at " + objects[i].position);
objects[i].updatePosition(time);
objects[i].updateAcceleration();
System.out.println("Object " + (i+1) + " is at " + objects[i].position);
writer.write(objects[i].name, objects[i].position, objects[i].speed, objects[i].oldAcceleration, objects[i].acceleration, objects[i].mass);
}
/**
* Start the leap frog integration!
*/
accelerate(objects, matrix);
/**
* Print the matrix for this round
* Start the rounds loop
*/
for(int t = 0; t != rounds; t++) {
/**
* The round has started
*/
System.out.println("\nRound " + (t + 1) + " started!");
/**
* Define the initial values
*/
double time = SimulatorConfig.time;
for(int i = 0; i < objects.length; i++) {
objects[i].updatePosition(time);
objects[i].updateAcceleration();
}
accelerate(objects, matrix);
/**
* Print the matrix for this round
*/
for(int i = 0; i < objects.length; i++) {
writer.write(objects[i].name, objects[i].position, objects[i].speed, objects[i].oldAcceleration, objects[i].acceleration, objects[i].mass);
}
for(int i = 0; i < objects.length; i++) {
objects[i].updateSpeed(time);
}
}
/**
* Log that the simulation has finished and save info to file
*/
writer.save();
System.out.println("========== Simulation Finished ==========");
/**
* Log that the simulation has finished
*/
System.out.println("========== Simulation Finished ==========");
// Display time info
long stopTime = System.currentTimeMillis();
System.out.println("Simulation took: " + (stopTime - startTime) + "ms");
} catch(WritingException e) {
e.printStackTrace();
}
}
public static void accelerate(Object[] objects, Vector3dMatrix matrix) {

View File

@ -1,6 +1,6 @@
package com.verictas.pos.simulator;
public class SimulatorConfig {
public static int rounds = 2;
public static double time = 1;
public static int rounds = 60 * 60 * 24 * 10;
public static double time = 0.1; // in seconds
}

View File

@ -0,0 +1,82 @@
package com.verictas.pos.simulator.dataWriter;
import com.verictas.pos.simulator.mathUtils.AU;
import javax.vecmath.Vector3d;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DataWriter {
private FileWriter writer = null;
// Delimiter used in text file (for import in Excel)
private static final String DELIMITER = "\t";
private static final String NEW_LINE = "\n";
public DataWriter() throws WritingException {
try {
// Define the save path
String directory = System.getProperty("user.home") + File.separator + "simulatorExports";
File directoryPath = new File(directory);
String path = directory + File.separator + getCurrentTimeStamp() + ".txt";
System.out.println("WRITING DATA TO: " + path);
if (!directoryPath.exists()) {
directoryPath.mkdirs();
}
this.writer = new FileWriter(path);
this.writer.write("Object" + DELIMITER + "Position (m)" + DELIMITER + "Position (AU)" + DELIMITER + "Speed (m)" + DELIMITER + "Speed (AU)" + DELIMITER + "Old Acceleration" + DELIMITER + "Acceleration" + DELIMITER + "Mass" + NEW_LINE);
} catch(IOException e) {
throw new WritingException("Whoop! Creation error!");
} catch(Exception e) {
throw new WritingException("Whoop! Unknown creation error!");
}
}
public void write(String string) throws WritingException {
if (this.writer == null) {
throw new WritingException("The writer isn't defined yet");
} else {
try {
this.writer.append(string);
} catch (Exception e) {
throw new WritingException("Whoop! Write error!");
}
}
}
public void write(String id, Vector3d position, Vector3d speed, Vector3d oldAcceleration, Vector3d acceleration, double mass) throws WritingException {
if (this.writer == null) {
throw new WritingException("The writer isn't defined yet");
} else {
try {
this.writer.append(id + DELIMITER + position.toString() + DELIMITER + AU.convertFromMeter(position).toString() + DELIMITER + speed.toString() + DELIMITER + AU.convertFromMetersPerSecond(speed).toString() + DELIMITER + oldAcceleration.toString() + DELIMITER + acceleration.toString() + DELIMITER + String.valueOf(mass) + NEW_LINE);
} catch (Exception e) {
e.printStackTrace();
throw new WritingException("Whoop! Write error!");
}
}
}
public void save() throws WritingException {
if (this.writer == null) {
throw new WritingException("The writer isn't defined yet");
} else {
try {
this.writer.flush();
this.writer.close();
} catch (IOException e) {
throw new WritingException("Whoop! Save error!");
}
}
}
public String getCurrentTimeStamp() {
return new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(new Date());
}
}

View File

@ -0,0 +1,8 @@
package com.verictas.pos.simulator.dataWriter;
public class WritingException extends Exception {
public WritingException() { super(); }
public WritingException(String message) { super(message); }
public WritingException(String message, Throwable cause) { super(message, cause); }
public WritingException(Throwable cause) { super(cause); }
}

View File

@ -0,0 +1,45 @@
package com.verictas.pos.simulator.mathUtils;
import javax.vecmath.Vector3d;
public class AU {
/**
* Helper class for working with astronomical units
*/
public static Vector3d convertToMeter(Vector3d input) {
Vector3d output = new Vector3d(input);
// Convert AU to m by NASA
output.scale(149597870.700); // Number to large when multiplied with 1000
output.scale(1000);
return output;
}
public static Vector3d convertToMetersPerSecond(Vector3d input) {
Vector3d output = new Vector3d(input);
// 1 AU/day to M/s
output.scale(1731456.84);
return output;
}
public static Vector3d convertFromMeter(Vector3d input) {
Vector3d output = new Vector3d(input);
// Convert m to AU by NASA
output.scale(6.6845871E-12);
return output;
}
public static Vector3d convertFromMetersPerSecond(Vector3d input) {
Vector3d output = new Vector3d(input);
// Convert seconds to days by NASA
output.scale(5.77548327E-7);
return output;
}
}

View File

@ -1,4 +0,0 @@
package com.verictas.pos.simulator;
public class nBabel {
}