-
Notifications
You must be signed in to change notification settings - Fork 21
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
Create a documentation page(s) that show parameter values and figures for all bicycles and riders #112
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I made this script for the balance assist bike and it would be nice to output similar info for all the other bikes: import pprint
import numpy as np
import matplotlib.pyplot as plt
import bicycleparameters as bp
from bicycleparameters.parameter_sets import Meijaard2007ParameterSet
from bicycleparameters.models import Meijaard2007Model
data_dir = "/home/moorepants/Data/bicycle-parameters"
v = np.linspace(0.0, 10.0, num=401)
bicycle = bp.Bicycle("Balanceassistv1", pathToData=data_dir,
forcePeriodCalc=True, forceRawCalc=True)
bicycle.save_parameters()
print(bicycle)
print('Bicycle short name:', bicycle.bicycleName)
print('Directory:', bicycle.directory)
pprint.pprint(bicycle.extras)
M, C1, K0, K2 = bicycle.canonical()
print('M:', M)
print('C1:', C1)
print('K0:', K0)
print('k2:', K2)
A, B = bicycle.state_space(3.2)
print('A:', A)
print('B:', B)
print(*bicycle.eig([1.0, 2.0]))
bicycle.plot_bicycle_geometry(show=False)
bicycle.plot_eigenvalues_vs_speed(v)
par = bp.io.remove_uncertainties(bicycle.parameters['Benchmark'])
par['v'] = 1.0
pprint.pprint(par)
par_set = Meijaard2007ParameterSet(par, False)
par_set.plot_all()
model = Meijaard2007Model(par_set)
model.plot_eigenvalue_parts(v=v)
bicycle.add_rider('Jason', reCalc=True)
bicycle.save_parameters()
print(bicycle)
bicycle.plot_bicycle_geometry(show=False)
par = bp.io.remove_uncertainties(bicycle.parameters['Benchmark'])
par['v'] = 1.0
pprint.pprint(par)
par_set = Meijaard2007ParameterSet(par, True)
par_set.plot_all()
model = Meijaard2007Model(par_set)
model.plot_eigenvalue_parts(v=v)
plt.show() |
This is good enough to be merged. The old examples can be made into new gallery examples in future PRs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The idea would be to display all the parameter output values for bicycle and bicycles+riders and show the standard geometry and eigenvalue plots. This would then be an easy place to get info and numerical values for downstream use (without having to run the software).
sphinx-gallery might be a better choice than the matplotlib directive, as the latter can't display text output of a cell and we could make one file/page per bicycle.