Skip to content

Commit

Permalink
fix formatting issue in nonlinear pde operator
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuan-zhang committed Feb 1, 2024
1 parent 111885b commit 89c467c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions controlgym/envs/allen_cahn.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ def fourier_nonlinear_op(state_fourier, action):
)
right_hand_side = -self.potential_constant * (1 / aa_factor) * np.fft.rfft(
aa_state ** 3
)[0 : int(self.n_state / 2) + 1]
+ (np.fft.rfft(self.control_sup, axis=0) @ action)
)[0 : int(self.n_state / 2) + 1] + (np.fft.rfft(self.control_sup, axis=0) @ action)
return right_hand_side
return fourier_nonlinear_op

Expand Down
3 changes: 1 addition & 2 deletions controlgym/envs/burgers.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ def fourier_nonlinear_op(state_fourier, action):
* self.domain_wavenumbers
* (1 / aa_factor)
* np.fft.rfft(aa_state**2)[0 : int(self.n_state / 2) + 1]
)
+(np.fft.rfft(self.control_sup, axis=0) @ action)
) + (np.fft.rfft(self.control_sup, axis=0) @ action)
return right_hand_side

return fourier_nonlinear_op
Expand Down
3 changes: 1 addition & 2 deletions controlgym/envs/cahn_hilliard.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ def fourier_nonlinear_op(state_fourier, action):
* self.domain_wavenumbers**2
* (1 / aa_factor)
* np.fft.rfft(aa_state**3)[0 : int(self.n_state / 2) + 1]
)
+(np.fft.rfft(self.control_sup, axis=0) @ action)
) + (np.fft.rfft(self.control_sup, axis=0) @ action)
return right_hand_side

return fourier_nonlinear_op
Expand Down
3 changes: 1 addition & 2 deletions controlgym/envs/fisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ def fourier_nonlinear_op(state_fourier, action):
self.reaction_constant
* (1 / aa_factor)
* np.fft.rfft(aa_state * (1 - aa_state))[0 : int(self.n_state / 2) + 1]
)
+(np.fft.rfft(self.control_sup, axis=0) @ action)
) + (np.fft.rfft(self.control_sup, axis=0) @ action)
return right_hand_side

return fourier_nonlinear_op
Expand Down
3 changes: 1 addition & 2 deletions controlgym/envs/ginzburg_landau.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ def fourier_nonlinear_op(state_fourier, action):
right_hand_side = (
-(1 / aa_factor)
* np.fft.rfft(aa_state**3)[0 : int(self.n_state / 2) + 1]
)
+(np.fft.rfft(self.control_sup, axis=0) @ action)
) + (np.fft.rfft(self.control_sup, axis=0) @ action)
return right_hand_side

return fourier_nonlinear_op
3 changes: 1 addition & 2 deletions controlgym/envs/korteweg_de_vries.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ def fourier_nonlinear_op(state_fourier, action):
* self.domain_wavenumbers
* (1 / aa_factor)
* np.fft.rfft(aa_state**2)[0 : int(self.n_state / 2) + 1]
)
+(np.fft.rfft(self.control_sup, axis=0) @ action)
) + (np.fft.rfft(self.control_sup, axis=0) @ action)
return right_hand_side

return fourier_nonlinear_op
3 changes: 1 addition & 2 deletions controlgym/envs/kuramoto_sivashinsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ def fourier_nonlinear_op(state_fourier, action):
* self.domain_wavenumbers
* (1 / aa_factor)
* np.fft.rfft(aa_state**2)[0 : int(self.n_state / 2) + 1]
)
+(np.fft.rfft(self.control_sup, axis=0) @ action)
) + (np.fft.rfft(self.control_sup, axis=0) @ action)
return right_hand_side

return fourier_nonlinear_op

0 comments on commit 89c467c

Please sign in to comment.