1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
|
%global _empty_manifest_terminate_build 0
Name: python-PteraSoftware
Version: 2.2.1
Release: 1
Summary: This is an open-source, unsteady aerodynamics solver for analyzing flapping-wing flight.
License: MIT
URL: https://github.com/camurban/pterasoftware
Source0: https://mirrors.aliyun.com/pypi/web/packages/44/67/106aae9a437b95c6ab4407b3206ed8affd9faeff3cc09b7b8898047824dd/PteraSoftware-2.2.1.tar.gz
BuildArch: noarch
Requires: python3-matplotlib
Requires: python3-numpy
Requires: python3-pyvista
Requires: python3-scipy
Requires: python3-numba
Requires: python3-cmocean
Requires: python3-tqdm
Requires: python3-webp
%description

***






***

This is Ptera Software: a fast, easy-to-use, and open-source package for analyzing
flapping-wing flight.
## Motivation
In late 2018, I became curious about biological flight. To sate this curiosity, I
wanted to computationally simulate some flapping-wing fliers. I quickly realized I had
two options:
1. Spend thousands of dollars on a closed-source CFD program, which would take hours to
solve a simple case.
2. Try to learn someone else's open-source, unsteady solver written in a language I
didn't know, or using a framework that is overly complicated for my use case.
Neither of these seemed like the right choice.
Thankfully, my friend, Peter Sharpe, had just released his own open-source aerodynamics
solver: AeroSandbox. With his support, I have used AeroSandbox as a jumping-off point
to develop a solver package capable of unsteady simulations.
Through the combined efforts of Peter Sharpe, Suhas Kodali, and me, Ptera Software was
born. It is an easy-to-use, open-source, and actively-maintained UVLM package capable
of analyzing flapping-wing flight. Moreover, it's written in Python, is well
documented, tested, and validated.
With your help, I hope we will increase the open-source community's interest and
understanding of biological flight.
## Features
1. Various Aerodynamic Simulation Methods
* Steady simulations can be run with a standard horseshoe vortex-lattice method
(VLM) or a ring VLM.
* Unsteady simulations use a ring unsteady VLM (UVLM) solver.
* Unsteady simulations support both fixed and free wakes.
* Unsteady simulations implement vortex aging to reduce numerical instabilities.
2. Customizable Aircraft Geometry
* Aircraft can be defined as a collection of one or more wings of any dimensions and
positions.
* Wings can be defined as a collection of two or more wing cross sections of any
dimensions and positions.
* Wing cross sections can be specified to match the mean camber line of an airfoil.
* The package comes with a massive database of airfoil to chose from.
* Wings are automatically discretized into panels with customizable sizes and
spacings.
3. Customizable Aircraft Motion
* The relative motion of wings and wing cross sections can be defined using any
time-dependent functions of sweep, pitch, and heave angles.
4. Customizable Operating Points
* Parameters such as the free-stream velocity, density, angle of attack, angle of
sideslip, etc. can be changed by the user.
5. High-Speed Simulations
* Using Just-In-Time compilation, Ptera Software can solve many unsteady
flapping-wing simulations in less than a minute!
* Steady simulations take only seconds!
6. Simulations of Formation Flight
* Since v2.0.0, Ptera Software has supported simulations with more than one
airplane.
* This feature can be used to analyze the aerodynamics of flapping-wing formation
flight!
7. Features for Flapping-Wing Vehicle Design
* Ptera Software is focused on developing features to facilitate designing
flapping-wing vehicles.
* For example, use the functions in the trim module to automatically search for a
trim operating point for steady and unsteady simulations of aircraft.
## Installation and Use
First things first, you will need a copy of Python 3.8. Python 3.9 is not yet supported
due to a dependency issue in VTK. Download Python 3.8 from the official Python website.
At this time, I do not recommend using a version from the Anaconda distribution as it
could introduce compatibility issues with PyPI.
There are two ways to use Ptera Software. The first is by downloading GitHub release,
which will provide you your own copy of the source code, in which you can get a feel
for how it works (this can also be accomplished by forking the main branch). The second
is by importing the Ptera Software package using PyPI, which will allow you to call
Ptera Software's functions in your own scripts. If you are new to this tool, I
recommend first downloading a release, as this will give you access to the "examples"
directory.
Next, make sure you have an IDE in which you can run Ptera Software. I recommend using
the Community Edition of PyCharm, which is free, powerful, and well documented. If
you've never set up a Python project before, follow
[this guide](https://www.jetbrains.com/help/pycharm/quick-start-guide.html) to set up a
new project in PyCharm. If you'll be downloading a release, follow that tutorial's
"Open an existing project guide." Otherwise, follow the "Create a new project guide."
### Downloading A Release
To download a release, navigate to
[the releases page](https://github.com/camUrban/PteraSoftware/releases) and download
the latest zipped directory. Extract the contents, and set up a python project as
described in the PyCharm tutorial.
Then, open a command prompt window in your project's directory and enter:
```pip install -r requirements.txt```
via the command prompt in your fork's directory. You may also want to run:
```pip install -r requirements_dev.txt```
if you plan on making significant changes to the software.
Finally, open the "examples" folder, which contains several heavily commented scripts
that demonstrate different features and simulations. Read through each example, and
then run them to admire their pretty output!
### Importing As A Package
If you wish to use this package as a dependency in your own project, simply run:
```pip install pterasoftware```
via the command prompt in your project's directory. Then, in a script that you'd like
to use features from Ptera Software, add:
```import pterasoftware as ps```
If you haven't previously downloaded Ptera Software's source code, you can also learn
about the available functions by reading their docstrings, which should be fetched
automatically by many IDEs. Otherwise, you can return to the GitHub and read through
the docstrings there.
I am hoping to implement a web-based documentation guide soon! If you'd like to
contribute to this, feel free to open a feature request issue and start a conversation!
### What If I'm Having Trouble Getting Set Up?
Not to worry! I am working on a video that walks through getting Ptera Software up and
running. It will include every step, from downloading Python for the first time to
setting up your IDE to running the software. In the meantime, feel free to open an
issue for guidance.
## Example Code
The following code snippet is all that is needed (after running pip install
pterasoftware) to run the steady horseshoe solver on a custom airplane object.
```
import pterasoftware as ps
example_airplane = ps.geometry.Airplane(
wings=[
ps.geometry.Wing(
symmetric=True,
wing_cross_sections=[
ps.geometry.WingCrossSection(
airfoil=ps.geometry.Airfoil(name="naca2412",),
),
ps.geometry.WingCrossSection(
y_le=5.0, airfoil=ps.geometry.Airfoil(name="naca2412",),
),
],
),
],
)
example_operating_point = ps.operating_point.OperatingPoint()
example_problem = ps.problems.SteadyProblem(
airplane=example_airplane,
operating_point=example_operating_point
)
example_solver = ps.steady_horseshoe_vortex_lattice_method.SteadyHorseshoeVortexLatticeMethodSolver(
steady_problem=example_problem
)
example_solver.run()
ps.output.draw(solver=example_solver, show_delta_pressures=True, show_streamlines=True)
```
## Example Output
This package currently supports three different solvers, a steady horseshoe vortex
lattice method (VLM), a steady ring VLM, and an unsteady ring VLM (UVLM). Here are
examples of the output you can expect to receive from each of them.
### Steady Horseshoe VLM

### Steady Ring VLM

### Unsteady Ring VLM



## Requirements
Here are the requirements necessary to run Ptera Software:
* matplotlib >= 3.5.2, < 4.0.0
* numpy >= 1.22.4, < 1.24.0
* pyvista >= 0.34.1, < 1.0.0
* scipy >= 1.8.1, < 2.0.0
* numba >= 0.55.2, < 1.0.0
* cmocean >= 2.0.0, < 3.0.0
* tqdm >= 4.64.0, < 5.0.0
* webp >= 0.1.4, < 1.0.0
Additionally, these packages are useful for continued development of the software:
* codecov >= 2.1.12, < 3.0.0
* black >= 22.6.0, < 23.0.0
* pre-commit >= 2.19.0, < 3.0.0
* build >= 0.8.0, < 1.0.0
* twine >= 4.0.1, < 5.0.0
* setuptools >= 62.6.0, < 63.0.0
* wheel >= 0.37.1, < 0.38.0
## Validation
Since the release of version 1.0.0, Ptera Software is now validated against
experimental flapping-wing data! See the "validation" directory to run the test case
and read a report on the software's accuracy.
## How to Contribute
As I said before, the primary goal of this project is to increase the open-source
community's understanding and appreciation for unsteady aerodynamics in general and
flapping-wing flight in particular. This will only happen through your participation.
Feel free to request features, report bugs or security issues, and provide suggestions.
No comment is too big or small!
Here is a list of changes I would like to make in the coming releases. If you want to
contribute and don't know where to start, this is for you!
### Testing
* We should make sure that all the integration tests compare output against expected
results. This means getting rid of all the "test_method_does_not_throw" tests.
* We should maintain the repository's testing coverage to be at least 80%.
### Style and Documentation
* Maintain the repository's A CodeFactor Rating.
* We should fill in any of the "Properly document this..." TODO statements.
* We should ensure that all files be at least 30% comment lines.
* We should continue to ensure that all source code is formatted using Black.
### Features
* We should create a setup tutorial video and add it to the documentation. This should
be geared toward a user who doesn't have Python, an IDE, or Ptera Software installed on
their computer yet.
* We should implement a leading-edge model to account for flow separation. See
"Modified Unsteady Vortex-Lattice Method to Study Flapping Wings in Hover Flight." by
Bruno Roccia, Sergio Preidikman, Julio Massa, and Dean Mook for details.
* We should create a command-line interface or GUI.
* We should try to implement aeroelastic effects in Ptera Software's solvers.
* Flapping wing controls is both fascinating and complicated. We should try to create a
workflow in Ptera Software for controls systems identification for flapping-wing
vehicles.
## Credits
Here is a list of all the people and packages that helped me created Ptera Software in
no particular order. Specific citations can be found in the source code's docstrings
where applicable.
* Suhas Kodali
* Peter Sharpe
* Ramesh Agarwal
* Joseph Katz
* Allen Plotkin
* Austin Stover
* AeroSandbox
* Black
* Codecov
* Travis CI
* NumPy
* SciPy
* PyVista
* MatPlotLib
* Numba
* Pre-Commit
* SetupTools
* GitIgnore
* Shields.io
* PyPI
* Wheel
* Twine
* SemVer
* GitFlow
* Cmocean
* Tqdm
* WebP
* Build
## Notes
To the best of my ability, I am following SemVer conventions in naming my releases. I
am also using the GitFlow method of branching for this project's development. This
means that nightly builds will be available on the develop branch. The latest stable
releases can be found on the master branch.
%package -n python3-PteraSoftware
Summary: This is an open-source, unsteady aerodynamics solver for analyzing flapping-wing flight.
Provides: python-PteraSoftware
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-PteraSoftware

***






***

This is Ptera Software: a fast, easy-to-use, and open-source package for analyzing
flapping-wing flight.
## Motivation
In late 2018, I became curious about biological flight. To sate this curiosity, I
wanted to computationally simulate some flapping-wing fliers. I quickly realized I had
two options:
1. Spend thousands of dollars on a closed-source CFD program, which would take hours to
solve a simple case.
2. Try to learn someone else's open-source, unsteady solver written in a language I
didn't know, or using a framework that is overly complicated for my use case.
Neither of these seemed like the right choice.
Thankfully, my friend, Peter Sharpe, had just released his own open-source aerodynamics
solver: AeroSandbox. With his support, I have used AeroSandbox as a jumping-off point
to develop a solver package capable of unsteady simulations.
Through the combined efforts of Peter Sharpe, Suhas Kodali, and me, Ptera Software was
born. It is an easy-to-use, open-source, and actively-maintained UVLM package capable
of analyzing flapping-wing flight. Moreover, it's written in Python, is well
documented, tested, and validated.
With your help, I hope we will increase the open-source community's interest and
understanding of biological flight.
## Features
1. Various Aerodynamic Simulation Methods
* Steady simulations can be run with a standard horseshoe vortex-lattice method
(VLM) or a ring VLM.
* Unsteady simulations use a ring unsteady VLM (UVLM) solver.
* Unsteady simulations support both fixed and free wakes.
* Unsteady simulations implement vortex aging to reduce numerical instabilities.
2. Customizable Aircraft Geometry
* Aircraft can be defined as a collection of one or more wings of any dimensions and
positions.
* Wings can be defined as a collection of two or more wing cross sections of any
dimensions and positions.
* Wing cross sections can be specified to match the mean camber line of an airfoil.
* The package comes with a massive database of airfoil to chose from.
* Wings are automatically discretized into panels with customizable sizes and
spacings.
3. Customizable Aircraft Motion
* The relative motion of wings and wing cross sections can be defined using any
time-dependent functions of sweep, pitch, and heave angles.
4. Customizable Operating Points
* Parameters such as the free-stream velocity, density, angle of attack, angle of
sideslip, etc. can be changed by the user.
5. High-Speed Simulations
* Using Just-In-Time compilation, Ptera Software can solve many unsteady
flapping-wing simulations in less than a minute!
* Steady simulations take only seconds!
6. Simulations of Formation Flight
* Since v2.0.0, Ptera Software has supported simulations with more than one
airplane.
* This feature can be used to analyze the aerodynamics of flapping-wing formation
flight!
7. Features for Flapping-Wing Vehicle Design
* Ptera Software is focused on developing features to facilitate designing
flapping-wing vehicles.
* For example, use the functions in the trim module to automatically search for a
trim operating point for steady and unsteady simulations of aircraft.
## Installation and Use
First things first, you will need a copy of Python 3.8. Python 3.9 is not yet supported
due to a dependency issue in VTK. Download Python 3.8 from the official Python website.
At this time, I do not recommend using a version from the Anaconda distribution as it
could introduce compatibility issues with PyPI.
There are two ways to use Ptera Software. The first is by downloading GitHub release,
which will provide you your own copy of the source code, in which you can get a feel
for how it works (this can also be accomplished by forking the main branch). The second
is by importing the Ptera Software package using PyPI, which will allow you to call
Ptera Software's functions in your own scripts. If you are new to this tool, I
recommend first downloading a release, as this will give you access to the "examples"
directory.
Next, make sure you have an IDE in which you can run Ptera Software. I recommend using
the Community Edition of PyCharm, which is free, powerful, and well documented. If
you've never set up a Python project before, follow
[this guide](https://www.jetbrains.com/help/pycharm/quick-start-guide.html) to set up a
new project in PyCharm. If you'll be downloading a release, follow that tutorial's
"Open an existing project guide." Otherwise, follow the "Create a new project guide."
### Downloading A Release
To download a release, navigate to
[the releases page](https://github.com/camUrban/PteraSoftware/releases) and download
the latest zipped directory. Extract the contents, and set up a python project as
described in the PyCharm tutorial.
Then, open a command prompt window in your project's directory and enter:
```pip install -r requirements.txt```
via the command prompt in your fork's directory. You may also want to run:
```pip install -r requirements_dev.txt```
if you plan on making significant changes to the software.
Finally, open the "examples" folder, which contains several heavily commented scripts
that demonstrate different features and simulations. Read through each example, and
then run them to admire their pretty output!
### Importing As A Package
If you wish to use this package as a dependency in your own project, simply run:
```pip install pterasoftware```
via the command prompt in your project's directory. Then, in a script that you'd like
to use features from Ptera Software, add:
```import pterasoftware as ps```
If you haven't previously downloaded Ptera Software's source code, you can also learn
about the available functions by reading their docstrings, which should be fetched
automatically by many IDEs. Otherwise, you can return to the GitHub and read through
the docstrings there.
I am hoping to implement a web-based documentation guide soon! If you'd like to
contribute to this, feel free to open a feature request issue and start a conversation!
### What If I'm Having Trouble Getting Set Up?
Not to worry! I am working on a video that walks through getting Ptera Software up and
running. It will include every step, from downloading Python for the first time to
setting up your IDE to running the software. In the meantime, feel free to open an
issue for guidance.
## Example Code
The following code snippet is all that is needed (after running pip install
pterasoftware) to run the steady horseshoe solver on a custom airplane object.
```
import pterasoftware as ps
example_airplane = ps.geometry.Airplane(
wings=[
ps.geometry.Wing(
symmetric=True,
wing_cross_sections=[
ps.geometry.WingCrossSection(
airfoil=ps.geometry.Airfoil(name="naca2412",),
),
ps.geometry.WingCrossSection(
y_le=5.0, airfoil=ps.geometry.Airfoil(name="naca2412",),
),
],
),
],
)
example_operating_point = ps.operating_point.OperatingPoint()
example_problem = ps.problems.SteadyProblem(
airplane=example_airplane,
operating_point=example_operating_point
)
example_solver = ps.steady_horseshoe_vortex_lattice_method.SteadyHorseshoeVortexLatticeMethodSolver(
steady_problem=example_problem
)
example_solver.run()
ps.output.draw(solver=example_solver, show_delta_pressures=True, show_streamlines=True)
```
## Example Output
This package currently supports three different solvers, a steady horseshoe vortex
lattice method (VLM), a steady ring VLM, and an unsteady ring VLM (UVLM). Here are
examples of the output you can expect to receive from each of them.
### Steady Horseshoe VLM

### Steady Ring VLM

### Unsteady Ring VLM



## Requirements
Here are the requirements necessary to run Ptera Software:
* matplotlib >= 3.5.2, < 4.0.0
* numpy >= 1.22.4, < 1.24.0
* pyvista >= 0.34.1, < 1.0.0
* scipy >= 1.8.1, < 2.0.0
* numba >= 0.55.2, < 1.0.0
* cmocean >= 2.0.0, < 3.0.0
* tqdm >= 4.64.0, < 5.0.0
* webp >= 0.1.4, < 1.0.0
Additionally, these packages are useful for continued development of the software:
* codecov >= 2.1.12, < 3.0.0
* black >= 22.6.0, < 23.0.0
* pre-commit >= 2.19.0, < 3.0.0
* build >= 0.8.0, < 1.0.0
* twine >= 4.0.1, < 5.0.0
* setuptools >= 62.6.0, < 63.0.0
* wheel >= 0.37.1, < 0.38.0
## Validation
Since the release of version 1.0.0, Ptera Software is now validated against
experimental flapping-wing data! See the "validation" directory to run the test case
and read a report on the software's accuracy.
## How to Contribute
As I said before, the primary goal of this project is to increase the open-source
community's understanding and appreciation for unsteady aerodynamics in general and
flapping-wing flight in particular. This will only happen through your participation.
Feel free to request features, report bugs or security issues, and provide suggestions.
No comment is too big or small!
Here is a list of changes I would like to make in the coming releases. If you want to
contribute and don't know where to start, this is for you!
### Testing
* We should make sure that all the integration tests compare output against expected
results. This means getting rid of all the "test_method_does_not_throw" tests.
* We should maintain the repository's testing coverage to be at least 80%.
### Style and Documentation
* Maintain the repository's A CodeFactor Rating.
* We should fill in any of the "Properly document this..." TODO statements.
* We should ensure that all files be at least 30% comment lines.
* We should continue to ensure that all source code is formatted using Black.
### Features
* We should create a setup tutorial video and add it to the documentation. This should
be geared toward a user who doesn't have Python, an IDE, or Ptera Software installed on
their computer yet.
* We should implement a leading-edge model to account for flow separation. See
"Modified Unsteady Vortex-Lattice Method to Study Flapping Wings in Hover Flight." by
Bruno Roccia, Sergio Preidikman, Julio Massa, and Dean Mook for details.
* We should create a command-line interface or GUI.
* We should try to implement aeroelastic effects in Ptera Software's solvers.
* Flapping wing controls is both fascinating and complicated. We should try to create a
workflow in Ptera Software for controls systems identification for flapping-wing
vehicles.
## Credits
Here is a list of all the people and packages that helped me created Ptera Software in
no particular order. Specific citations can be found in the source code's docstrings
where applicable.
* Suhas Kodali
* Peter Sharpe
* Ramesh Agarwal
* Joseph Katz
* Allen Plotkin
* Austin Stover
* AeroSandbox
* Black
* Codecov
* Travis CI
* NumPy
* SciPy
* PyVista
* MatPlotLib
* Numba
* Pre-Commit
* SetupTools
* GitIgnore
* Shields.io
* PyPI
* Wheel
* Twine
* SemVer
* GitFlow
* Cmocean
* Tqdm
* WebP
* Build
## Notes
To the best of my ability, I am following SemVer conventions in naming my releases. I
am also using the GitFlow method of branching for this project's development. This
means that nightly builds will be available on the develop branch. The latest stable
releases can be found on the master branch.
%package help
Summary: Development documents and examples for PteraSoftware
Provides: python3-PteraSoftware-doc
%description help

***






***

This is Ptera Software: a fast, easy-to-use, and open-source package for analyzing
flapping-wing flight.
## Motivation
In late 2018, I became curious about biological flight. To sate this curiosity, I
wanted to computationally simulate some flapping-wing fliers. I quickly realized I had
two options:
1. Spend thousands of dollars on a closed-source CFD program, which would take hours to
solve a simple case.
2. Try to learn someone else's open-source, unsteady solver written in a language I
didn't know, or using a framework that is overly complicated for my use case.
Neither of these seemed like the right choice.
Thankfully, my friend, Peter Sharpe, had just released his own open-source aerodynamics
solver: AeroSandbox. With his support, I have used AeroSandbox as a jumping-off point
to develop a solver package capable of unsteady simulations.
Through the combined efforts of Peter Sharpe, Suhas Kodali, and me, Ptera Software was
born. It is an easy-to-use, open-source, and actively-maintained UVLM package capable
of analyzing flapping-wing flight. Moreover, it's written in Python, is well
documented, tested, and validated.
With your help, I hope we will increase the open-source community's interest and
understanding of biological flight.
## Features
1. Various Aerodynamic Simulation Methods
* Steady simulations can be run with a standard horseshoe vortex-lattice method
(VLM) or a ring VLM.
* Unsteady simulations use a ring unsteady VLM (UVLM) solver.
* Unsteady simulations support both fixed and free wakes.
* Unsteady simulations implement vortex aging to reduce numerical instabilities.
2. Customizable Aircraft Geometry
* Aircraft can be defined as a collection of one or more wings of any dimensions and
positions.
* Wings can be defined as a collection of two or more wing cross sections of any
dimensions and positions.
* Wing cross sections can be specified to match the mean camber line of an airfoil.
* The package comes with a massive database of airfoil to chose from.
* Wings are automatically discretized into panels with customizable sizes and
spacings.
3. Customizable Aircraft Motion
* The relative motion of wings and wing cross sections can be defined using any
time-dependent functions of sweep, pitch, and heave angles.
4. Customizable Operating Points
* Parameters such as the free-stream velocity, density, angle of attack, angle of
sideslip, etc. can be changed by the user.
5. High-Speed Simulations
* Using Just-In-Time compilation, Ptera Software can solve many unsteady
flapping-wing simulations in less than a minute!
* Steady simulations take only seconds!
6. Simulations of Formation Flight
* Since v2.0.0, Ptera Software has supported simulations with more than one
airplane.
* This feature can be used to analyze the aerodynamics of flapping-wing formation
flight!
7. Features for Flapping-Wing Vehicle Design
* Ptera Software is focused on developing features to facilitate designing
flapping-wing vehicles.
* For example, use the functions in the trim module to automatically search for a
trim operating point for steady and unsteady simulations of aircraft.
## Installation and Use
First things first, you will need a copy of Python 3.8. Python 3.9 is not yet supported
due to a dependency issue in VTK. Download Python 3.8 from the official Python website.
At this time, I do not recommend using a version from the Anaconda distribution as it
could introduce compatibility issues with PyPI.
There are two ways to use Ptera Software. The first is by downloading GitHub release,
which will provide you your own copy of the source code, in which you can get a feel
for how it works (this can also be accomplished by forking the main branch). The second
is by importing the Ptera Software package using PyPI, which will allow you to call
Ptera Software's functions in your own scripts. If you are new to this tool, I
recommend first downloading a release, as this will give you access to the "examples"
directory.
Next, make sure you have an IDE in which you can run Ptera Software. I recommend using
the Community Edition of PyCharm, which is free, powerful, and well documented. If
you've never set up a Python project before, follow
[this guide](https://www.jetbrains.com/help/pycharm/quick-start-guide.html) to set up a
new project in PyCharm. If you'll be downloading a release, follow that tutorial's
"Open an existing project guide." Otherwise, follow the "Create a new project guide."
### Downloading A Release
To download a release, navigate to
[the releases page](https://github.com/camUrban/PteraSoftware/releases) and download
the latest zipped directory. Extract the contents, and set up a python project as
described in the PyCharm tutorial.
Then, open a command prompt window in your project's directory and enter:
```pip install -r requirements.txt```
via the command prompt in your fork's directory. You may also want to run:
```pip install -r requirements_dev.txt```
if you plan on making significant changes to the software.
Finally, open the "examples" folder, which contains several heavily commented scripts
that demonstrate different features and simulations. Read through each example, and
then run them to admire their pretty output!
### Importing As A Package
If you wish to use this package as a dependency in your own project, simply run:
```pip install pterasoftware```
via the command prompt in your project's directory. Then, in a script that you'd like
to use features from Ptera Software, add:
```import pterasoftware as ps```
If you haven't previously downloaded Ptera Software's source code, you can also learn
about the available functions by reading their docstrings, which should be fetched
automatically by many IDEs. Otherwise, you can return to the GitHub and read through
the docstrings there.
I am hoping to implement a web-based documentation guide soon! If you'd like to
contribute to this, feel free to open a feature request issue and start a conversation!
### What If I'm Having Trouble Getting Set Up?
Not to worry! I am working on a video that walks through getting Ptera Software up and
running. It will include every step, from downloading Python for the first time to
setting up your IDE to running the software. In the meantime, feel free to open an
issue for guidance.
## Example Code
The following code snippet is all that is needed (after running pip install
pterasoftware) to run the steady horseshoe solver on a custom airplane object.
```
import pterasoftware as ps
example_airplane = ps.geometry.Airplane(
wings=[
ps.geometry.Wing(
symmetric=True,
wing_cross_sections=[
ps.geometry.WingCrossSection(
airfoil=ps.geometry.Airfoil(name="naca2412",),
),
ps.geometry.WingCrossSection(
y_le=5.0, airfoil=ps.geometry.Airfoil(name="naca2412",),
),
],
),
],
)
example_operating_point = ps.operating_point.OperatingPoint()
example_problem = ps.problems.SteadyProblem(
airplane=example_airplane,
operating_point=example_operating_point
)
example_solver = ps.steady_horseshoe_vortex_lattice_method.SteadyHorseshoeVortexLatticeMethodSolver(
steady_problem=example_problem
)
example_solver.run()
ps.output.draw(solver=example_solver, show_delta_pressures=True, show_streamlines=True)
```
## Example Output
This package currently supports three different solvers, a steady horseshoe vortex
lattice method (VLM), a steady ring VLM, and an unsteady ring VLM (UVLM). Here are
examples of the output you can expect to receive from each of them.
### Steady Horseshoe VLM

### Steady Ring VLM

### Unsteady Ring VLM



## Requirements
Here are the requirements necessary to run Ptera Software:
* matplotlib >= 3.5.2, < 4.0.0
* numpy >= 1.22.4, < 1.24.0
* pyvista >= 0.34.1, < 1.0.0
* scipy >= 1.8.1, < 2.0.0
* numba >= 0.55.2, < 1.0.0
* cmocean >= 2.0.0, < 3.0.0
* tqdm >= 4.64.0, < 5.0.0
* webp >= 0.1.4, < 1.0.0
Additionally, these packages are useful for continued development of the software:
* codecov >= 2.1.12, < 3.0.0
* black >= 22.6.0, < 23.0.0
* pre-commit >= 2.19.0, < 3.0.0
* build >= 0.8.0, < 1.0.0
* twine >= 4.0.1, < 5.0.0
* setuptools >= 62.6.0, < 63.0.0
* wheel >= 0.37.1, < 0.38.0
## Validation
Since the release of version 1.0.0, Ptera Software is now validated against
experimental flapping-wing data! See the "validation" directory to run the test case
and read a report on the software's accuracy.
## How to Contribute
As I said before, the primary goal of this project is to increase the open-source
community's understanding and appreciation for unsteady aerodynamics in general and
flapping-wing flight in particular. This will only happen through your participation.
Feel free to request features, report bugs or security issues, and provide suggestions.
No comment is too big or small!
Here is a list of changes I would like to make in the coming releases. If you want to
contribute and don't know where to start, this is for you!
### Testing
* We should make sure that all the integration tests compare output against expected
results. This means getting rid of all the "test_method_does_not_throw" tests.
* We should maintain the repository's testing coverage to be at least 80%.
### Style and Documentation
* Maintain the repository's A CodeFactor Rating.
* We should fill in any of the "Properly document this..." TODO statements.
* We should ensure that all files be at least 30% comment lines.
* We should continue to ensure that all source code is formatted using Black.
### Features
* We should create a setup tutorial video and add it to the documentation. This should
be geared toward a user who doesn't have Python, an IDE, or Ptera Software installed on
their computer yet.
* We should implement a leading-edge model to account for flow separation. See
"Modified Unsteady Vortex-Lattice Method to Study Flapping Wings in Hover Flight." by
Bruno Roccia, Sergio Preidikman, Julio Massa, and Dean Mook for details.
* We should create a command-line interface or GUI.
* We should try to implement aeroelastic effects in Ptera Software's solvers.
* Flapping wing controls is both fascinating and complicated. We should try to create a
workflow in Ptera Software for controls systems identification for flapping-wing
vehicles.
## Credits
Here is a list of all the people and packages that helped me created Ptera Software in
no particular order. Specific citations can be found in the source code's docstrings
where applicable.
* Suhas Kodali
* Peter Sharpe
* Ramesh Agarwal
* Joseph Katz
* Allen Plotkin
* Austin Stover
* AeroSandbox
* Black
* Codecov
* Travis CI
* NumPy
* SciPy
* PyVista
* MatPlotLib
* Numba
* Pre-Commit
* SetupTools
* GitIgnore
* Shields.io
* PyPI
* Wheel
* Twine
* SemVer
* GitFlow
* Cmocean
* Tqdm
* WebP
* Build
## Notes
To the best of my ability, I am following SemVer conventions in naming my releases. I
am also using the GitFlow method of branching for this project's development. This
means that nightly builds will be available on the develop branch. The latest stable
releases can be found on the master branch.
%prep
%autosetup -n PteraSoftware-2.2.1
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-PteraSoftware -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 2.2.1-1
- Package Spec generated
|