Upload 2611_252_159 (1).py
Browse files- 2611_252_159 (1).py +48 -0
2611_252_159 (1).py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""2611.252.159
|
| 3 |
+
|
| 4 |
+
Automatically generated by Colab.
|
| 5 |
+
|
| 6 |
+
Original file is located at
|
| 7 |
+
https://colab.research.google.com/drive/1LGQw7JHuJXozxi_BMJx2bxTZfAnM96ff
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
import torch
|
| 11 |
+
import matplotlib.pyplot as plt
|
| 12 |
+
import numpy as np
|
| 13 |
+
|
| 14 |
+
# Define parameters for the base wave
|
| 15 |
+
time = torch.linspace(0, 10, steps=1000) # Time vector
|
| 16 |
+
frequency = 2 # Base frequency of the wave
|
| 17 |
+
amplitude = 5 # Base amplitude of the wave
|
| 18 |
+
phase_shift = torch.pi / 4 # Phase shift
|
| 19 |
+
|
| 20 |
+
# Generate the base sine wave
|
| 21 |
+
base_wave = amplitude * torch.sin(2 * torch.pi * frequency * time + phase_shift)
|
| 22 |
+
|
| 23 |
+
# Add some complexity by combining additional sine waves
|
| 24 |
+
wave2 = (amplitude / 2) * torch.sin(4 * torch.pi * frequency * time + phase_shift / 2)
|
| 25 |
+
wave3 = (amplitude / 3) * torch.sin(6 * torch.pi * frequency * time + phase_shift / 3)
|
| 26 |
+
|
| 27 |
+
# Combine the waves to create a "wealthy" base pattern
|
| 28 |
+
wealthy_wave = base_wave + wave2 + wave3
|
| 29 |
+
|
| 30 |
+
# Introduce unpredictability by adding random noise
|
| 31 |
+
noise = torch.randn_like(time) * 0.5 # Random noise with small amplitude
|
| 32 |
+
|
| 33 |
+
# Combine the wealthy wave with noise to create unpredictability
|
| 34 |
+
unpredictable_wealthy_wave = wealthy_wave + noise
|
| 35 |
+
|
| 36 |
+
# Convert to numpy for easier plotting
|
| 37 |
+
time_np = time.numpy()
|
| 38 |
+
unpredictable_wealthy_wave_np = unpredictable_wealthy_wave.numpy()
|
| 39 |
+
|
| 40 |
+
# Plot the unpredictable wealthy wave pattern
|
| 41 |
+
plt.figure(figsize=(10, 5))
|
| 42 |
+
plt.plot(time_np, unpredictable_wealthy_wave_np, label='Unpredictable Wealthy Wave Pattern')
|
| 43 |
+
plt.title('.159 Wealthy Patterns')
|
| 44 |
+
plt.xlabel('Time')
|
| 45 |
+
plt.ylabel('Amplitude')
|
| 46 |
+
plt.legend()
|
| 47 |
+
plt.grid(True)
|
| 48 |
+
plt.show()
|