@@ -34,43 +34,43 @@ prob_femheat_diffuse = HeatProblem(analytic_diffuse,Du,f)
34
34
35
35
36
36
f = (t,x) -> zeros (size (x,1 ))
37
- u₀ = (x) -> float ((abs .(x[:,1 ]- .5 ) .< 1e-6 ) & (abs .(x[:,2 ]- .5 ) .< 1e-6 )) # Only mass at middle of (0,1)^2
37
+ u0 = (x) -> float ((abs .(x[:,1 ]- .5 ) .< 1e-6 ) & (abs .(x[:,2 ]- .5 ) .< 1e-6 )) # Only mass at middle of (0,1)^2
38
38
"""
39
39
Example problem which starts with a Dirac δ cenetered at (0.5,0.5) and solves with ``f=gD=0``.
40
40
This gives the Green's function solution.
41
41
"""
42
- prob_femheat_pure = HeatProblem (u₀ ,f)
42
+ prob_femheat_pure = HeatProblem (u0 ,f)
43
43
44
44
45
45
f = (t,x,u) -> ones (size (x,1 )) - .5 u
46
- u₀ = (x) -> zeros (size (x,1 ))
46
+ u0 = (x) -> zeros (size (x,1 ))
47
47
"""
48
48
Homogenous reaction-diffusion problem which starts with 0 and solves with ``f(u)=1-u/2``
49
49
"""
50
- prob_femheat_birthdeath = HeatProblem (u₀ ,f)
50
+ prob_femheat_birthdeath = HeatProblem (u0 ,f)
51
51
52
52
53
53
f = (t,x,u) -> [ones (size (x,1 ))- .5 u[:,1 ] ones (size (x,1 ))- u[:,2 ]]
54
- u₀ = (x) -> ones (size (x,1 ),2 ).* [.5 .5 ] # size (x,2), 2 meaning 2 variables
54
+ u0 = (x) -> ones (size (x,1 ),2 ).* [.5 .5 ] # size (x,2), 2 meaning 2 variables
55
55
"""
56
56
Homogenous reaction-diffusion which starts at 1/2 and solves the system ``f(u)=1-u/2`` and ``f(v)=1-v``
57
57
"""
58
- prob_femheat_birthdeathsystem = HeatProblem (u₀ ,f)
58
+ prob_femheat_birthdeathsystem = HeatProblem (u0 ,f)
59
59
60
60
f = (t,x,u) -> [zeros (size (x,1 )) zeros (size (x,1 ))]
61
- u₀ = (x) -> [float ((abs .(x[:,1 ]- .5 ) .< 1e-6 ) & (abs .(x[:,2 ]- .5 ) .< 1e-6 )) float ((abs .(x[:,1 ]- .5 ) .< 1e-6 ) & (abs .(x[:,2 ]- .5 ) .< 1e-6 ))] # size (x,2), 2 meaning 2 variables
61
+ u0 = (x) -> [float ((abs .(x[:,1 ]- .5 ) .< 1e-6 ) & (abs .(x[:,2 ]- .5 ) .< 1e-6 )) float ((abs .(x[:,1 ]- .5 ) .< 1e-6 ) & (abs .(x[:,2 ]- .5 ) .< 1e-6 ))] # size (x,2), 2 meaning 2 variables
62
62
"""
63
63
Example problem which solves the homogeneous Heat equation with all mass starting at (1/2,1/2) with two different diffusion constants,
64
64
``D₁=0.01`` and ``D₂=0.001``. Good animation test.
65
65
"""
66
- prob_femheat_diffusionconstants = HeatProblem (u₀ ,f,D= [.01 .001 ])
66
+ prob_femheat_diffusionconstants = HeatProblem (u0 ,f,D= [.01 .001 ])
67
67
68
68
f = (t,x,u) -> [ones (size (x,1 ))- .5 u[:,1 ] .5 u[:,1 ]- u[:,2 ]]
69
- u₀ = (x) -> ones (size (x,1 ),2 ).* [.5 .5 ] # size (x,2), 2 meaning 2 variables
69
+ u0 = (x) -> ones (size (x,1 ),2 ).* [.5 .5 ] # size (x,2), 2 meaning 2 variables
70
70
"""
71
71
Homogenous reaction-diffusion which starts with 1/2 and solves the system ``f(u)=1-u/2`` and ``f(v)=.5u-v``
72
72
"""
73
- prob_femheat_birthdeathinteractingsystem = HeatProblem (u₀ ,f)
73
+ prob_femheat_birthdeathinteractingsystem = HeatProblem (u0 ,f)
74
74
75
75
"""
76
76
`heatProblemExample_grayscott(;ρ=.03,k=.062,D=[1e-3 .5e-3])`
@@ -89,9 +89,9 @@ function heatProblemExample_grayscott(;ρ=.03,k=.062,D=[1e-3 .5e-3])
89
89
f₁ (t,x,u) = u[:,1 ]. * u[:,2 ]. * u[:,2 ] + ρ* (1 - u[:,2 ])
90
90
f₂ (t,x,u) = u[:,1 ]. * u[:,2 ]. * u[:,2 ] - (ρ+ k). * u[:,2 ]
91
91
f (t,x,u) = [f₁ (t,x,u) f₂ (t,x,u)]
92
- u₀ (x) = [ones (size (x,1 ))+ rand (size (x,1 )) .25. * float (((.2. < x[:,1 ]. < .6 ) &
92
+ u0 (x) = [ones (size (x,1 ))+ rand (size (x,1 )) .25. * float (((.2. < x[:,1 ]. < .6 ) &
93
93
(.2. < x[:,2 ]. < .6 )) | ((.85. < x[:,1 ]) & (.85. < x[:,2 ])))] # size (x,2), 2 meaning 2 variables
94
- return (HeatProblem (u₀ ,f,D= D))
94
+ return (HeatProblem (u0 ,f,D= D))
95
95
end
96
96
97
97
"""
@@ -124,18 +124,18 @@ function heatProblemExample_gierermeinhardt(;a=1,α=1,D=[0.01 1.0],ubar=1,vbar=0
124
124
f (t,x,u) = [f₁ (t,x,u) f₂ (t,x,u)]
125
125
uss = (ubar + β)/ α
126
126
vss = (α/ β)* uss.^ 2
127
- u₀ (x) = [uss* ones (size (x,1 ))+ startNoise* rand (size (x,1 )) vss* ones (size (x,1 ))] # size (x,2), 2 meaning 2 variables
128
- return (HeatProblem (u₀ ,f,D= D))
127
+ u0 (x) = [uss* ones (size (x,1 ))+ startNoise* rand (size (x,1 )) vss* ones (size (x,1 ))] # size (x,2), 2 meaning 2 variables
128
+ return (HeatProblem (u0 ,f,D= D))
129
129
end
130
130
131
131
f = (t,x,u) -> ones (size (x,1 )) - .5 u
132
- u₀ = (x) -> zeros (size (x,1 ))
132
+ u0 = (x) -> zeros (size (x,1 ))
133
133
σ = (t,x,u) -> 1 u.^ 2
134
134
"""
135
135
Homogenous stochastic reaction-diffusion problem which starts with 0
136
136
and solves with ``f(u)=1-u/2`` with noise ``σ(u)=10u^2``
137
137
"""
138
- prob_femheat_stochasticbirthdeath = HeatProblem (u₀ ,f,σ= σ)
138
+ prob_femheat_stochasticbirthdeath = HeatProblem (u0 ,f,σ= σ)
139
139
140
140
# # Poisson
141
141
@@ -163,21 +163,21 @@ with the same ``f``.
163
163
prob_poisson_birthdeath = PoissonProblem (f,numvars= 1 )
164
164
165
165
f = (x,u) -> [ones (size (x,1 ))- .5 u[:,1 ] ones (size (x,1 ))- u[:,2 ]]
166
- u₀ = (x) -> .5 * ones (size (x,1 ),2 ) # size (x,2), 2 meaning 2 variables
166
+ u0 = (x) -> .5 * ones (size (x,1 ),2 ) # size (x,2), 2 meaning 2 variables
167
167
168
168
"""
169
169
Nonlinear Poisson equation with ``f(u)=1-u/2`` and ``f(v)=1-v`` and initial
170
170
condition homogenous 1/2. Corresponds to the steady state of a humogenous
171
171
reaction-diffusion equation with the same ``f``.
172
172
"""
173
- prob_poisson_birthdeathsystem = PoissonProblem (f,u₀ = u₀ )
173
+ prob_poisson_birthdeathsystem = PoissonProblem (f,u0 = u0 )
174
174
175
175
f = (x,u) -> [ones (size (x,1 ))- .5 u[:,1 ] .5 u[:,1 ]- u[:,2 ]]
176
- u₀ = (x) -> ones (size (x,1 ),2 ).* [.5 .5 ] # size (x,2), 2 meaning 2 variables
176
+ u0 = (x) -> ones (size (x,1 ),2 ).* [.5 .5 ] # size (x,2), 2 meaning 2 variables
177
177
178
178
"""
179
179
Nonlinear Poisson equation with ``f(u)=1-u/2`` and ``f(v)=.5u-v`` and initial
180
180
condition homogenous 1/2. Corresponds to the steady state of a humogenous
181
181
reaction-diffusion equation with the same ``f``.
182
182
"""
183
- prob_poisson_birthdeathinteractingsystem = PoissonProblem (f,u₀ = u₀ )
183
+ prob_poisson_birthdeathinteractingsystem = PoissonProblem (f,u0 = u0 )
0 commit comments