Created
September 29, 2025 07:11
-
-
Save kumanna/ff1b0d339ce6ca9edc4f01869e24b6d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| M = 4 | |
| p = 2 | |
| beta = 1 | |
| c = p * M + beta | |
| C = np.array([-3 / 4, -1 / 4, 1 / 4, 3 / 4]) * c | |
| C_new = np.zeros_like(C) | |
| L = 1 | |
| for i, v in enumerate(C): | |
| C_new[i] = C[i] | |
| while C_new[i] > L: | |
| C_new[i] -= 2 * L | |
| while C_new[i] < -L: | |
| C_new[i] += 2 * L | |
| print(C_new) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment