Skip to content
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

incorporate plots again (sim.py) #57

Open
kostubhagarwal opened this issue Jan 11, 2025 · 1 comment
Open

incorporate plots again (sim.py) #57

kostubhagarwal opened this issue Jan 11, 2025 · 1 comment
Assignees

Comments

@kostubhagarwal
Copy link
Contributor

i removed plots for succintness and ability to run scipy optimizer. this was not a necessary step. find a way to re-incorporate plotting functionality into repo.

@kostubhagarwal kostubhagarwal converted this from a draft issue Jan 11, 2025
raiyanjaz pushed a commit to raiyanjaz/strategy_msxvi that referenced this issue Jan 18, 2025
@ericli3690
Copy link
Collaborator

Hey Raiyan! Just a few notes on things I've found in simulation.py, and which I've also talked about with Kostubh. I probably won't write these changes myself since both you and Kostubh are working on the file, and I don't wanna make the git merging too complicated.

  1. Forest gave us some new constants in the Discord that we should probably incorporate, namely:
M = 540.0 # Mass of vehicle (kg)
C_D = 0.18  # Drag coefficient
N = 0.243 * 0.92 * 0.94  # Efficiency of solar panel (%), calculated as
#       efficiency of solar panel from data sheet
#       * solar to battery charging efficiency
#       * battery to wheel powertrain efficiency
C_R = 0.0023 # Coefficient of Rolling Resistance. Does not include friction from other parts and is slightly suspect. Retrieved from the data sheet.

Regarding drag: I noticed there's another open issue in this repo with a team member saying they'll work on making the drag function more accurate? Do we know if that's been completed? I'm also noticing that battery capacity (40Ah/cell * 3.63V/cell * 36cells) is not being actually used to cap the battery power in the current version of the repo, but I think I saw that Kostubh has a fixed version of that on his own machine, so we're probably good there. As for rolling resistance, Forest only gave us a single coefficient, so we might have to ask him how exactly he got that value. The formula we're using right now is from Pudney's paper ("Optimal energy management for solar-powered cars") and requires two rolling resistance coefficients, so we might have to double-check if those two (C_R1 = 0.004, C_R2 = 0.052) are good enough for our car or if we should try and use Forest's value somehow instead. We might also want to question where exactly Pudney is getting his equation, as I can't seem to find it anywhere else online. This website (https://www.engineeringtoolbox.com/rolling-friction-resistance-d_1303.html) seems to suggest we can calculate the coefficient of rolling resistance from speed and tire pressure. Tire pressure according to Forrest is 500kPa by the data sheet.

  1. map_distance_to_id(...) and sim(...) currently take stage_name / stage_symbol as a parameter. I don't think they need to? They don't seem to use it. Which is good -- they probably shouldn't, as we might be running sim(...) starting at a point halfway through a stage rather than just for a single stage.

  2. Why does sim(...) currently return the negative of the final battery energy value?

  3. We should probably eventually have sim(...) take the current battery energy as a parameter, as we'll be running the simulator starting at points along the race track as well as at the beginning, and therefore we won't always have full battery capacity at t=0. We can get the amount of energy in the battery at any time fairly easily according to Kostubh.

  4. Does the simulator behave well if we ask it to simulate starting from like 10km, 50km-ish left to the finish line? Does it think the car keeps driving beyond the finish line until it reaches the time it has been instructed to simulate to? We should probably have it stop when it gets to the end of the route_model data.

That's everything I've thought of by tinkering with simulation.py while figuring out irradiance.py. Hopefully you can implement them, but if not I can write some changes in once you're done with your commit! Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

3 participants