Crank–Nicolson method: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
No edit summary
en>UtzT
Line 1: Line 1:
{{Use British English|date=November 2011}}
Hi there! :) My name is Mariana, I'm a student studying Architecture from Scott Creek, Australia.<br><br>my weblog ... [http://korea.laviewddns.com/users.php?mode=profile&uid=24227 fifa 15 coin Hack]
{{Use dmy dates|date=November 2011}}
 
<!-- Deleted image removed: [[File:Simcos-initial.png|thumb|250px|Initial screen of SIMCOS]] -->
'''SIMCOS''' (an [[acronym]] standing for ''SIMulation of COntinuous Systems'') is a [[computer language]] and a [[Development environment (software development process)|development environment]] for [[computer simulation]]. In 1989 it was developed by [[Slovenians|Slovenian]] experts led by [[Borut Zupančič]].
 
==Properties==
The purpose of the language is [[simulation]] of dynamic [[mathematical model]]s of systems, given as set of [[ordinary differential equation]]s. It is an '''equation oriented''' and '''compiler type''' of language. Despite its name it can be used for [[discrete simulation]] as well. The language suits well to the [[CSSL'67]] [[standardisation|standard]] of simulation languages so portability among other languages conforming to the same standard (e.g. [[TUTSIM | Tutsim]], [[Advanced Continuous Simulation Language|ACSL]] etc.) is quite simple. It is a [[DOS]] based software occasionally it is slightly modified so it can be run under actual versions of [[Microsoft Windows]]. Apart from the simulation itself it can also perform [[parametrisation]] (a series of simulations with different values of [[parameter]]s), [[linearisation]] of models and [[Optimization (mathematics)|optimisation]] (finding such values of parameters that a criterion function is minimised).
 
==Simulation process==
When a simulation scheme must be prepared it must be described in the SIMCOS language. It can be "drawn" (similarly as with an [[analogue computer]]) using an enclosed block library graphics tool (it contains basic elements such as [[integrator]]s, [[amplifier]]s, [[summator]]s, some basic input [[signal (information theory)|signal]]s etc.) but more often it is entered as a program using one of text editors, e.g. Edit enclosed with DOS. Whichever form of entry of the model is used, the first phase of simulation reprocesses it into [[space of states]] form and rewrites the program into [[Fortran]] and prepares files with input parameters. This Fortran program is compiled into an executable file (.EXE) and executed. The executable program reads parameter values from input files, performs the simulation and writes requested calculated values into another file. When it terminates, SIMCOS takes control again and can display results as a graphic plot.
 
The "heart" of the executable is function INTEG which can solve [[differential equation]]s using one of several [[numerical method]]s. First it reads necessary values (e.g. values of parameters, initial conditions) from files then it calls the function DERIV where the model is actually described as series of functions of its [[derivative]]s. The returned values are used at the selected numerical method. Requested calculated results are written into the file and the whole procedure is repeated until the termination condition is satisfied.
 
==Example==
Continuous simulation of [[dead time]] (its [[Laplace transform]] is <math>e^{-sT}</math>) is not a trivial task and usually we use one of [[Padé approximation]]s. We will simulate Padé approximation of 2nd order
:<math>e^{-sT}\dot{=}\frac{(sT)^{2}-6sT+12}{(sT)^{2}+6sT+12}</math>
and 4th order:
:<math>e^{-sT}\dot{=}\frac{(sT)^{4}-20(sT)^{3}+180(sT)^{2}-840sT+1680}{(sT)^{4}+20(sT)^{3}+180(sT)^{2}+840sT+1680}.</math>
Input signal is a unit step, communication interval equals 0.01s, length simulation run is 5s, results will be compared with output of built-in discrete function ''delay'' (it requires additional array (''del'' in our case) of appropriate size).
 
''y1'' is a result of simulation of Padé approximation of 2nd order, ''y2'' is a result of simulation of Padé approximation of 4th order and ''y3'' is result of the discrete function ''delay''.
 
When [[transfer function]]s of both Padé approximation are developed using one of simulation schemes, the model can be described with the following program:
 
<pre>
program pade
constant tm=1.0
constant tfin=5
array del(101)
variable t=0.0
u=step(t,0.)
 
u11d=12/(tm*tm)*u-12/(tm*tm)*y1
u11=integ(u11d,0.)
u21d=u11-u*6/tm-y1*6/tm
u21=integ(u21d,0.)
y1=u21+u
u12d=u*1680/(tm*tm*tm*tm)-y2*1680/(tm*tm*tm*tm)
u12=integ(u12d,0.)
u22d=u12-u*840/(tm*tm*tm)-y2*840/(tm*tm*tm)
u22=integ(u22d,0.)
u32d=u22+u*180/(tm*tm)-y2*180/(tm*tm)
u32=integ(u32d,0.)
u42d=u32-u*20/tm-y2*20*tm
u42=integ(u42d,0.)
y2=u42+u
y3=delay(u,tm,#del,ci)
 
cinterval ci=0.01
hdr Pade approximation of dead time
prepar y1,y2,y3
output 10,y1,y2,y3
termt(t.ge.tfin)
 
end
</pre>
 
<!-- Deleted image removed: [[File:Simcos-results.png|thumb|300px|Graphical display of results]] -->
After the simulation run is finished the results can be displayed as plots. It is possible to trace values of plots, select which plots to display, turning on a grid, zoom etc.  
 
==References==
{{refbegin}}
In [[Slovenian language]]:
* Borut Zupančič (with contributions by [[Rihard Karba]] and [[Drago Matko]]), ''Simulacija dinamičnih sistemov'', Založba FER, Ljubljana, 1995, ISBN 86-7739-078-2
* Borut Zupančič, ''SIMCOS – jezik za simulacijo zveznih in diskretnih dinamičnih sistemov'', Založba FER, Ljubljana, 1992, ISBN 86-7739-016-2
{{refend}}
 
==External links==
* [http://msc.fe.uni-lj.si/Staff.asp?person=2 Borut Zupančič's homepage]
* [http://msc.fe.uni-lj.si/Download.asp LMSC download page] (the link to SIMCOS is at the bottom)
 
[[Category:Simulation programming languages]]

Revision as of 12:52, 4 March 2014

Hi there! :) My name is Mariana, I'm a student studying Architecture from Scott Creek, Australia.

my weblog ... fifa 15 coin Hack