Skip to content

Commit 9042f64

Browse files
authored
Merge pull request #37 from Ariskar93/patch-2
Updated README.md
2 parents 3490f19 + 0ff216c commit 9042f64

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
# Two particles
22

3-
Define two particles with the first centred at [1.,-2.], with radius 1.0, sound speed 2.0 and density 10.0
3+
Define two particles with the first centred at [1.0,-2.0], with radius 1.0, sound speed 2.0 and density 10.0.
44
```julia
55
using MultipleScattering
66
using Plots
77
pyplot()
88

9-
p1 = Particle(Acoustic(2; c = 20.0, ρ = 10.),Sphere([1.,-4.], 1.0))
10-
p2 = Particle(Acoustic(2; c = 1.0, ρ = 0.1),Sphere([3.,3.], 3.0))
9+
p1 = Particle(Acoustic(2; c = 20.0, ρ = 10.0),Sphere([1.0,-4.0], 1.0))
10+
p2 = Particle(Acoustic(2; c = 1.0, ρ = 0.1),Sphere([3.0,3.0], 3.0))
1111
particles = [p1,p2]
1212
```
1313

14-
Specify the angular frequency of the incident wave and calculate the response
14+
Specify the angular frequency of the incident wave and calculate the response.
1515
```julia
16-
w_arr = collect(0.1:0.01:1.)
16+
ωs = collect(0.1:0.01:1.0)
1717
source = plane_source(Acoustic(1.0, 1.0, 2));
18-
# calculate and plot the frequency response at x
18+
# Calculate and plot the frequency response at x.
1919
x = [[-10.0,0.0]];
20-
simulation = run(particles, source, x, w_arr)
20+
simulation = run(particles, source, x, ωs)
2121
plot(simulation)
2222
```
2323
![Plot against frequency](plot_simulation.png)
2424

25-
The above used an incident plane with the default position at [0.0, 0.0] and x direction to change these defaults use
25+
The above used an incident plane with the default position at [0.0, 0.0] and x direction. To change these defaults use:
2626
```julia
2727
x = [[-10.0,-10.0]]
2828
source = plane_source(Acoustic(1.0, 1.0, 2); direction = [1.0,1.0], position = [0.0,0.0]);
29-
simulation = run(particles, source, x, w_arr)
29+
simulation = run(particles, source, x, ωs)
3030
```
31-
then plot the response around the particles and receiver
31+
Then plot the response around the particles and receiver.
3232
```julia
33-
region = Box([[-11.;-11.], [6.;6.]])
34-
w = 3.2
35-
result = run(particles, source, region, [w]; res=80)
36-
plot(result, w; field_apply=abs, seriestype = :contour)
33+
region = Box([[-11.0;-11.0], [6.0;6.0]])
34+
ω = 3.2
35+
result = run(particles, source, region, [ω]; res=80)
36+
plot(result, ω; field_apply=abs, seriestype = :contour)
3737
```
3838
![Plot absolute value of wave field](plot_field.png)
3939

40-
the green circle in the plot is the receiver position. Looking at the region between the particles we see the complicated results of multiple scatttering.
40+
The green circle in the plot is the receiver position. Looking at the region between the particles we see the complicated results of multiple scatttering.

0 commit comments

Comments
 (0)