Skip to content

Conversation

@amaarquadri
Copy link
Contributor

closes #18
Samples a grid of points for each solar panel to estimated the occluded area

@amaarquadri amaarquadri linked an issue Oct 3, 2024 that may be closed by this pull request
@amaarquadri amaarquadri changed the base branch from main to dev October 3, 2024 23:56
@amaarquadri amaarquadri force-pushed the amaar/solar branch 2 times, most recently from 89ceded to 3b45aba Compare October 8, 2024 19:11
Copy link
Collaborator

@kmkar31 kmkar31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall comments:

  • Verified code runs
  • Some documentation related comments

Script location : Can we have this in another folder called auxillaries, utils etc. We can keep all python scripts that don't go on the flight computer there. That way, we can use the default sim to access the orbit propagation and call on solar generation at a certain frequency (this is when we want to calculate solar power. By default, it will be turned off to same time)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to include these plots in the branch?

TODO: validate that occlusions from the Moon are negligible, since they are not accounted for in this model.
"""
SOLAR_FLUX = 1373 # The solar power flux at the Earth's orbital radius in W/m^2.
PANEL_EFFICIENCY = 0.15 # The efficiency of the solar panels, as a fraction in [0, 1].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to have this as an input parameter to disperse when doing MC analyses

Returns a list of Surface objects representing the solar panels on the satellite.

:param deployables_dir: A 3-element numpy array representing the direction of the deployable solar panels.
Must be a unit vector with exactly one non-zero element.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be a unit vector with exactly one non-zero element : is this because we only support panels aligned with the XY, YZ or ZX planes in the body frame? However this seems to contract the body tilt angle in the next line

| | --> deployables_offset_dir
|_______|
deployables_tilt_dir is into the page
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we want to parameterize the direction and tilt angle separately. Won't one vector aligned in some random direction do? Or does mech specifically want us to give them this format?

# The rays are parallel to the surface.
return np.zeros(ray_starts.shape[0], dtype=bool)

ts = (surface.center - ray_starts) @ surface.normal / cos_theta
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a help file for this portion. Took me a long time to get what this was doing. Image with the surface, a vector starting from ray_start parallel to ray_dir and finding out where the expected intersection is would help a lot.

from brahe.constants import R_EARTH, GM_EARTH
from brahe.epoch import Epoch

from world.math.time import increment_epoch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need an sys.addpath statement here to run this code.

from world.physics.models.gravity import Gravity
from world.physics.models.solar_generation import SolarGeneration


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config file uses a date starting May 2024. To use this date, we need brahe to update its Earth rotation database before running. Since time is not of too much concern, consider adding a brahe.utils.download_iers_bulletin_ab(outdir=brahe.constants.DATA_PATH)

plt.xlabel("Time [s]")
plt.ylabel("Power [W]")
plt.title(f"Generated Power vs. Time\nfor LTDN=10pm and Default Solar Panel Configuration")
plt.show()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use plt.show(block=False) to not block execution as the graph plots

plt.xlabel("Local Time of Descending Node [deg]")
plt.ylabel("Mean Power [W]")
plt.title("Mean Generated Power vs. LTDN\nfor Default Solar Panel Configuration")
plt.show()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use plt.show(block=False) to not block execution as the graph plots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solar Power Generation Model

2 participants