ddeint icon indicating copy to clipboard operation
ddeint copied to clipboard

Cannot Solve First Order Plus Delay Time(FOPDT)

Open Agnes159 opened this issue 4 years ago • 3 comments

Hi, I try to simulate FOPDT using ddeint. However, it doesn't work for me. May I have your advice on this?

My system is as shown:

dxdt = (-x(t)+Kp*u(t-d))/taup

where Kp = 1.0 ; d = 180 ; taup = 181 
x(0) = 0.0 and u is a step change from 0 to 0.3

model = lambda x,t,d,Kp,taup : (-x(t)+Kp*u(t-d))/taup
g = lambda t : 0

tt=np.linspace(0,1440,1000)
yy=ddeint(model,g,tt,fargs=(180,1.0,181))

plt.plot(tt,yy)

Agnes159 avatar Mar 23 '20 06:03 Agnes159

What's your error?

Zulko avatar Mar 23 '20 11:03 Zulko

TypeError: 'float' object is not callable ^ Above error is shown when I input value for 'u' where u is a step change from 0 to 0.3

Agnes159 avatar Mar 23 '20 16:03 Agnes159

Then, I try to input integer. It shows: TypeError: 'int' object is not callable

Agnes159 avatar Mar 23 '20 16:03 Agnes159