Skip to content

Commit ee0cd5a

Browse files
committed
Update examples.md
1 parent e2da611 commit ee0cd5a

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

docs/src/examples.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ aerodynamics using VSM and LLT. We'll cover the following steps:
1616

1717
First, install Julia and set up the examples environment as explained in the
1818
section [Running the examples as developer](@ref). Then launch Julia:
19+
1920
```bash
2021
julia --project=examples
2122
```
2223

2324
#### Step 1: Importing the necessary libraries:
25+
2426
```julia
2527
julia> using LinearAlgebra
2628
julia> using GLMakie
2729
julia> using VortexStepMethod
2830
```
2931

3032
#### Step 2: Define wing parameters
33+
3134
```julia
3235
julia> n_panels = 20 # Number of panels
3336
julia> span = 20.0 # Wing span [m]
@@ -38,11 +41,13 @@ julia> alpha = deg2rad(alpha_deg)
3841
```
3942

4043
#### Step 3: Create wing geometry with linear panel distribution
44+
4145
```julia
4246
julia> wing = Wing(n_panels, spanwise_distribution=LINEAR)
4347
```
4448

4549
##### Add wing sections - defining only tip sections with inviscid airfoil model
50+
4651
```julia
4752
julia> add_section!(wing,
4853
[0.0, span/2, 0.0], # Left tip LE
@@ -55,36 +60,43 @@ julia> add_section!(wing,
5560
```
5661

5762
##### Refine the mesh
63+
5864
```julia
5965
julia> refine!(wing)
6066
```
6167

6268
#### Step 4: Initialize aerodynamics
69+
6370
```julia
6471
julia> body_aero = BodyAerodynamics([wing])
6572
```
73+
6674
We need to pass here an array of wing objects, because a body can have
6775
multiple wings.
6876

6977
###### Set inflow conditions
78+
7079
```julia
7180
julia> vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
7281
julia> set_va!(body_aero, vel_app, [0, 0, 0.1])
7382
```
7483

7584
#### Step 5: Initialize solvers for both LLT and VSM methods
85+
7686
```julia
7787
julia> llt_solver = Solver(body_aero; aerodynamic_model_type=LLT)
7888
julia> vsm_solver = Solver(body_aero; aerodynamic_model_type=VSM)
7989
```
8090

8191
#### Step 6: Solve using both methods
92+
8293
```julia
8394
julia> results_llt = solve(llt_solver, body_aero)
8495
julia> results_vsm = solve(vsm_solver, body_aero)
8596
```
8697

8798
##### Print results comparison
99+
88100
```julia
89101
julia> println("\nLifting Line Theory Results:")
90102
julia> println("CL = $(round(results_llt["cl"], digits=4))")
@@ -96,6 +108,7 @@ julia> println("Projected area = $(round(results_vsm["projected_area"], digits=4
96108
```
97109

98110
#### Step 7: Plot combined analysis
111+
99112
```julia
100113
julia> angle_range = range(0, 20, 20)
101114
julia> plot_combined_analysis(
@@ -112,13 +125,22 @@ julia> plot_combined_analysis(
112125
```
113126

114127
## More examples
115-
From the examples environment (`julia --project=examples`), you can execute
128+
After launching Julia with (`jl`), you can execute
116129
more examples by typing:
130+
117131
```julia
118132
julia> include("examples/menu.jl")
119133
```
120-
You should see the following menu:
134+
135+
or, you prefer to use the ControlPlots library:
136+
137+
```julia
138+
julia> include("examples_cp/menu_cp.jl")
121139
```
140+
141+
You should see the following menu:
142+
143+
```text
122144
Choose function to execute or `q` to quit:
123145
> V3_kite = include("V3_kite.jl")
124146
billowing = include("billowing.jl")
@@ -130,5 +152,6 @@ Choose function to execute or `q` to quit:
130152
cleanup = include("cleanup.jl")
131153
quit
132154
```
155+
133156
You can select one of the examples using the `<UP>` and `<DOWN>` keys.
134157
Press `<ENTER>` to run the selected example.

0 commit comments

Comments
 (0)