Advanced Question Simulated Solar Panels And Batteries

n72.75

Seize the means of computation
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,873
Reaction score
1,716
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
Would it be possable to create a space ship in orbiter that would "charge" "batteries" from solar pannels. What I mean is, I want to have simulated batteries, which only can be recharged when the ship is not in earth's shadow. The panels would recharge the batteries at some set regharge rate.
I cant think of a good way to do this. Anyone?
 
Well Dragonfly's got the power code, and I think Mustard's new solar modules have the sun-tracking code. I don't know how the sun-tracking code works, but maybe if it knows when teh sun goes behind the horizon it could work.
 
Well Dragonfly's got the power code, and I think Mustard's new solar modules have the sun-tracking code. I don't know how the sun-tracking code works, but maybe if it knows when the sun goes behind the horizon it could work.

It involves an algorithm which would use the exact time as well as all orbital information to determine sun location reletave to pannels.

Now that I say that, I think that I could use a similar algorithm to determine times when the spacecraft is in shadow.

Thank you for the inspiration.

-Matt
 
Well, Orbiter tracks when you are in shadow internally. Surely there must be a way to tap into that info.
 
It involves an algorithm which would use the exact time as well as all orbital information to determine sun location reletave to pannels.
Not even that complicated. Just do a Global2Local of <0,0,0> (since in the Orbiter global coordinate system the sun is by definition at <0,0,0>)--that will give you the location of the sun in local vessel coordinates. Then, use trig to determine the angles you need for the solar panels.

Now that I say that, I think that I could use a similar algorithm to determine times when the spacecraft is in shadow.
You could use a similar method to determine "in shadow"--you could check to see if the vector between your vessel and the sun comes within r of a celestial body, where r is that celestial body's radius. You could confine the search to your vessel's reference body, its parent body (if it's a moon), and all its moons.
 
You could use a similar method to determine "in shadow"--you could check to see if the vector between your vessel and the sun comes within r of a celestial body, where r is that celestial body's radius. You could confine the search to your vessel's reference body, its parent body (if it's a moon), and all its moons.

You would also need to take in account the size of the moon and the size of the sun, as the sun is no point source of light.

But still the effort is not too high. You can reduce the number of checks by only using those planets/moons, which are close enough to have an effect of more than 5%...
 
You would also need to take in account the size of the moon and the size of the sun, as the sun is no point source of light.

But still the effort is not too high. You can reduce the number of checks by only using those planets/moons, which are close enough to have an effect of more than 5%...

Yep, all the other planets and moons would be too small to worry about.
Thanks for the help guys, for some reason I can never figure out things the easy way. I guess that's why we have the forum.
 
Yep, all the other planets and moons would be too small to worry about.
Thanks for the help guys, for some reason I can never figure out things the easy way. I guess that's why we have the forum.

If you want to make it complex, calculate the angle of incidence of the sun light on the solar array, as well as solar array temperature as both has big impacts on the electrical power production...:rofl:
 
See my post here for a "sunset" type function I wrote a while ago. Note that it does not allow for the size of the sun, ie, "sunset" occurs when the centre of the sun passes below the horizon.

As far as sun tracking goes, that is not too hard - just make friends with vectors ;)
 
Back
Top