本文整理匯總了Python中siconos.kernel.TimeStepping.setComputeResiduY方法的典型用法代碼示例。如果您正苦於以下問題:Python TimeStepping.setComputeResiduY方法的具體用法?Python TimeStepping.setComputeResiduY怎麽用?Python TimeStepping.setComputeResiduY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類siconos.kernel.TimeStepping
的用法示例。
在下文中一共展示了TimeStepping.setComputeResiduY方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Model
# 需要導入模塊: from siconos.kernel import TimeStepping [as 別名]
# 或者: from siconos.kernel.TimeStepping import setComputeResiduY [as 別名]
filippov = Model(t0,T)
filippov.setNonSmoothDynamicalSystemPtr(myNSDS)
td = TimeDiscretisation(t0, h)
s = TimeStepping(td)
myIntegrator = EulerMoreauOSI(process, theta)
s.insertIntegrator(myIntegrator)
#TODO python <- SICONOS_RELAY_LEMKE
# access dparam
osnspb = Relay()
s.insertNonSmoothProblem(osnspb)
s.setComputeResiduY(True)
s.setComputeResiduR(True)
filippov.initialize(s);
# matrix to save data
dataPlot = empty((N+1,5))
control = empty((N+1,))
dataPlot[0, 0] = t0
dataPlot[0, 1:3] = process.x()
dataPlot[0, 3] = myProcessInteraction.lambda_(0)[0]
dataPlot[0, 4] = myProcessInteraction.lambda_(0)[1]
# time loop
k = 1
while(s.hasNextEvent()):
s.newtonSolve(1e-14, 30)