baff
Subpackages
Classes
baff.Airfoil
- class baff.Airfoil
Airfoil Represents an airfoil with geometry and aerodynamic properties.
- Constructor Summary
- Airfoil(name, normArea, normPerimeter, Cl_max, etas, ys)
AIRFOIL Construct an Airfoil object
- Property Summary
- Cl_max
Maximum lift coefficient
- Etas
Normalized chordwise locations
- NEta
- Name
Name of the airfoil
- NormArea
Normalized area
- NormPerimeter
Normalized perimeter
- Ys
Upper and lower surface thickness distribution
- Method Summary
- static FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- GetNormArea(cEtas)
GetNormArea returns the normalized area of the airfoil between two chordwise locations. :param cEtas: Chordwise locations to integrate between, default [0 1] :type cEtas: 1,2
- Hash()
A unique number used to sort / indentify unique Airfoils.
- static NACA(pCamber, pLocCamber)
NACA 4-digit airfoil generator pCamber: Camber percentage pLocCamber: Camber location percentage Example: NACA(2,4,12) -> NACA 241
- static NACA_sym()
- static SC2_0614()
- static TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- eq(obj1, obj2)
overloads the == operator to check the equality of two Airfoil objects.
baff.Beam
- class baff.Beam
Bases:
baff.ElementBaff class to represent a Beam Element This class is used to represent a beam element in the baff framework. It is based on the notion of beam stations defined in the Stations property. These stations describe the variation in properties of a 1D beam line through space. Each station describes the properties of the beam at a specific normilised point (Eta) along its length.
- Constructor Summary
- Beam(CompOpts, opts)
BEAM Construct an instance of the Beam Baff element class
- Property Summary
- Stations
Beam Station properties
- Method Summary
- static Bar(length, height, width, Material)
Bar creates a beam element with a rectangular cross section. :param length: Length of the beam element :param height: Height of teh vbeam cross section :param width: Width of the beam cross section :param Material: Material of the beam element
- Returns:
obj – Beam object with the specified properties
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- GetBeamLength()
GetBeamLength returns the length of the beam locus. This is the length of the beam locus. It can be differnt to EtaLength if: - stations Etas do not start and end at 0 and 1 - EtaDir at stations is not a unit vector ( useful for swept wings where you want EtaLength to set the span) :Returns: x – length of the beam locus
- GetElementCoM()
GetElementCoM returns the center of mass of the beam element (excluding children).
- GetElementMass()
GetElementMass returns the mass of the beam element (excluding children).
- GetPos(eta)
- GetPos returns the position of the beam at a given eta.
This function returns the position of the beam at a given eta, in the beam coordinate system.
- Returns:
X – position of the beam at the given eta, in the beam coordinate system
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- draw(opts)
Draw draw an element in 3D Space :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- eq(obj1, obj2)
overloads the == operator to check the equality of two Beam objects.
- getType()
getType returns the type of the object as a string.
baff.BluffBody
- class baff.BluffBody
Bases:
baff.ElementBaff class to represent a BluffBody Element This class is used to represent a bluff body element in the baff framework. It is based on the notion of body stations defined in the Stations property. These stations describe the variation in properties of a 1D body line through space. Each station describes the properties of the body at a specific normilised point (Eta) along its length.
- Constructor Summary
- BluffBody(opts)
BLUFFBODY Construct an instance of the BluffBody Baff element class
- Property Summary
- Stations
Body Station properties
- Method Summary
- static Cone(len, radius_start, radius_end, opts)
Cone creates a conical bluff body element with linearly varying radius. :param len: Length of the cone :param radius_start: Radius at the start of the cone :param radius_end: Radius at the end of the cone :param opts.Material: Material of the cone [default: baff.Material.Stiff] :param opts.NStations: Number of stations [default: 10]
- Returns:
obj – BluffBody object representing a cone
- static Cylinder(len, radius, opts)
Cylinder creates a cylindrical bluff body element with constant radius. :param len: Length of the cylinder :param radius: Radius of the cylinder :param opts.Material: Material of the cylinder [default: baff.Material.Stiff] :param opts.NStations: Number of stations [default: 10]
- Returns:
obj – BluffBody object representing a cylinder
- DistributeMass(mass, Nele, opts)
- DistributeMass distributes mass along a bluff body element as discrete lumped masses.
This function creates N lumped masses spread across the bluff body with the fraction at each point proportional to the normalized volume at each section. The masses are positioned at the centroid of each section.
- Parameters:
obj – BluffBody object to add masses to
mass – Total mass to distribute
Nele – Number of discrete mass elements to create
opts.Offset – Offset vector for mass positions [default: [0;0;0]]
opts.tag – Name tag for mass elements [default: ‘body_mass’]
opts.IncludeTips – Include tip positions in mass distribution [default: false]
opts.isFuel – Create fuel masses instead of regular masses [default: false]
opts.isPayload – Create payload masses instead of regular masses [default: false]
opts.Etas – Eta range for mass distribution [default: [nan nan] - uses full body]
- Returns:
obj – Modified BluffBody object with distributed masses added
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- static FromEta(len, eta, radius, opts)
FromEta creates a bluff body element from eta positions and radii. :param len: Length of the bluff body element :param eta: Eta positions along the body :param radius: Radius values at each eta position :param opts.Material: Material of the bluff body element [default: baff.Material.Stiff] :param opts.Density: Density for station spacing :param opts.NStations: Number of stations [default: 10]
- Returns:
obj – BluffBody object with the specified properties
- GetPos(eta)
- GetPos returns the position of the bluff body at a given eta.
This function returns the position of the bluff body at a given eta, in the body coordinate system.
- Returns:
X – position of the bluff body at the given eta, in the body coordinate system
- static Parabola(len, radius, opts)
Parabola creates a parabolic bluff body element. :param len: Length of the parabolic body :param radius: Maximum radius of the parabolic body :param opts.Material: Material of the parabolic body [default: baff.Material.Stiff] :param opts.NStations: Number of stations [default: 10] :param opts.Dir: Direction parameter for parabola [default: 0]
- Returns:
obj – BluffBody object representing a parabolic body
- static SemiSphere(len, radius, opts)
SemiSphere creates a semi-spherical bluff body element. :param len: Length of the semi-sphere :param radius: Maximum radius of the semi-sphere :param opts.Material: Material of the semi-sphere [default: baff.Material.Stiff] :param opts.NStations: Number of stations [default: 10] :param opts.Inverted: Whether the semi-sphere is inverted [default: false] :param opts.EtaFrustrum: Eta position for frustrum start [default: 0]
- Returns:
obj – BluffBody object representing a semi-sphere
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- Volume(etaLims)
Volume returns the volume of the bluff body element within specified eta limits. :param etaLims: eta limits for volume calculation [default: [0,1]]
- Returns:
Vol – volume of the bluff body element within the specified limits
- WettedArea()
WettedArea returns the wetted surface area of the bluff body element. :Returns: Area – wetted surface area of the bluff body element
- draw(opts)
Draw draw an element in 3D Space :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- eq(obj1, obj2)
overloads the == operator to check the equality of two BluffBody objects.
- getType()
getType returns the type of the object as a string.
- plus(obj1, obj2)
overloads the + operator to concatenate two BluffBody objects.
baff.Constraint
- class baff.Constraint
Bases:
baff.ElementConstraint class to respresent a constraint in the baff framework
- Constructor Summary
- Constraint(CompOpts, opts)
CONSTRAINT Construct an instance of the Constraint Baff element class
- Property Summary
- ComponentNums
constrained component numbers (123 XYZ, 456 rotation about XYZ).
- Method Summary
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- draw(opts)
Draw draw an element in 3D Space :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- eq(obj1, obj2)
overloads the == operator to check the equality of two Constraint objects.
- getType()
baff.ControlSurface
- class baff.ControlSurface
ControlSurface Represents a control surface on a wing.
- Constructor Summary
- ControlSurface(name, etas, pChords)
ControlSurface Construct an instance of the ControlSurface class :param name: Name of the control surface :type name: string :param etas: Eta values for the start and end of the control surface :type etas: 2,1 double :param pChords: Percentage of chord that is control surface at either end :type pChords: 2,1 double
- Property Summary
- Etas
start and end eta along the wing
- LinkedCoefficent
gain of the linked surface
- LinkedSurface
linked control surface (control surface the motion of this one is linked to)
- Name
Name
- pChord
Percentage of chord that is control surface at either end
- Method Summary
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
create placeholders
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- draw(Parent, opts)
Draw draw an element in 3D Space :param Parent: Parent wing object :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- eq(obj1, obj2)
overloads the == operator to check the equality of two ControlSurface objects.
- ne(obj1, obj2)
overloads the ~= operator to check the inequality of two ControlSurface objects.
baff.Element
- class baff.Element
Bases:
matlab.mixin.Heterogeneous,handleBase class which all Baff elements Inherit from defines common properties and methods for all Baff elements multple key constructs:
Parent/Children: the parent element defines the origin of the elements location in space Location: the offset defines the element offset in the parents coordinate system and A the rotaion matrix Eta: all elementshave a notion of normlised postion, so children can be located at a specific position along the element
- Constructor Summary
- Element(opts)
Constructor for Element
- Parameters:
opts.Offset (
double,Default=[0;0;0]) – Offset from Parentopts.eta (
double,Default=0) – eta coordinate of the element in Parent’s coordinate systemopts.Name (
string,Default='') – Name of the elementopts.A (
double,Default=eye(3)) – Rotation Matrix From Parentopts.EtaLength (
double,Default=1) – Length of the element in eta direction
- Property Summary
- A
Rotation Matrix
- Children
Children elements
- Eta
eta coordinate of the element in the parent element’s coordinate system
- EtaLength
Length of the element in the eta direction
- Index
Unique index for each element (for use in HDF5 files to link parents and children)
- Meta
Meta data for the element
- Name
Name of the element
- Offset
Offset of the element in the parent element’s coordinate system
- Parent
Parent element
- Type
Element Type String
- isAbsolute
if true, the element is referenced to the global coordinate system, otherwise it is referenced to the parent element
- Method Summary
- BaffToProp(filepath, loc)
- static FromBaff(filepath, loc)
- FromBaff Create an Element from a Baff HDF5 file
placeholder for subclasses to overload
- Parameters:
filepath (
string) – Path to the Baff HDF5 fileloc (
string) – Location in the HDF5 file
- Returns:
Element
- GetCoM()
- GetElementCoM()
Returns Centre of mass and associated mass
- Returns:
Xs (numeric array) – Location of CoM - default zeros.
masses (numeric array) – Mass of each object.
- GetElementMass()
Returns the mass of the object (Default 0)
- GetElementOEM()
Returns Operational Empty Mass, e.g. the mass if fuel and payload are have zero filling
- GetGlobalA()
Returns the global rotation matrix
- Returns:
A (double) – Global rotation matrix
- GetGlobalCoM()
Returns Centre of mass and associated mass
- Returns:
Xs (double) – Location of CoM - default zeros.
masses (double) – Mass of each object.
- GetGlobalPos(Eta, Offset)
Returns the global position of the object
- Parameters:
Eta (
double) – normalised position along elementOffset (
double) – Offset in element frame of reference (Default [0;0;0])
- GetMass(opts)
GetMass Get the mass of the element
- Parameters:
opts.IncludeChildren (
logical, optional, default=true) – Include elements children in mass estimation- Returns:
Mass of the element
- GetPos(eta)
Returns the position of the object at eta (Default: [0;0;0])
- LinkElements(filepath, loc, linker)
LinkElements Link the elements to their parents and children
- static TemplateHdf5(filepath, loc)
TemplateHdf5 Create a template HDF5 file
- Parameters:
filepath (
string) – Path to fileloc (
string) – Location in file
- ToBaff(filepath, loc)
Write the object to a Baff HDF5 file
- Parameters:
filepath (
string) – Path to fileloc (
string) – Location in file
- WettedArea()
Returns the wetted area of the object (Default 0)
- add(childObj)
Adds a child object
- Parameters:
childObj (
Element) – Child object
- draw(opts)
Draws the object
- Parameters:
opts.Origin (
double) – Origin of object in global frameopts.A (
3,3 double) – global Rotaion Matrixopts.Type (
string, Default="stick") – plot type {mustBeMember(opts.Type,[“stick”,”surf”,”mesh”])}
- Returns:
plt_obj – plot object
- eq(obj1, obj2)
overloads the == operator
- getType()
- ne(obj1, obj2)
overloads the ~= operator
baff.Fuel
- class baff.Fuel
Bases:
baff.MassFUEL Summary of this class goes here Detailed explanation goes here
- Constructor Summary
- Fuel(mass, opts)
FUEL Construct an instance of this class Detailed explanation goes here
- Property Summary
- Capacity
- FillingLevel
- Method Summary
- BaffToProp(filepath, loc)
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- GetElementCoM()
- GetElementMass()
- GetElementOEM()
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- draw(opts)
Draw draw an element in 3D Space :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- getType()
baff.Hinge
- class baff.Hinge
Bases:
baff.ElementHINGE Hinge element
- Constructor Summary
- Hinge(CompOpts, opts)
Hinge Construct an instance of the Hinge Baff element class :param CompOpts.eta: Eta value for the hinge :param CompOpts.Offset: Offset of the hinge element from its parent :param CompOpts.Name: Name of the hinge element :param opts.HingeVector: Orientation of the hinge in the local coordinate system :param opts.Rotation: Rotation of the hinge around the hinge vector :param opts.K: Stiffness of the hinge :param opts.C: Damping of the hinge :param opts.isLocked: Whether the hinge is locked or not
- Property Summary
- C
damping of the hinge
- HingeVector
orientation of the hinge in the local coordinate system
- K
stiffness of the hinge
- RefLength
drawing properties
- Rotation
rotation of the hinge around the hinge vector
- isLocked
whether the hinge is locked or not
- Method Summary
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- draw(opts)
Draw draw an element in 3D Space :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- eq(obj1, obj2)
overloads the == operator to check the equality of two Hinge objects.
- getType()
getType returns the type of the object as a string.
baff.Mass
- class baff.Mass
Bases:
baff.PointMASS Summary of this class goes here Detailed explanation goes here
- Constructor Summary
- Mass(mass, opts, CompOpts)
MASS Construct an instance of this class :param mass: Mass of the point mass :type mass: double :param opts.Ixx: Inertia tensor component Ixx :type opts.Ixx: double :param opts.Iyy: Inertia tensor component Iyy :type opts.Iyy: double :param opts.Izz: Inertia tensor component Izz :type opts.Izz: double :param opts.Ixy: Inertia tensor component Ixy :type opts.Ixy: double :param opts.Ixz: Inertia tensor component Ixz :type opts.Ixz: double :param opts.Iyz: Inertia tensor component Iyz :type opts.Iyz: double :param CompOpts.Eta: Eta value for the mass :type CompOpts.Eta: double :param CompOpts.Offset: Offset of the mass element from its parent :type CompOpts.Offset: 3,1 :param CompOpts.Name: Name of the mass element :type CompOpts.Name: string :param CompOpts.Force: Force applied to the mass :type CompOpts.Force: 3,1 :param CompOpts.Moment: Moment applied to the mass :type CompOpts.Moment: 3,1
- Property Summary
- InertiaTensor
{(3,3) double} inertia tensor of the point mass
- mass
mass of the point mass
- Method Summary
- BaffToProp(filepath, loc)
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- GetElementCoM()
GetElementCoM returns the center of mass and masses of the mass element (excluding children).
- GetElementMass()
GetElementMass returns the mass of the mass element (excluding children).
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- draw(opts)
Draw draw an element in 3D Space :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- eq(obj1, obj2)
overloads the == operator to check the equality of two Mass objects.
- getType()
getType returns the type of the object as a string.
baff.Material
- class baff.Material
MATERIAL Class to describe material properties
- Constructor Summary
- Material(E, nu, rho, Name, opts)
MATERIAL Construct an instance of this class :param E: Young’s modulus :type E: double :param nu: Poisson’s ratio :type nu: double :param rho: Density :type rho: double :param Name: Name of the material :type Name: string :param opts.G: Shear modulus, if not provided it is calculated from E and nu :type opts.G: double :param opts.yield: Yield stress, if not provided it is set to nan :type opts.yield: double :param opts.uts: Ultimate Tensile Strength, if not provided it is set to yield stress :type opts.uts: double
- Property Summary
- E
Young’s modulus
- G
Shear modulus, if not provided it is calculated from E and nu
- Name
Name of the material
- nu
Poisson’s ratio
- rho
Density
- uts
Ultimate Tensile Strength
- yield
Yield stress
- Method Summary
- static Aluminium()
Static mthod to create an Aluminium material E=71.7e9, nu=0.33, rho=2810
- static BlackMetal(factor)
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- Hash()
HASH returns a unique number used to sort / indentify unique Materials.
- static IsoCarbonFibre()
Quasi-Isotropic Carbon fibre
- static Stainless304()
Static method to create a Stainless Steel 304 material E=193e9, nu=0.29, rho=7930
- static Stainless316()
Static method to create a Stainless Steel 316 material E=193e9, nu=0.3, rho=8000
- static Stainless400()
Static method to create a Stainless Steel 400 material E=200e9, nu=0.282, rho=7720
- static Stiff()
Static method to create a Stiff material - this a a specif material, which analysis tools may use to define rigid elements E=inf, nu=0, rho=0
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
create place holders
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- static Unity()
Static method to create a Unity material E=1, nu=-0.5, rho=1
- ZeroDensity()
ZERODENSITY sets the density of the material to zero.
- eq(obj1, obj2)
overloads the == operator to check the equality of two Material objects.
- ne(obj1, obj2)
overloads the ~= operator to check the inequality of two Material objects.
baff.Model
- class baff.Model
Bases:
handleMODEL class to build Baff models This class is used to create and manage a Baff model, which consists of various elements such as beams, bluff bodies, constraints, etc. It provides methods to add elements, draw the model, and save/load the model to/from a file.
- Property Summary
- Beam
Beam elements
- BluffBody
Bluff body elements
- Constraint
Constraint elements
- Fuel
Fuel elements
- Hinge
Hinge elements
- Mass
Mass elements
- Name
Name of the model
- Orphans
Orphan elements
- Payload
Payload elements
- Point
Point elements
- Wing
Wing elements
- Method Summary
- AddElement(ele)
add an element to the model
- AssignChildren(filename)
AssignChildren assigns the children of the elements in the model This function is for reading HDF5 models. as after all elemetns are created it links parents to their children etc… :param filename: path to the HDF5 file
- static FromBaff(filename)
FromBaff load a Baff model from an HDF5 file :param filename: path to the HDF5 file
- static GenTempHdf5(filename)
GenTempHdf5 generate a template HDF5 file for the model :param filename: path to the HDF5 file
- GetCoM()
GetCoM get the center of mass of the model
- GetMass()
GetMass get the total mass of the model
- GetOEM()
GetOEM get the total operational empty mass of the model This is the mass of the model excluding fuel and payload.
- Rebuild()
rebuild the model by working through the Orphans and populating the array of elements This is useful when the model has been modified and needs to be updated.
- ToBaff(filename)
TOBAFF save the model to a Baff HDF5 file
- UpdateIdx()
- draw(fig_handle, opts)
Draw draw an element in 3D Space :param fig_handle: handle to the figure to draw in :param opts.Type: plot type, can be ‘stick’, ‘surf’, or ‘mesh’
- eq(obj1, obj2)
overloads the == operator to check the equality of two Model objects.
- ne(obj1, obj2)
overloads the ~= operator to check the inequality of two Model objects.
baff.Payload
- class baff.Payload
Bases:
baff.MassPayload class for payload elements in a Baff model
- Constructor Summary
- Payload(capacity, opts)
Payload Construct an instance of this class :param capacity: capacity of the payload object :type capacity: double :param opts.Ixx: Inertia tensor component Ixx :type opts.Ixx: double :param opts.Iyy: Inertia tensor component Iyy :type opts.Iyy: double :param opts.Izz: Inertia tensor component Izz :type opts.Izz: double :param opts.Ixy: Inertia tensor component Ixy :type opts.Ixy: double :param opts.Ixz: Inertia tensor component Ixz :type opts.Ixz: double :param opts.Iyz: Inertia tensor component Iyz :type opts.Iyz: double :param opts.eta: Eta value for the payload :type opts.eta: double :param opts.Offset: Offset of the payload element from its parent :type opts.Offset: 3,1 :param opts.Name: Name of the payload element :type opts.Name: string :param opts.Force: Force applied to the payload :type opts.Force: 3,1 :param opts.Moment: Moment applied to the payload :type opts.Moment: 3,1
- Property Summary
- Capacity
Maximum payload capacity of this Element (if filling level =1
- FillingLevel
Filling level of the payload, default is 1 (full), this can be set to a value between 0 and 1
- Method Summary
- BaffToProp(filepath, loc)
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- GetElementCoM()
GetElementCoM returns the center of mass and masses of the payload element, at current filling level
- GetElementMass()
GetElementMass returns the mass of the payload element, at current filling level
- GetElementOEM()
GetElementOEM returns the operational empty mass of the payload element(e.g. zero…)
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- draw(opts)
Draw draw an element in 3D Space :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- getType()
baff.Point
- class baff.Point
Bases:
baff.ElementPOINT Summary of this class goes here Detailed explanation goes here
- Constructor Summary
- Point(CompOpts, opts)
POINT Construct an instance of the Point class
- Property Summary
- Force
force applied to this gridpoint (in local coordinate system)
- Moment
moment applied to this gridpoint (in local coordinate system)
- VectorPltScaling
- Method Summary
- BaffToProp(filepath, loc)
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
- draw(opts)
Draw draw an element in 3D Space :param opts.Origin: Origin of the beam element in 3D space :param opts.A: Rotation matrix to beam coordinate system :param opts.Type: plot type
- eq(obj1, obj2)
overloads the == operator to check the equality of two Point objects.
- getType()
getType returns the type of the object as a string.
baff.Wing
- class baff.Wing
Bases:
baff.BeamWING class to build Baff wing models
- Constructor Summary
- Wing(aeroStations, opts, CompOpts)
WING Construct an instance of this class
- Property Summary
- AeroStations
Aero stations for the wing
- ControlSurfaces
Control surfaces for the wing
- PlanformArea
Planform area of the wing
- Span
Span of the wing
- Method Summary
- DistributeForce(Nele, opts)
- DistributeMass(mass, Nele, opts)
- FromBaff(filepath, loc)
FROMBAFF build a beam BAFF object from a HDF5 file. :param filepath: path to the HDF5 file :param loc: location in the HDF5 file where the beam data is stored
- static FromLETESweep(span, RootChord, etas, LESweep, TESweep, BeamLoc, Material, opts)
FromLETESweep creates a wing from leading and trailing edge sweep angles :param span: span of the wing :param RootChord: chord at the root of the wing :param etas: vector of etas at which to create the wing :param LESweep: leading edge sweep angles at each eta :param TESweep: trailing edge sweep angles at each eta :param BeamLoc: normalised location of the beam along the chord at each eta :param Material: material of the wing :param opts.Dihedral: dihedral angle at each eta ( or scalar for constant dihedral) :param opts.Twist: twist angle at each eta ( or scalar for constant twist) :param opts.ThicknessRatio: thickness ratio at each eta ( or scalar for constant thickness ratio)
- GetGlobalWingPos(etas, pChord)
GetGlobalWingPos returns the global position of the wing at given etas and pChord :param etas: vector of etas at which to get the position :param pChord: normailised chord at which to get the position, where 0 is the leading edge and 1 is the trailing edge
- GetMAC()
GetMAC returns the mean aerodynamic chord and its position this is here for legacy as most people say mean aerodynamic chord, but actually mean the mean geometric chord…
- GetMGC(pChord)
GetMGC returns the mean geometric chord and its position :param pChord: normailised chord at which to return the position, where 0 is the leading edge and 1 is the trailing edge
- GetPos(eta)
GetPos returns the position of the wing at a given eta along the beam line
- GetSweepAngles(cEta)
GetSweepAngles returns the sweep angle of the wing at each aero station :param cEta: the normailised chord at which to calculate the sweep angle
- GetWingPos(eta, pChord)
GetWingPos returns the position of the wing at a given eta and pChord
- PlanformAreas()
PlanformArea returns the planform area of the wing between each aero station
- Spans()
Span returns the span of the wing between each aero station
- TemplateHdf5(filepath, loc)
TEMPLATEHDF5 Create a template for the Beam BAFF object in an HDF5 file. :param filepath: Path to the HDF5 file :type filepath: string :param loc: Location in the file where the Beam data will be stored :type loc: string
- ToBaff(filepath, loc)
TOBAFF Write a beam BAFF object to a HDF5 file. :param filepath: Path to file :type filepath: string :param loc: Location in file :type loc: string
- static UniformWing(length, barHeight, barWidth, Material, Chord, BeamLoc, opts)
Static function to create a uniform wing :param length: length of the wing :param barHeight: height of the beam cross section :param barWidth: width of the beam cross section :param Material: material of the beam :param Chord: chord of the wing :param BeamLoc: location of the beam in the chord :param opts.NAeroStations: number of aero stations :param opts.NStations: number of beam stations :param opts.etaAeroMin: minimum eta for aero stations :param opts.etaAeroMax: maximum eta for aero stations :param opts.etaBeamMax: maximum eta for beam stations :param opts.LiftCurveSlope: lift curve slope of the wing
- WettedArea()
WettedArea returns the wetted area of the wing
- draw(opts)
- eq(obj1, obj2)
overloads the == operator to check the equality of two Wing objects.
- getType()
getType returns the type of the object as a string.