Package: fastsim
FASTSimDescriptionThis is the python/rust flavor ofNREL's FASTSimTM, which is based on the original Excel implementation. Effort will be made to keep the core methodology between this software and the Excel flavor in line with one another.All classes and methods are self-documented.InstallationPythonSet up and activate a python environment (compatible with Python 3.8 - 3.10; we recommend Python 3.10) with the following steps.AnacondaCreate:conda create -n fastsim python=3.10Activate:conda activate fastsimvenvThere is some variation based on your Operating System:PowerShell (windows):Create:python -m venv fastsim-venv-- name is user decisionActivate:fastsim-venv/Scripts/Activate.ps1Bash (i.e. unix/linux/mac):Create:python -m venv fastsim-venv-- name is user decisionActivate:source fastsim-venv/bin/activateCommand Prompt (windows):Create:python -m venv fastsim-venv-- name is user decisionActivate:fastsim-venv/Scripts/activate.batFASTSimVia PyPIIn an active Python environment created above, runpip install fastsim.Building from ScratchDevelopers might want to install the code in place so that FASTSim files can be editable (the-eflag for pip provides this behavior). This option can be handy since FASTSim will be installed in place from the installation location and any updates will be propagated each time FASTSim is freshly imported.  To do this, you'll need to have theRust toolchaininstalled.Option 1: runsh build_and_test.shin root folder.Option 2:Runpip install -e ".[dev]"Optional testing steps:Runcd rust/ && cargo testRunpytest -v python/fastsim/tests/UsageTo see and run examples, navigate to./python/fastsim/demosand run the various *demo.py files to see fastsim use cases. There are other examples in fastsim/tests.Adding FASTSim as a Dependency in RustVia GitHubAdd this line:fastsim-core = { git = "https://github.com/NREL/fastsim/", branch = "fastsim-2" }to your Cargo.toml file, modifying thebranchkey as appropriate.Via CargoFASTSim isavailable as a Rust crate, which can be added to your dependencies via the following command:cargo add fastsim-coreList of Abbreviationscur = current time stepprev = previous time stepcyc = drive cyclesecs = secondsmps = meters per secondmph = miles per hourkw = kilowatts, unit of powerkwh = kilowatt-hour, unit of energykg = kilograms, unit of massmax = maximummin = minimumavg = averagefs = fuel storage (eg. gasoline/diesel tank, pressurized hydrogen tank)fc = fuel converter (eg. internal combustion engine, fuel cell)mc = electric motor/generator and controlleress = energy storage system (eg. high voltage traction battery)chg = charging of a componentdis = discharging of a componentlim = limit of a componentregen = associated with regenerative brakingdes = desired valueach = achieved valuein = component inputout = component outputKnown IssuesRust versions of classes have limited Language Server Protocol integration, and we are actively working on fixing this.Release Notes2.1.2 -- SerdeAPI revamp with many new functions, various new vehicles, calibration demo, better error propagation, demo testing
2.1.1 -- license changed to Apache 2.0, default cycle grade and road type to zero if not provided, defaults to regenerative braking parameters, optional documentation fields now generated in Rust
2.1.0 -- release and installation improvements, RustVehicle init cleanup, calibration improvements
2.0.11 - 2.0.22 -- PyPI fixes.  Also, Rust version is now >100x faster than Python version.
2.0.10 -- logging fixes, proc macro reorganization, some CAVs performance fixes2.0.9 -- support for mac ARM/RISC architecture2.0.8 -- performance improvements2.0.6 --dist_v2_mfixes and preliminary CAV functionality2.0.5 -- addedto_rustmethod for cycle2.0.4 -- exposedveh.set_veh_mass2.0.3 -- exposedveh.__post_init__2.0.2 -- provisioned for non-default vehdb path2.0.1 -- bug fix2.0.0 -- All second-by-second calculations are now implemented in both rust and python.  Rust provides a ~30x speedup1.3.1 --fastsim.simdrive.copy_sim_drivefunction can deepcopy jit to non-jit (and back) for pickling1.2.6 -- time dilation bug fix for zero speed1.2.4 -- bug fix changing==to=1.2.3 --veh_filecan be passed as standalone argument.fcEffTypecan be anything iffcEffMapis provided, but typing is otherwise enforced.1.2.2 -- added checks for some conflicting vehicle parameters.  Vehicle parametersfcEffTypeandvehPtTypemust now be str type.1.2.1 -- improved time dilation and added test for it1.1.7 -- get_numba_veh() and get_numba_cyc() can now be called from already jitted objects1.1.6 -- another bug fix for numba compatibility with corresponding unit test1.1.5 -- bug fix for numba compatibility of fcPeakEffOverride and mcPeakEffOverride1.1.4 -- nan bug fix for fcPeakEffOverride and mcPeakEffOverride1.1.3 -- provisioned for optional load time motor and engine peak overrides1.1.2 -- made vehicle loadingmoremore robust1.1.1 -- made vehicle loading more robust1.1.0 -- separated jitclasses into own module, made vehicle engine and motor efficiency setting more robust1.0.4 -- bug fix with custom engine curve1.0.3 -- bug fixes, faster testing1.0.2 -- forced type np.float64 on vehicle mass attributes1.0.1 -- AddedvehYearattribute to vehicle and other minor changes.
1.0.0 -- Implemented unittest package.  Fixed energy audit calculations to be based on achieved speed.  Updated this file.  Improved documentation.  Vehicle can be instantiated as dict.
0.1.5 -- Updated to be compatible with ADOPT
0.1.4 -- Bug fix:mcEffMapis now robust to having zero as first element
0.1.3 -- Bug fix:fastsim.vehicle.Vehiclemethodset_init_calcsno longer overridesfcEffMap.
0.1.2 -- Fixes os-dependency of xlwings by not running stuff that needs xlwings.  Improvements in functional test.  Refinment utomated typying of jitclass objects.
0.1.1 -- Now includes label fuel economy and/or battery kW-hr/mi values that match excel and test for benchmarking against Excel values and CPU time.ContributorsChad Baker --Chad.Baker@nrel.govAaron Brooker --Aaron.Brooker@nrel.govKyle Carow --Kyle.Carow@nrel.govRobin Steuteville --Robin.Steuteville@nrel.govJeffrey Gonder --Jeff.Gonder@nrel.govJacob Holden --Jacob.Holden@nrel.govJinghu Hu --Jinghu.Hu@nrel.govJason Lustbader --Jason.Lustbader@nrel.govSean Lopp --sean@rstudio.comMatthew Moniot --Matthew.Moniot@nrel.govGrant Payne --Grant.Payne@nrel.govLaurie Ramroth --lramroth@ford.comEric Wood --Eric.Wood@nrel.gov