-
Notifications
You must be signed in to change notification settings - Fork 1
Create solar energy generation model #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…ormalize sun_dir vector
89ceded to
3b45aba
Compare
…file to allow parameter sweeps
3b45aba to
c93fd77
Compare
…ployables_dir values
There was a problem hiding this 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)
There was a problem hiding this comment.
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]. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 | ||
| """ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 | ||
|
|
||
|
|
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
closes #18
Samples a grid of points for each solar panel to estimated the occluded area