AmesimKnowledge

Simple examples > Temporal Analysis

Python script

Copy

import os
import pylab
import scipy
import numpy
import amesim

# Create a 1D map for SIGFXA01-1
os.chdir(r'c:\AMETest')
theta = [0, 10, 10.1, 180]
K = [100, 100, 1000, 1000]
K = list(scipy.pi/180.0*numpy.array(K))
amesim.fx2ame(theta,K,'varspringrate.data')
amesim.ameputp('scrdemo','SIGFXA01 instance 1 name of ASCII file','varspringrate.data')

# Running a the simulation and getting results
sim_opt = amesim.amegetsimopt('scrdemo')
sim_opt.startTime = 0.0
sim_opt.finalTime = 1.0
sim_opt.printInterval = 0.01
amesim.amerunsingle('scrdemo', sim_opt)

# Post-processing the results
Results, Varnames = amesim.ameloadvarst('scrdemo', {'MECRL0A_1 shaft angle at port 2 [degree]'})
print('Angle at time {:f} s is {:f} deg'.format(Results[0][-1], Results[1][-1]))
pylab.plot(Results[0], Results[1],'r')
pylab.show()

Figure 19: Angle at time 1 s is 0.11305 deg

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Scripting/xid1133456 · retrieved 2026-07-17