0% found this document useful (0 votes)
14 views

Gecko-Research Scripting Tutorial

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Gecko-Research Scripting Tutorial

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 21

Script-based Simulation Control using GeckoSCRIPT

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

GeckoCIRCUITS is a powerful circuit simu-


lator optimized for power electronics. Its In this tutorial, we will show the functionality
library offers the user a large number of of the GeckoSCRIPT tool through the example
circuit, control and thermal components for of tuning a controller for a buck converter. We
modeling power electronic systems. The user will also show how to use the GeckoSCRIPT
must properly set element parameters such as functions to allow scrip-based control of
on-resistance, forward voltage, controller GeckoCIRCUITS from MATLAB.
coefficients, inductance, or thermal capacity in
order to model a system accurately.

There is a wide range of problems – e.g.


optimizations for efficiency or controller
tuning – for which the user must simulate,
change some element parameters, resimulate,
and so on until a desired solution is found. As
of version 1.4, GeckoCIRCUITS provides a
way of automating such a process.

Introduction

GeckoSCRIPT is a tool within Gecko-


CIRCUITS which allows for script-based
simulation control. Via the GeckoSCRIPT
tool, the user can write and execute a script in
the Java programming language, using
specially provided functions for manipulating
the model parameters and simulation inside
GeckoCIRCUITS, as well as the full Java API.

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

To open the GeckoSCRIPT tool, start Gecko- The top field, Imports, allows you to import
CIRCUITS, and click on the GECKO menu any Java class or package for use within your
(furthest to the right on the menu bar). There script (e.g. java.util). Therefore the entire Java
you will find a menu item called API is available for use.
GeckoSCRIPT.

The middle field, field declarations, allows


you to define and initialize variables for use in
your script.

This will open the scripting environment:

The text field public void runScript() at the


bottom is where you write the code for your
script.

All coding is done in the Java programming


language and correct Java syntax must be
Users already familiar with GeckoCIRCUITS used.
will note the similarity with the Java block
interface. There are four tabs at the top of the
window, with the ‘Code’ tab opened by
default. There are white editable text fields
which comprise the GeckoSCRIPT code
editor. Getting Started
GeckoCIRCUITS version 1.4 or later is
required

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

The grey non-editable upper-right window To simplify the writing of scripts, Gecko-
lists the GeckoSCRIPT-specific functions SCRIPT provides a listing of all blocks
which are available for modifying the available in a model, their names, and for each
parameters of an element of a model and for type of block, the accessible parameters and
controlling the execution of the simulation of outputs, along with their description. To show
the model. A detailed description of each this listing, click on the Available Blocks
function with a simple example of its use is button. As our model is currently blank, the
available by clicking on the Details button. list is empty.

GeckoSCRIPT functions work by operating on


element and parameter names, which must be
passed to the functions as Java Strings (i.e.
enclosed by “”). The names of circuit and
thermal elements are visible in
GeckoCIRCUITS in the schematic window,
and in the parameter setting dialog box that
appears when elements are clicked on. Names
of control elements are visible in the parameter
dialog box. The names of the parameters used
by GeckoSCRIPT are mostly identical to the
names of the parameters used in the dialog
boxes.

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

Now, go back to the GeckoCIRCUITS main Click the ‘Refresh’ button again. You will see
window, and construct a simple RC circuit a list of output names and their description.
schematic:

Then return to the Available Blocks window


and click the Refresh button. You will now
notice the two circuit elements listed, with the
names of their accessible parameters and their
descriptions.

When accessing and modifying the parameters


of the blocks in the model using the
GeckoSCRIPT functions, you must use the
names listed here.

For control elements (which include the


measurement blocks, e.g. voltmeters and
amperemeters), the outputs of the block are
also accessible. Accessing control element
outputs is the means by which simulation
results are extracted from the model through
GeckoSCRIPT. SCOPEs are not accessible via
GeckoSCRIPT.

Getting started
To see a listing of available
GeckoSCRIPT-specific outputs,
functions foradd a
voltage measurement
manipulating blockand
model blocks to the model (e.g.
controlling
measuring the
the simulation voltage across the resistor).

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

Now let’s write a simple script and try to


compile it. In the script code field, enter the
following code:

setParameter("R.1","R",50);
setParameter("C.1","C",1e-6);
writeOutputLn("Hello World!");

The setParameter function changes the


parameter of an element. From the list we
looked at previously, we can see than the
resistor’s name is R.1, and that the parameter
denoting resistance is named R. So we use
these as the arguments to the function, along
with the value of the resistance we wish to set.
The lower text field displays messages from
The same is done for the capacitor and its
the compiler. If your code is free of syntax
capacitance.
errors, you will receive a message that the
compilation has been successful. Otherwise,
The writeOutputLn function is provided in
the errors from the compiler will be displayed
order to write any sort of output you may want
along with line numbers where the errors are
to the Script Output tab. You can also write
found. For the line numbers, refer to the upper
any output you like to a file by using the file
text field displaying the full code.
I/O classes provided by the Java API.

Now click on the Compile Code button. You


will notice that the GeckoSCRIPT window
automatically switches to the Compiler Output
tab. This tab contains two text fields. On top is
the full Java code that is compiled.
GeckoSCRIPT creates a custom class, along
with the imports and field declarations
specified by the user, with a runScript()
method that executes the user-specified script.

Getting started Writing a simple script


The list of block, parameter, and output names The setParameter(…) function
that is used to modify the model The writeOutputLn(…) function
Compiler output and messages

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

Now let’s run the simple script written


previously. Click on the Run button. You will
notice that the GeckoSCRIPT window
automatically switches to the Script Output
tab. This is where any output written using the
writeOutput or the writeOutputLn functions
will be displayed. The text field under this tab
now displays the phrase Hello World!, as was
specified in the script. Please go back to the
GeckoCIRCUITS main window. You will
notice that the resistor and capacitor parameter
values have been changed to those specified in
the script. GeckoSCRIPT has performed as
instructed.

You will notice there is also a Help tab. It


displays some basic information about
GeckoSCRIPT. Now, click Close Window to
close the GeckoSCRIPT window. Any code
you write is saved along with the model.

Now that you have familiarized yourself with


the GeckoSCRIPT environment, we will
demonstrate its functionality using a simple
example where the controller parameters for a Running a simple script
buck converter are tuned to achieve a stable GeckoSCRIPT output
voltage regulation. Check parameter values have changed

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

and the period of this oscillation, denoted Tu,


are then used to calculate the three
PID controller coefficients – the proportional
gain Kp, integral gain Ki and differential gain
Kd.

Included with this tutorial is a file called Now this of course can be done by the user
buck_control.ipes Open this model in Gecko- manually: simulate, increase the proportional
CIRCUITS. gain in the model’s PI block, simulate, and
It contains a circuit with a simple Buck repeat until Ku and Tu are found. A much
converter, together with a control loop more convenient and faster way to do it is to
modelling a PID controller using the PI and use GeckoSCRIPT.
PD control blocks available in Gecko-
CIRCUITS. The proportional gain is set to 1, To facilitate this, a Java block is included in
and the integral and differential gains to zero, the model that monitors the output voltage,
i.e. the loop is uncompensated. Via the and determines whether it oscillates and
constant block, the output reference is set to 6 constant frequency and amplitude. The outputs
V, and the input voltage is 12 V. If you run the of the Java block are the amplitude of
simulation and open the uppermost SCOPE oscillation, a digital signal indicating (1/0 i.e.
showing the output voltage, you will see the true/false) whether the amplitude is constant,
output voltage is 3 V. Therefore, a proper the period of oscillation and a digital signal
controller giving required output voltage indicating whether the period is constant.
regulation must be designed.

A common approach to PID controller tuning


is the Ziegler-Nichols method. In this method,
with the other gains set to zero, the
proportional gain is increased until the output
of the control loop – in this case the output
voltage of the converter – oscillates at a
constant frequency and amplitude. This
ultimate gain, denoted Ku,

Controller tuning example


Open buck converter model
Ziegler-Nichols tuning procedure

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

Now open GeckoSCRIPT. A script imple- filter are set, the output voltage reference, and
menting the Ziegler-Nichols algorithm has the initial PID coefficents.
already been included with the model.

On line 5 we set the switching frequency of


the converter, by setting the frequency
parameter of the signal generator block that
creates a sawtooth waveform used to generate
In the field declarations we have declared all a pulse-width modulated signal for the
the variables we need for the algorithm: the converter main switch.
PID controller coefficients, the ultimate gain
and period, Boolean flags for whether the
amplitude and frequency are constant, and a
flag that tells us when to stop searching.

Now click the Available Blocks button. You


will then see a listing of all the circuit and
control blocks in the circuit by type and name,
their accessible parameter names along with
the parameter descriptions, and their accessible
outputs (for control blocks).
The first part of the script code initializes the
most important model values. Using the Controller tuning example
setParameter function, the inductance and Script written for the Ziegler-Nichols tuning
capacitance values of the converter output LC algorithm

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

The following code increases the proportional In the next part of the code, if the amplitude
gain in a loop while running the simulation and period of oscillation are indeed constant,
and checking whether Ku has been found. we retrieve the observed period of oscillation
Tu from the simulation – in this case output
“2” of the Java block – and the ultimate gain
Ku, which is parameter “r0” of the PI control
block.

We use a standard Java while loop, and after


displaying a short message, we call the
runSimulation() function in line 19. Calling
this function executes the simulation according
to the parameters (step-width and end-time)
specified in the simulation configuration
dialog accessible via the Simulation ->
Parameter menu. The getParameter function allows us to
In this dialog, you are able to define para- do this, by specifying the block and parameter
meters as start- and end-times of the name we wish to read.
simulation as well as other solver options.
Calling the runSimulation() function within
GeckoSCRIPT has the same effect as the user
clicking Simulation -> Init & Start in the
GeckoCIRCUITS main window.

The next step is to check the Java block


outputs in the model to see whether the
amplitude and period of oscillation of the
output voltage is constant, which indicates
whether we should stop the search or continue.

This is done via the getOutput function. As


you can see, the arguments for this function
are the name of the control block
(JAVA_FUNCTION.5 in this case), and the
name of the output. As the output of the Java
block can represent different values, and the
since the number of outputs can vary, the
outputs are simply designated numerically
from top to bottom, starting from zero. Note
Controller tuning example
that the names are however still Strings, not
runSimulation()
numbers. In this case we are interested in
getOutput(…)
output “1” and “3”.
getParameter(…)

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

Then a message is displayed in the script Keeping the SCOPE which displays the output
output that the tuning process is finished, and voltage open, run the script. You will see the
the flag to exit the loop is set. output of the script change as the loop is
executed, and you will also see the model re-
If the amplitude and period are not both simulated (with different results, as the gain is
constant, we increase the proportional gain by changing) with each loop iteration.
0.1, set this in the model as the new
proportional gain, and continue running the
loop.

Once the loop finishes, the last part of the code


calculates the PID coefficients according to the
Ziegler-Nichols PID tuning rule, and sets these
parameters in the PI and PD control blocks in
the model.

Finally, the loop will stop, and the SCOPE will


sho w a converter regulating the output voltage
at 6 V which is the pre-defined reference
Please note the use of the setParameters voltage. A stable set of controller coefficients
function in line 46. This allows you to set all have been found. These are now displayed in
the parameters of a block at once, by the main window underneath the control
specifying the block name, and the parameter blocks.
names and values as an array of Strings and
numbers respectively.

At the end of the script, the simulation is run


again in order to see the final results of the
tuning algorithm.

Now that you have examined and understood


the script you can compile it. Compilation Controller tuning example
should finish successfully. setParameters(…)
Compiling the script
Running the script

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

the script output tab if you attempt to access


something which does not exist.

The gain at which a control loop oscillates at


constant period and amplitude is not
necessarily unique. The initial value of the
proportional gain in this script has been rather
arbitrarily set to 2.2. Try using a different
value, e.g. 0.5 or 1.0, and see what happens.

Also, try changing the output reference


voltage, the switching frequency, or the LC
filter values by modifying the appropriate lines
in the script code. By doing so you change the
dynamics of the system, which results in
different PID coefficients. Try making such
changes, recompile the script, and re-run it to
see the different results.

Also, try using a function to access a para-


meter or output or block that does not exist in Controller tuning example
the model. Such errors are not caught at Modifying the script
compile-time since they depend on the model Run-time errors
itself, but run-time errors will be displayed in

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

So far we have shown how to write simulation >> version -java


control scripts using the scripting environment
provided within GeckoCIRCUITS. However, ans =
sometimes coupling a GeckoCIRCUITS Java 1.6.0 with Sun Microsystems Inc. Java
simulation with another simulation or HotSpot(TM) Client VM mixed mode
computation program is desirable.

All of functions for model manipulation and In the Help Directory of MATLAB you will
simulation control available in GeckoSCRIPT find a description of how to install a newer
within GeckoCIRCUITS, some of which were Java version if necessary.
described previously, are also available for
control of GeckoCIRCUITS through and
within MATLAB®.

This allows a user to load GeckoCIRCUITS


into the MATLAB environment, control a
simulation from the MATLAB environment
(from the command line or an m-file), to use
MATLAB functions to calculate parameters
for the simulation, and to plot simulation
results – or the results of several simulations –
within MATLAB.

In the following we will show how a script for


PID tuning like that presented in the previous
sections can be implemented using
GeckoCIRCUITS and MATLAB.

This tutorial was implemented and tested on


MATLAB release 2010b. Java 1.6 has to be
the actual Java version in the MATLAB
environment. Before proceeding make sure Controlling GeckoCIRCUITS in
that Java 1.6 is the actual Java version in the MATLAB using GeckoSCRIPT functions
MATLAB environment: Check the Java version in MATLAB

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

In order to use GeckoCIRCUITS in MAT- MATLAB to apply the changes. The dynamic
LAB, you must first tell MATLAB of its class path setting, however, will only persist
location. If you are using a Windows machine during your current MATLAB session.
and have installed GeckoCIRCUITS into a
directory called C:/GeckoCIRCUITS/, then the Please save your simulation model and close
path to the GeckoCIRCUITS simulator is GeckoCIRCUITS now.

C:/GeckoCIRCUITS/GeckoCIRCUITS.jar

To add this to MATLAB’s class path, append


the above line to MATLAB’s classpath.txt file.
You can do this within MATLAB by typing

>> edit classpath.txt

which will open that file in the editor.

Please note that by default, the file permission


is set to read-only. Therefore you may need
administrator rights to change the file
permission.

If you don’t have the permission to change the


file classpath.txt, you can also define the path
locally for your MATLAB session to a
dynamic class path. Therefore, execute the
following command:

>> javaaddpath 'C:/GeckoCIRCUITS


/GeckoCIRCUITS.jar'

You can view and undo your changes to the


dynamic class path employing the commands

>> javaclasspath
>> javarmpath Controlling GeckoCIRCUITS in
MATLAB using GeckoSCRIPT functions
When you have set the static class path by Add path to GeckoCIRCUITS
editing classpath.txt, then you must restart

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

The functions for controlling a Gecko- GeckoCIRCUITS should now be running outside of
CIRCUITS simulation and model from MATLAB at port 43035
MATLAB are identical to those listed in the You are now connected to the GeckoCIRCUITS
instance at port 43035
GeckoSCRIPT main window and function in
the same way. The functions for MATLAB are
If an error message is displayed instead, the
located in a Java package called
port is already being used or is blocked. Try
gecko.GeckoRemote.*.
then another port number. On most machines,
the default port 43035 should be free.
To avoid calling the functions always with the
full package name, import this package into
It is also possible that any firewall program
MATLAB with the command
you have installed on your computer will
complain about unauthorized access from
>> import('gecko.GeckoRemote.*')
MATLAB or the Java Runtime Environment.
On Windows machines for example, if
As of version 1.6, communication between
prompted by a message from the firewall, click
MATLAB and GeckoCIRCUITS is done using
“Allow Access” in either case. Even if you do
network ports on the local machine. This
not have administrative rights to do this,
allows GeckoCIRCUITS to run outside of
ignoring such messages (i.e. clicking “Cancel”
MATLAB, in your operating system’s Java
in this example) should not be a problem,
Virtual Machine (JVM), rather than
since both MATLAB and GeckoCIRCUITS
MATLAB’s, while still allowing you to
are running on the local machine.
control simulations and access their results
from MATLAB. NOTE: If you are already familiar with
GeckoCIRCUITS and MATLAB, and have
As a result, besides the list of functions you previously used the old package GeckoExternal,
have already seen in GeckoSCRIPT, for see Appendix for instructions on migrating to
control from MATLAB there are several more GeckoRemote.
functions necessary. One of them is
startGui(int port). This function starts a new
instance of GeckoCIRCUITS, enabled for
remote access, from MATLAB. You must
specify a free network port number. If you do
not, GeckoCIRCUITS will attempt to use the If problems with the firewall persist, please
default port, 43035. Therefore, before you contact your System Administrator and ask
proceed, type into the MATLAB command him to allow MATLAB and Java access to the
line network ports. Ask for advice on which
network ports to use.
>> startGui()
Now, it is not necessary to start
This will open the GeckoCIRCUITS main GeckoCIRCUITS from inside MATLAB using
window. You will also see this message the startGui() function. You can connect from
displayed in the MATLAB command line: Controlling
MATLAB toGeckoCIRCUITS
GeckoCIRCUITS in if it is already
MATLAB using GeckoSCRIPT
running, provided it is enabled for remote
Starting GeckoCIRCUITS in OS JVM (outside Import
access.GeckoRemote
To try this out,package
let us first disconnect
MATLAB)... startGui()

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

from the GeckoCIRCUITS instance we started


from MATLAB. To do this, type Once more there will be a notification message
that you are now connected:
>> disconnectFromGecko()
You are now connected to the GeckoCIRCUITS
A message in the MATLAB command instance at port 43035
window will inform you that the connection
has been severed. However GeckoCIRCUITS
is still running. Go to the GeckoCIRCUITS
window. Under the Tools menu click the
Remote Access Settings option.

Now, let’s go back to our simulation task.


A dialog window will open, allowing you to
enable or disable remote access and control of Open the model you previously modified and
GeckoCIRCUITS, and at which port. saved, buck_control.ipes. You can do this
from MATLAB by typing

>> openFile('buck_control.ipes')

Assuming the file is in your MATLAB


working directory (otherwise, specify the
correct path).

We will repeat the tuning procedure from


before, now from within MATLAB. Since we
saved the model last time with the new PID
coefficients, we need to reset the control
Since everything was set up as we want it blocks to their original, un-tuned values. Do
already when we called startGui(), click “OK”. this from the MATLAB command line by
Now go back to the MATLAB window. typing
Connect again to GeckoCIRCUITS – this time
Controlling GeckoCIRCUITS in
let’s specify the port explicitly – by typing into >> setParameter('PD.1', 'a1',0)
MATLAB using GeckoSCRIPT
the command line >> setParameter('PI.1','a1',0)
Connecting to an already-running instance of
>> setParameter('PD.1', 'r0',1)
GeckoCIRCUITS
>> connectToGecko(43035)

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

You will see the parameters change in


GeckoCIRCUITS. Note the different use of
quotation marks for strings (single rather than
double as in Java code). This is because in
MATLAB you must respect MATLAB syntax,
even though the functions are imported from a
Java package.

You can now verify that the converter is again


not regulating the output voltage properly by
typing into MATLAB

>> runSimulation()

which will simulate the model as shown earlier


from within GeckoSCRIPT.

Controlling GeckoCIRCUITS in
MATLAB using GeckoSCRIPT
Using GeckoSCRIPT functions from the
MATLAB command line

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

Included with this tutorial is a file called


buck_control_tuning.m, which you can open
from MATLAB. It is an m-file that performs
the Ziegler-Nichols tuning, just like the script
we previously analysed and ran from within
GeckoCIRCUITS.

There are however, some differences. If you We define a step-width dt and simulation time
look at the simulation we performed during the tEnd and pass these as arguments to the
tuning process earlier, you will notice that the function. We also define a variable to keep
simulation was performed each time for 0.02 track of how much of the simulation time
seconds. However, we can tell whether we we’ve covered.
have reached Ku much earlier than that. We
only need to see a few cycles. Wouldn’t it be You can also call initSimulation() without
better if we could run a part of the simulation, arguments. In that case the simulation is
check the results, then change the parameters initialized with parameters specified from
if necessary, and continue, and so on? within GeckoCIRCUITS, just like when you
call runSimulation().
There are certain GeckoSCRIPT functions
which allow for just that.

You can use GeckoSCRIPT functions to


simulate one single simulation step at a time,
so simulate several steps at a time, and to
simulate a specified certain time (e.g. 10
microseconds).

Now let’s take a look at the m-file. Up to line


21, the script does the same as previously, only
with MATLAB syntax rather than Java. Now
look at lines 21 to 24. In order to control a
simulation step-by-step, we first must initialize Controlling GeckoCIRCUITS in
it and for this we use the function MATLAB using GeckoSCRIPT
initSimulation. m-file with tuning algorithm
Doing a partial simulation

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

Now let’s take a look at the loop which


performs the tuning. Apart from the MATLAB Note that instead of using simulateTime, you
/ Java syntax differences, you will notice that can use simulateSteps, and specify the exact
instead of using the runSimulation() function number of steps to simulate rather than the
as before, which runs the entire simulation up time to simulate.
to tEnd, we are using simulateTime.
Now execute the m-file. You should see the
same output as before, but now in the
MATLAB console. Check again the
simulation results, and you will see that the
coefficients have been found at that the
converter regulates at 6 V.

The argument is the length of time we wish to


simulate. This function continues from where
the simulation last left off (or starts from zero,
if it has not started) and simulates for the
specified time. In this case (line 30) we chose
2 milliseconds, giving the system plenty of
time to settle before analysing it. We also keep
track (line 31) of how much we’ve simulated
so far. The rest of the loop is the same as in the
previous example.

Now take a look at what happens after the loop


(lines 51-55). First, we must check whether we
have simulated up to the specified end time,
and if not, simulate the remainder (lines 51-
53).

Then we must tell GeckoCIRCUITS that the


simulation is finished. We do this in line 55 by
calling endSimulation(). Controlling GeckoCIRCUITS in
MATLAB using the GeckoSCRIPT
The rest of the script is the same as before interface
within the Java version. simulateTime()

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

In this tutorial, a step-by-step introduction was


given on how to control a GeckoCIRCUITS
model and simulation via a custom-made
script using special functions provided by
GeckoCIRCUITS for that purpose, both using
the GeckoSCRIPT tool within
GeckoCIRCUITS and through MATLAB. The
tutorial demonstrated how to tune the PID
coefficients for a buck converter’s controller
using a simple script written by the user.

This tutorial example gives a good starting


point to the reader who wants to implement
sophisticated scripts for simulation control for
the purpose of performing parameter sweeps, Contact Information / Feedback
optimizations, and so forth.
Andreas Müsing
Further examples demonstrating more
advanced and practical uses of GeckoSCRIPT Gecko-Research GmbH
functions will be periodically made available Riedtlistrasse 72
via the Gecko Newsletter. CH-8006 Zürich, Switzerland

Phone +41-44-632 4265


Fax +41-44-632 1212

www.gecko-research.com
andreas.muesing@gecko-research.com
Document version: July 2012

APPENDIX
Switching from GeckoExternal to
GeckoRemote for MATLAB Use

Prior to GeckoCIRCUITS version 1.6, the


Summary
package information
Contact gecko.GeckoExternal was used for
controlling GeckoCIRCUITS from MATLAB.

GeckoCIRCUITS Coupling with External Software


Script-based Simulation Control using GeckoSCRIPT

As of version 1.6, this API is deprecated – from MATLAB. This was a serious
please do not use it anymore. Switch to using problem experienced by many users.
gecko.GeckoRemote instead.

GeckoExternal remains usable for purposes of From a user’s point of view, the changes are
backwards compatibility. using it, it will minor and easy to make. In your old scripts,
display a message that it is deprecated and simply change the line
recommend moving to GeckoRemote, but import(‘gecko.GeckoExternal.*’)
otherwise it will work as before. Therefore to
your old MATLAB scripts, written before import('gecko.GeckoRemote.*')
version 1.6, are still usable as they are. and everything else should work without
modifications. Please note that now you must
However, GeckoExternal is no longer be mindful of port numbers in some cases –
maintained or supported. Therefore you are please read the section of this tutorial dealing
strongly urged to switch to using with setting up the GeckoCIRCUITS-
GeckoRemote in your MATLAB scripts. MATLAB link.

The main reason for the switch is that


GeckoRemote enables GeckoCIRCUITS to
run in your operating system’s Java Virtual
Machine (JVM) rather than MATLAB’s JVM.

This approach makes it easier for you to work


with GeckoCIRCUITS from MATLAB.

The main advantages are that

1) You can now close GeckoCIRCUITS,


even if when started from MATLAB,
without having to close all of MATLAB;

2) You don’t have to worry about memory


allocation for Java inside MATLAB;
Controlling GeckoCIRCUITS in
3) You will not have problems with MATLAB using the GeckoSCRIPT
compiling your simulation models’ Java interface
blocks when running GeckoCIRCUITS APPENDIX: Migrating from
GeckoExternal to GeckoRemote
GeckoCIRCUITS Coupling with External Software

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy