Due: Mon, 2022/5/31 23:59

Slide: https://docs.google.com/presentation/d/1YrModN2q3REyAPNeJinDfzcetjSHN0HB2z-b5akrEns/edit?usp=sharing

Change log

2022/5/28: Update missile cost error tolarance.

2022/5/26: Update the formula of the missile cost.

2022/5/18: We update the formula of the missile cost and fix a bug in the judger.

2022/6/9: Update problem description.

Introduction

Problem Description

Please refer to the homework slides for problem description. You should implement the parallel code with brute force algorithm. No need to implement Barnes-Hut Algorithm.

Formulas & Parameters

Gravity Simulation

  1. Calculating the force vector on body i cuased by body j:

Untitled

  1. Calculating total force vector on body i caused by other N−1 bodies:

Untitled

  1. To avoid the gravitational force growing indefinitely in situation when two bodies com too close, we add a softening factor ε:

Untitled