import numpy as np
import scipy.integrate as integrate
import scipy.special as special
import matplotlib.pyplot as plt
omega = 5
omega *= 2*np.pi
time = np.arange(0.0, 1, 0.0001)
amp = np.sin(omega * time)
Here I set upa time and create an omega for the needed sine wave. In this case the needed sine wave is sin(5 * 2 * PI * time elapsed).
Here I plot the sine wave sine where I get the correct results for said sine wave:
hello = plt.plot(amp)
plt.xlabel('time 10^-3')
plt.ylabel('Voltage')
plt.grid(True, which='both')
plt.axhline(y=0, color='k')
plt.show()
Next I attempt to integrate using special.sici which I believe allows you to integrate sin functions although I'm a little dubious on that notion
test = special.sici(amp)
Then I attempt to plot said newly created integrated function and I get a very strange and very wrong result
hello = plt.plot(test)
plt.xlabel('time 10^-3')
plt.ylabel('Voltage')
plt.grid(True, which='both')
plt.axhline(y=0, color='k')
plt.show()
I'm unsure if I am even beginning to go down the correct path of integrating a non standard sine wave (what I mean by non standard sine wave sin(2x),sin(2PIx)....etc) and if this is not the way to do it I would love to be pointed in the correct direction. Most of what I can find online only refers to integrating already provided standard and unaltered sine/cosin waves.
Here is the script unbroken and whole just in case you want to copy and paste it:
omega = 5
omega *= 2*np.pi
time = np.arange(0.0, 1, 0.0001)
amp = np.sin(omega * time)
hello = plt.plot(amp) # plot avethe sin w
plt.xlabel('time 10^-3')
plt.ylabel('Voltage')
plt.grid(True, which='both')
plt.axhline(y=0, color='k')
plt.show()
test = special.sici(amp)
hello = plt.plot(test)
plt.xlabel('time 10^-3')
plt.ylabel('Voltage')
plt.grid(True, which='both')
plt.axhline(y=0, color='k')
plt.show()