import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap import time # Copyright Daniel Harding - RomanAILabs # NOVA Field Equation Solver - Visualization of Entropic vs Phase Tension class NovaFieldEngine: def __init__(self, resolution=100): self.res = resolution # Setup the Manifold (Gamma Domain) # We model a 2D slice of the 5D spacetime for visualization self.sigma = np.linspace(-5, 5, self.res) self.tau = np.linspace(0, 10, self.res) self.SIGMA, self.TAU = np.meshgrid(self.sigma, self.tau) def compute_field(self, alpha=1.0, beta=1.0, decay_rate=0.5): """ Calculates F_NOVA based on the provided formula. """ print(f"--- Computing NOVA Field [Alpha: {alpha} | Beta: {beta}] ---") # --- TERM 1: DISSIPATIVE DECAY (Real) --- # Gamma function modeling entropy/friction over time (tau) # psi_dot and phi are modeled as interacting waves psi_dot = np.sin(self.SIGMA) * np.cos(self.TAU) phi = np.cos(self.SIGMA) # The integral of gamma over R (region) # We approximate the path integral as a cumulative decay gamma_integrand = np.abs(decay_rate * psi_dot * phi) # Integrate along the time axis (tau) decay_integral = np.cumsum(gamma_integrand, axis=0) term_1 = np.exp(-decay_integral) # --- TERM 2: OSCILLATORY PHASE (Complex) --- # Geometry (Gamma) and Momentum (Pi) vectors # Modeling them as orthogonal fields Gamma_vec = np.sin(2 * self.SIGMA + self.TAU) Pi_vec = np.cos(3 * self.SIGMA - self.TAU) lambda_val = 1.0 kappa = 0.8 # The complex argument phase_arg = (lambda_val * alpha * Gamma_vec) + (beta * kappa * Pi_vec) term_2 = np.exp(1j * phase_arg) # --- THE NOVA CALCULATION --- # F = Integral(Term1 - Term2) integrand = term_1 - term_2 # Integrate over Sigma (the manifold surface) # We sum along the spatial axis to get the net field strength F at each time step F_NOVA = np.trapz(integrand, self.sigma, axis=1) return self.tau, F_NOVA, term_1, term_2 def visualize(self, tau, F_NOVA, term1_grid, term2_grid): plt.style.use('dark_background') fig = plt.figure(figsize=(16, 10)) fig.suptitle("RomanAILabs: NOVA Field Equation Analysis", fontsize=16, color='#00ffcc') # 1. Field Interaction Map (Heatmap of the difference) ax1 = fig.add_subplot(2, 2, 1) # Creating a custom 'Cyber' colormap colors = [(0, 0, 0), (0.2, 0, 0.5), (0, 0.8, 1), (1, 1, 1)] cm = LinearSegmentedColormap.from_list('nova_cyber', colors, N=100) # We visualize the Magnitude of the difference before integration diff_magnitude = np.abs(term1_grid - term2_grid) im = ax1.imshow(diff_magnitude, extent=[-5, 5, 0, 10], aspect='auto', cmap=cm, origin='lower') ax1.set_title("Field Tension Map (Integrand Magnitude)") ax1.set_xlabel("Manifold Space ($\sigma$)") ax1.set_ylabel("Proper Time ($\\tau$)") plt.colorbar(im, ax=ax1) # 2. The Real vs Imaginary Components of F_NOVA ax2 = fig.add_subplot(2, 2, 2) ax2.plot(tau, F_NOVA.real, color='#ff0055', label='Real (Entropic Anchor)', linewidth=2) ax2.plot(tau, F_NOVA.imag, color='#00ffcc', label='Imag (Phase Velocity)', linewidth=2, linestyle='--') ax2.fill_between(tau, F_NOVA.real, alpha=0.1, color='#ff0055') ax2.set_title("F_NOVA Component Evolution") ax2.set_xlabel("Proper Time") ax2.grid(True, alpha=0.2) ax2.legend() # 3. Phase Space Trajectory (Real vs Imag) ax3 = fig.add_subplot(2, 2, 3) ax3.plot(F_NOVA.real, F_NOVA.imag, color='#eeeeee', linewidth=1) # Highlight start and end ax3.scatter(F_NOVA.real[0], F_NOVA.imag[0], color='lime', s=50, label='Start') ax3.scatter(F_NOVA.real[-1], F_NOVA.imag[-1], color='red', s=50, label='End') ax3.set_title("Phase Space Trajectory (The 'Signature')") ax3.set_xlabel("Real Component") ax3.set_ylabel("Imaginary Component") ax3.grid(True, alpha=0.2) ax3.legend() # 4. Total Field Strength (Absolute Energy) ax4 = fig.add_subplot(2, 2, 4) magnitude = np.abs(F_NOVA) ax4.plot(tau, magnitude, color='gold', linewidth=2) ax4.set_title("|F_NOVA| Total Field Strength") ax4.set_xlabel("Proper Time") ax4.grid(True, alpha=0.2) plt.tight_layout() plt.show() if __name__ == "__main__": # Initialize the engine engine = NovaFieldEngine(resolution=200) # Run the simulation with custom tuning # Alpha = Geometry weight, Beta = Momentum weight t, f_val, t1, t2 = engine.compute_field(alpha=1.2, beta=0.9, decay_rate=0.3) # Visualize engine.visualize(t, f_val, t1, t2) print("RomanAILabs NOVA Field Computation Complete.")