importnumpyasnpfromscipy.integrateimportsolve_ivpimportpandasaspdimportmatplotlib.pyplotasplt# Define parametersa=0.2;b=0.2;c=1p={'a':a,'b':b,'c':c}tfin=100npts=10*tfintime=np.linspace(0,tfin,npts)# Define the right-hand side of the differential equationdefrhs(t,w):x,y,z=wreturnnp.array([-y-z,x+p['a']*y,p['b']+z*(x-p['c'])])# Initial conditionw0=[1,1,1]# Solve differential equationsol=solve_ivp(lambdat,w:rhs(t,w),[0,tfin],w0,t_eval=time,method='BDF')# Drop the transient parttransient=round(0.8*npts)w=sol.y[:,transient:].T# Save results in readable .dat formatwithopen("rosslercycle.dat","w")asf:np.savetxt(f,w,fmt='%f',header="State Variables of Rossler Attractor")# Plot configuration and showing plot only in interactive modeplt.figure()plt.plot(w)plt.title('Rossler Attractor')plt.xlabel('Time')plt.ylabel('State Variables')plt.show(block=False)