# Instance and Data Generation for the Offline Nanosatellite Task Scheduling Problem
## 3 Instance Generation
### General Procedure for Power Calculation  
The basic process to determine the power input for the instances is presented in Algorithm 1. The inputs for sun irradiance (\(G\)), solar cell efficiency (\(\eta\)), and solar cell area (\(A\)), as well as a timestep, must first be entered into the code. The algorithm specifies a few conversion variables in the sequence that will be used later in the code. Algorithm 1 then calls Algorithm 2 (\"inputOrbit\"), which is used to convert Orbital Inputs (OI) provided in units of angle and to derive preliminary orbital parameters that will later be used. A Newton-Raphson-based subfunction called \"kepler_E\" (Algorithm 3) is included in this algorithm to compute the eccentric anomaly (\(E\)). It is important to note that the parameter \(\epsilon\), which serves as a stopping point for convergence in Algorithm 3, is a small positive integer. Algorithm 4 (solar_position) is executed following Algorithm 2 to determine the sun's position (\(\mathbf{r}_{\text{sun}}\)) for a particular day [16]. When Algorithms 2 and 4 are complete, the loop in Algorithm 1 starts, and each iteration updates the time, the satellite's position (\(\mathbf{r}_{X}\)), the eclipse status (\(\xi\)), the attitude (\(\mathbf{N}_{X}\)), the view factor (\(F\)), and the power generation (\(P\)) for each side of the CubeSat. When a full orbit's period is reached, the loop comes to an end. Five different results for power generation are illustrated in Figure 2. Except for the attitude, they have the following common parameters: \(\Omega=0^{\circ}\), \(\omega=0^{\circ}\), \(i=90^{\circ}\), \(\epsilon=0\), \(M=0^{\circ}\), and \(M_{m}=15.2198\) rev/day (equivalent to the altitude of 500 km), valid for 21 March 2023. ```
Input :Solar irradiance G, solar cell efficiency \(\eta\), solar cell area \(A\), time step Output :Equation (1) /* Initialization */
1 i \(\leftarrow\) 0;
2 f0 \(\leftarrow\) 0;
3 /* Conversion factors */
4 hours \(\leftarrow\) 3600;
5 days \(\leftarrow\) 24\(\times\) hours;
6 xd \(\leftarrow\) \(\frac{\eta}{\text{RD}}\); /* Constants */
7 \(\mu\leftarrow\) 398600;
8 \(R_{\text{E}}\leftarrow\) 6378;
9 /* Read Orbit Input (OI) and further arguments */
10 [h, e, \(\Omega\), inc, \(\omega\), \(\theta_{0}\), year, month, day, Period] \(\leftarrow\) inputOrbit(\(\mu\),rad,OI); /* Compute the position of the sun on a given day */
11 \(\mathbf{r_{\text{sun}}}\leftarrow\) solar_position(year,month,day);
12 while\(t_{0}\leq Period\)do
13 \(i\gets i+1\);
14 time \(\leftarrow(i-1)\times\) timestep; /* transformation from time [s] to true anomaly [rad] */



### General Procedure for Scheduling Data

The main objective here is to generate an ONTS instance based on random but realistic data for any mission size and orbit duration. The instances can be made more difficult to schedule on demand by increasing the number of jobs or time units to consider. For that we created the instance generator procedure presented in Algorithm 5. It takes two inputs:

Figure 2: Examples of power generation for different attitudes. Finally, we attributed values to the battery and power management system parameters considering a 3U size nanosatellite, as presented in Table 5.

Figure 3 shows the optimal schedule calculated for this example and the power analysis. The battery behavior along the orbit is shown in black, representing the State-of-Charge (SoC) at each moment. Notice that the battery power in gray can be power going to or coming from the battery, depending on the energy balance. The power input available to the tasks is shown in blue, including the eclipse time (0 W). One can notice how the battery SoC drops in eclipse time, where there is also an increase in tasks running, consuming more power. Figure 3b shows tasks from 0 to 8 where the x-axis goes from 0 to time \(T\), and the y-



## 5 Conclusions

In conclusion, this work offers a collection of cases of the Offline Nanosatellite Task Scheduling (ONTS) optimization problem.