Skip to content

Rocket.addFins() airfoil argument should support floats and lists #55

@giovaniceotto

Description

@giovaniceotto

Use case
Try to add fins to a rocket object using a list as the airfoil argument:

cl_data = [
    [0.00, 0.0],
    [0.20, 1.05],
    [1.00, 1.05],
    [1.57, 0.0],
]

FinSet = TestRocket.addFins(
    n=3, 
    rootChord=0.077, 
    tipChord=47/1000, 
    span=0.104,
    distanceToCM=-0.99586,
    airfoil=cl_data
)

Expected result
Fins are added properly with no errors or warnings.
Airfoil argument should support entries in list format, just like other similar RocketPy entries (powerOnDrag, powerOffDrag, thrust, etc.):

  • Lists should be converted into functions using Function.
  • Floats could be interpreted as a lift coefficient derivative.

What happens instead

Exception has occurred: AttributeError 'list' object has no attribute 'split'
  File "rocketpy\Rocket.py", line 607, in addFins
    read = genfromtxt(airfoil, delimiter = ',')
  File "test.py", line 41, in <module>
    FinSet = TestRocket.addFins(

Applies to versions:
Master branch only, no releases yet.

Metadata

Metadata

Assignees

Labels

AerodynamicsAny problem to be worked on top of RocketPy's AerodynamicBugSomething isn't workingRefactor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions