fork download
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. from mpl_toolkits.mplot3d import Axes3D
  4.  
  5. # Define the parameters of the Complex Intuitionistic Fuzzy Number (CIFN)
  6. # Membership function: μ(z) = e^(-|z|^2)
  7. # Non-membership function: ν(z) = 1 - e^(-|z|^2)
  8.  
  9. # Create a grid for the complex plane
  10. real = np.linspace(-2, 2, 100)
  11. imag = np.linspace(-2, 2, 100)
  12. real_grid, imag_grid = np.meshgrid(real, imag)
  13. z = real_grid + 1j * imag_grid # Complex numbers grid
  14.  
  15. # Define the membership and non-membership functions
  16. membership = np.exp(-np.abs(z)**2) # Membership function
  17. non_membership = 1 - np.exp(-np.abs(z)**2) # Non-membership function
  18.  
  19. # Plot the 3D visualization
  20. fig = plt.figure(figsize=(14, 7))
  21.  
  22. # Membership function surface
  23. ax1 = fig.add_subplot(121, projection='3d')
  24. ax1.plot_surface(real_grid, imag_grid, membership, cmap='viridis', edgecolor='k')
  25. ax1.set_title("Membership Function μ(z)", fontsize=14)
  26. ax1.set_xlabel("Re(z)")
  27. ax1.set_ylabel("Im(z)")
  28. ax1.set_zlabel("μ(z)")
  29.  
  30. # Non-membership function surface
  31. ax2 = fig.add_subplot(122, projection='3d')
  32. ax2.plot_surface(real_grid, imag_grid, non_membership, cmap='plasma', edgecolor='k')
  33. ax2.set_title("Non-Membership Function ν(z)", fontsize=14)
  34. ax2.set_xlabel("Re(z)")
  35. ax2.set_ylabel("Im(z)")
  36. ax2.set_zlabel("ν(z)")
  37.  
  38. plt.tight_layout()
  39. plt.show()
  40.  
Success #stdin #stdout 2.52s 65528KB
stdin
Standard input is empty
stdout
Standard output is empty