<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1708" rel="nofollow">http://projects.scipy.org/scipy/ticket/1708</a> on 2012-07-24 by trac user jgarc063, assigned to unknown.</em></p>
<p dir="auto">First system info:<br>
Ubuntu 10.04<br>
Python 3.1.2<br>
Scipy 0.9.0<br>
Matplotlib 1.1.0(unofficial version ported through a sprint)</p>
<p dir="auto">In the code below I've seperated the offending section. In the section shown variable alpha is set to 3_10^4 and the code works giving the expected responsed of an RLC circuit. However if I alternatively set alpha to 30000 the response returned by odeint is incorrect. Additionally if I set alpha to 3.2_10^4 the script won't even run. I also tried 3e4 and that doesnt give the proper results either.</p>
<p dir="auto">Thank you for your consideration.</p>
<p dir="auto">Best Regards,<br>
Jorge Garcia</p>
<hr>
<p dir="auto">import numpy as np<br>
import math as m<br>
import matplotlib.pyplot as plt<br>
from scipy.integrate import odeint</p>
<h1 dir="auto">Differential equation values</h1>
<p dir="auto">w02 = 16_10^8      #Resonant Frequency a little over 10hz<br>
alpha = 5_10^4       #Neper Frequency adjusted for each graph<br>
I = 0.024           #Source Current</p>
<h1 dir="auto">Solve system of equations dy/dt = f(y,t)</h1>
<p dir="auto">def f(y, t):<br>
x2i = y[0]<br>
x1i = y[1]<br>
#Model equation<br>
x2prime = w02_(I-x1i)-2_alpha*x2i<br>
x1prime = x2i<br>
return [x2prime, x1prime]</p>
<h1 dir="auto">initial conditions</h1>
<p dir="auto">x20 = 0<br>
x10 = 0<br>
y0 = [x20, x10] #initial condition vector<br>
t = np.linspace(0, 5, 10000)</p>
<h1 dir="auto">plot results</h1>
<p dir="auto">plt.figure<br>
plt.title('Current Step Response')</p>
<h1 dir="auto">solve the ODEs</h1>
<p dir="auto">soln = odeint(f, y0, t)<br>
V = soln[:, 1]<br>
plt.plot(t, V, label='overdamped')</p>
<h1 dir="auto">----------------------------------------- LOOK HERE</h1>
<p dir="auto">alpha = 3*10^4<br>
soln = odeint(f, y0, t)<br>
V = soln[:, 1]<br>
plt.plot(t, V, label='underdamped')</p>
<h1 dir="auto">----------------------------------------- LOOK HERE</h1>
<p dir="auto">alpha = 4*10^4<br>
soln = odeint(f, y0, t)<br>
V = soln[:, 1]<br>
plt.plot(t, V, label='critically damped')</p>
<p dir="auto">g=[]<br>
for element in t:<br>
g.append(I*0.9)</p>
<p dir="auto">plt.plot(t, g, label='90% value')</p>
<p dir="auto">plt.legend(loc=0)<br>
plt.xlabel('Time(100us)')<br>
plt.ylabel('Current(mA)')</p>
<p dir="auto">plt.grid(True)</p>
<p dir="auto">plt.show()</p>
<hr>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1709" rel="nofollow">http://projects.scipy.org/scipy/ticket/1709</a> on 2012-07-24 by trac user jgarc063, assigned to unknown.</em></p>
<p dir="auto">First system info:<br>
Ubuntu 10.04<br>
Python 3.1.2<br>
Scipy 0.9.0<br>
Matplotlib 1.1.0(unofficial version ported through a sprint)</p>
<p dir="auto">In the code attached I've seperated the offending section. In the section shown variable alpha is set to 3_10^4 and the code works giving the expected responsed of an RLC circuit. However if I alternatively set alpha to 30000 the response returned by odeint is incorrect. Additionally if I set alpha to 3.2_10^4 the script won't even run. I also tried 3e4 and that doesnt give the proper results either.</p>
<p dir="auto">Thank you for your consideration.</p>
<p dir="auto">Best Regards,<br>
Jorge Garcia</p>