muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom,
Relatório de Física - Atuação EletrostáticaVictor Said
A física é a ciência responsável por efetuar o estudo, descrição e análise dos fenômenos da natureza. Dentro das diversas áreas da física, existe a Óptica, Acústica, Termologia e a Mecânica. A primeira é responsável pelo estudo da luz e dos seus fenômenos; a segunda direciona-se às características e propriedades do som; e a termologia pelo estudo da temperatura. Já a mecânica é a área responsável por estudar, descrever e analisar os fenômenos que ocorrem nos corpos quando no estado de repouso e movimento, de modo que seja possível compreender aos seus comportamentos, propriedades e características, assim como suas singularidades nesta condição. Dentro da mecânica, há uma área com mesmo objetivo, denominada Hidrostática, que busca estudar o comportamento dos fluidos em repouso. Analisando-os quando submetidos a forças, em condições de homogeneidade e heterogeneidade. Observando ainda os fenômenos desencadeados quando corpos sólidos, que podem ser ocos ou não, são imersos e emersos em tais fluidos. O objetivo deste trabalho é efetuar uma análise dos fundamentos da hidrostática, através da aplicação prática dos principais princípios, leis e conceitos desta, como a pressão ou o teorema de Arquimedes. Para isto, realizou-se uma prática laboratorial sobre hidrostática no dia 08 de Julho de 2013, sobre orientação e supervisão do professor Gilmar Melo docente da disciplina Física II, no Instituto Federal da Bahia.
muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom, muito bom,
Relatório de Física - Atuação EletrostáticaVictor Said
A física é a ciência responsável por efetuar o estudo, descrição e análise dos fenômenos da natureza. Dentro das diversas áreas da física, existe a Óptica, Acústica, Termologia e a Mecânica. A primeira é responsável pelo estudo da luz e dos seus fenômenos; a segunda direciona-se às características e propriedades do som; e a termologia pelo estudo da temperatura. Já a mecânica é a área responsável por estudar, descrever e analisar os fenômenos que ocorrem nos corpos quando no estado de repouso e movimento, de modo que seja possível compreender aos seus comportamentos, propriedades e características, assim como suas singularidades nesta condição. Dentro da mecânica, há uma área com mesmo objetivo, denominada Hidrostática, que busca estudar o comportamento dos fluidos em repouso. Analisando-os quando submetidos a forças, em condições de homogeneidade e heterogeneidade. Observando ainda os fenômenos desencadeados quando corpos sólidos, que podem ser ocos ou não, são imersos e emersos em tais fluidos. O objetivo deste trabalho é efetuar uma análise dos fundamentos da hidrostática, através da aplicação prática dos principais princípios, leis e conceitos desta, como a pressão ou o teorema de Arquimedes. Para isto, realizou-se uma prática laboratorial sobre hidrostática no dia 08 de Julho de 2013, sobre orientação e supervisão do professor Gilmar Melo docente da disciplina Física II, no Instituto Federal da Bahia.
The fundamental problems of GUI applications and why people choose ReactOliver N
Instead of asking people which JavaScript framework to learn, let's look back into GUI application architecture (which Web Front-end is a case). Then you will understand why people created those library & frameworks and why React became so popular.
Gephi Toolkit Developer Tutorial.
The Gephi Toolkit project package essential modules (Graph, Layout, Filters, IO...) in a standard Java library, which any Java project can use for getting things done. The toolkit is just a single JAR that anyone could reuse.
This tutorial introduce the project, show possibilities and code examples to get started.
Use of TextField, Label, Sliders and Switch buttons
Handling ActionSheet and Alerts
Application Delegates
Handling ActionSheet and Alerts
Application Delegates
UIApplication Delegates
View Controllers
Life Cycle of Application & Methods
ARC
iPhone App Development Training Programme (contd.)
How Google AppEngine deals with digital art? how about music? a few case studies developed by Stinkdigital with Google Creative Lab and how App Engine dealt with a considerable amount of visits
Java programming presentations By Daroko blog
Do not just read java as a programmer, find projects and start making some Money, at DAROKO BLOG,WE Guide you through what you have learned in the classroom to a real business Environment, find java applications to a real business Environment, find also all IT Solutions and How you can apply them, find the best companies where you can get the IT jobs worldwide, Find java contract, Complete and start making some cash, find clients within your Country, refer and get paid when you complete the work.
Not Just a contact, at daroko Blog (www.professionalbloggertricks.com/),you are also being taught how you can apply all IT related field in real world.
Simply Google, Daroko Blog or visit (www.professionalbloggertricks.com/) to Know More about all these service now.
Do not just learn and go, apply them in real world.
International Journal of Engineering Research and Development is an international premier peer reviewed open access engineering and technology journal promoting the discovery, innovation, advancement and dissemination of basic and transitional knowledge in engineering, technology and related disciplines.
- Talk from FrontConf Munich 2017
- https://frontconf.com/talks/09-12-2017/reactive-type-safe-webcomponents
Abstract:
You know the drill right? new cool framework/library appears... boom! new Datepicker in that framework follows and soon enough whole UI libraries, again and again....
It's 2017 and it's time to stop this madness once and for all! How you ask?
In this talk we will go through implementation of an app via vanilla web components and explore all the pain points with all these low level primitives that we have natively in the browser.
In the end we will build our custom super tiny reactive type-safe library which will allow us to build web components with a breeze
Write once, use everywhere by using the platform + abstraction for great Developer experience.
Similar to How to develop a Graphical User Interface (GUI) in Scilab (20)
Why electric vehicles need model-based design?
Because of the rising complexity in new vehicles, model-based design & systems engineering is needed to cascade the requirements and trace back any modification along the engineering lifecycle. Find out more in this presentation of a customer case about electric motor optimization.
Keynote of the French Space Agency CNES on the Asteroidlander MASCOT boarding the Hayabusa2 mission in collaboration with the Japanese Space Agency JAXA and the German Aerospace Center DLR
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...Scilab
Rapid Prototyping becomes very popular for faster algorithm development. With a graphical representation of the algorithm and the possibility to simulate complete designs, engineers can help to reduce the time to market. A tight integration with MPLAB-X IDE allows the combination with standard C-coding to easily get mass production code. This solution was used to optimise a sensorless field oriented controlled PMSM motor driven pump efficiency. A model for closed loop simulation was developed using X2C blocks [1][2] for the FOC algorithm based on the existing application note AN1292 [3]. Enhancements to the original version were implemented and verified with simulation. The X2C Communicator was used to generate code of the new algorithm. With the online debugging capabilities and the scope functionality the algorithm was further tuned and optimized to achieve the highest possible efficiency of the pump.
Scilab and Xcos for Very Low Earth Orbits satellites modellingScilab
Very Low Earth Orbits are orbits in altitudes lower than 450 km. The interaction between the atmosphere particles and the surfaces of the spacecraft is responsible for the aerodynamic torques and forces. Simulating several aspects of the performance of a satellite flying in VLEO is very important to make decisions about the design of the spacecraft and the mission.
X2C -a tool for model-based control development and automated code generation...Scilab
Peter Dirnberger, Stefan Fragner
Nowadays, the market demands compact, stable, easy maintain-and customizable embedded systems. To meet these requirements, afast, simple and reliable implementation of control algorithms is crucial. This paper demonstrateshow model-based design with the help of Scilab/Xcosand X2C, developed by LCM,simplifiesand speedsup the development and implementation of controlalgorithms. As an example, acontrol schemefor a bearingless motoris presented.
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...Scilab
As part of an EU-founded research project, the Scilab based development tool LoRra (Low-Cost Rapid Control Prototyping Platform) was created. This allows the realization of the continuously model based and highly automated Rapid Control Prototyping (RCP) design process for embedded software within the Scilab / Xcos environment (cf. Figure 1). Based on the application battery management system (BMS), this paper presents a Real-Time interface for Scilab.
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCosScilab
The increasing demand in the aerospace industry for safety and performance has been requiring even more resourceful flight control laws in all market segments, since the airliners until the newest flying cars. The de facto standard for flight control laws design makes extensive use of tools supporting numerical computing and dynamic systems visual modeling, such that Scilab and XCos can nicely suit this kind of development.
Multiobjective optimization and Genetic algorithms in ScilabScilab
In this Scilab tutorial we discuss about the importance of multiobjective optimization and we give an overview of all possible Pareto frontiers. Moreover we show how to use the NSGA-II algorithm available in Scilab.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Water Industry Process Automation and Control Monthly - May 2024.pdf
How to develop a Graphical User Interface (GUI) in Scilab
1. www.openeering.com
powered by
HOW TO DEVELOP A GRAPHICAL USER INTERFACE
(GUI) IN SCILAB.
In this tutorial we show how to create a GUI in Scilab for an ODE problem.
The adopted problem is the LHY model already used in other tutorials.
Level
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
2. LHY Tutorial Gui www.openeering.com page 2/18
Step 1: The purpose of this tutorial
In this tutorial we show, step by step, how to create a Graphical User
Interface (GUI)in Scilab.
Examples of Scilab GUIs are reported on the right. These images are
taken from the GUI menu of the Scilab Demonstrations.
Step 2: Model description
In this tutorial we refer to the LHY model. A description of the LHY model
and its solution using ode command can be found in the basic tutorial of
modeling differential equations in Scilab.
3. LHY Tutorial Gui www.openeering.com page 3/18
Step 3: Roadmap
In this tutorial we describe how to construct a GUI for the LHY. We
implement the system in the following way:
Provide a description of GUI programming in Scilab;
Implement the GUI for the LHY model;
Test the program and visualize the results.
Descriptions Steps
GUI programming in Scilab 4-5
GUI for the LHY model 6-17
Running and testing 18-19
Step 4: Scilab GUI programming
A GUI is a human-computer interface that uses graphical objects like
windows, menus and icons to interact with users through the use of
mouse and keyboard (often in a limited way).
The main advantage of using GUIs is the ability to make computer
operations more intuitive, and thus easier to learn and use especially for
new users. For example, it is much easier to move files by dragging icons
with the mouse than by having to remember the command that performs
the same task.
The function that creates a graphical user interface object in Scilab is
"uicontrol".
The syntax of the GUI function is
h = uicontrol(PropertyName,PropertyValue,...)
h = uicontrol(parent,PropertyName,PropertyValue,...)
h = uicontrol(uich)
For a detailed description see "help uicontrol".
4. LHY Tutorial Gui www.openeering.com page 4/18
Step 5: Design of the GUI interface
The first step is to design the skeleton of the GUI interface for the LHY
model.
Designing a “correct” GUI is not a trivial task. Many rules exist and can be
found in textbooks and web sites dedicated to this subject.
On the right we report our scheme for the LHY graphical user interface
where:
"Model parameters" contains the list of all LHY model
parameters that the user can change;
"Time Setting" contains the list of all time simulation variables;
"Initial conditions" contains the list of all initial conditions
for the ODE problem;
"graphical plot " contains the plot of the simulation’s results;
"Compute button" updates the solution in the "graphical
plot ";
The menu "file" contains the entry "close" that is used to close
the program;
The menu "About" contains the entry "About" that is used to
display some info about program and author.
5. LHY Tutorial Gui www.openeering.com page 5/18
Step 6: Storing default parameters
The first step is to store all the default LHY model parameters into mlist
Scilab objects. The parameters are subdivided into two groups:
the "param" group for the LHY model parameters;
the "sim" group for the simulation time parameters and initial
conditions.
// Default simulation parameters
param = [];
param.tau = 5e4; // Number of innovators per year (initiation)
param.s = 0.61; // Annual rate at which light users attract non-
users (initiation)
param.q = 3.443; // Constant which measures the deterrent effect
of heavy users (initiation)
param.smax = 0.1; // Lower bound for s effective (initiation)
param.a = 0.163; // Annual rate at which light users quit
param.b = 0.024; // Annual rate at which light users escalate to
heavy use
param.g = 0.062; // Annual rate at which heavy users quit
param.delta = 0.291; // Forgetting rate
// Simulation data
// Time variables
sim = [];
sim.Tbegin = 1970; // Initial time
sim.Tend = 2020; // Final time
sim.Tstep = 1/12; // Time step
// Initial conditions
sim.L0 = 1.4e6; // Light users at the initial time
sim.H0 = 0.13e6; // Heavy users at the initial time
sim.Y0 = 0.11e6; // Decaying heavy user at the initial time
The name of the developed function is "LHY_Gui".
6. LHY Tutorial Gui www.openeering.com page 6/18
Step 7: Create an initial window
In the next step we create, with the "scf" Scilab function, an initial window
where graphical object can be added.
The function "gettext" is used for internationalization (a.k.a. i18n, i.e. it
translates the text into the current local language if available).
// Global window parameters
global margin_x margin_y;
global frame_w frame_h plot_w plot_h;
// Window Parameters initialization
frame_w = 300; frame_h = 550;// Frame width and height
plot_w = 600; plot_h = frame_h;// Plot width and heigh
margin_x = 15; margin_y = 15;// Horizontal and vertical margin
for elements
defaultfont = "arial"; // Default Font
axes_w = 3*margin_x + frame_w + plot_w;// axes width
axes_h = 2*margin_y + frame_h; // axes height (100 =>
toolbar height)
demo_lhy = scf(100001);// Create window with id=100001 and make
it the current one
// Background and text
demo_lhy.background = -2;
demo_lhy.figure_position = [100 100];
demo_lhy.figure_name = gettext("LHY solution");
// Change dimensions of the figure
demo_lhy.axes_size = [axes_w axes_h];
Type “help scf” for more details on the scf command.
7. LHY Tutorial Gui www.openeering.com page 7/18
Step 8: Set menu and toolbar
After creating the window, we create the menu. The used function are:
"addmenu"/"delmenu": for adding or removing a menu from the
menu bar;
"uimenu": for creating a menu or a submenu in a figure.
Associate to each menu entry there is a callback, a reference to a
executable function that is activated when the user select the
entry.
// Remove Scilab graphics menus & toolbar
delmenu(demo_lhy.figure_id,gettext("&File"));
delmenu(demo_lhy.figure_id,gettext("&Tools"));
delmenu(demo_lhy.figure_id,gettext("&Edit"));
delmenu(demo_lhy.figure_id,gettext("&?"));
toolbar(demo_lhy.figure_id,"off");
// New menu
h1 = uimenu("parent",demo_lhy, "label",gettext("File"));
h2 = uimenu("parent",demo_lhy, "label",gettext("About"));
// Populate menu: file
uimenu("parent",h1, "label",gettext("Close"), "callback",
"demo_lhy=get_figure_handle(100001);delete(demo_lhy);",
"tag","close_menu");
// Populate menu: about
uimenu("parent",h2, "label",gettext("About"),
"callback","LHY_About();");
// Sleep to guarantee a better display (avoiding to see a
sequential display)
sleep(500);
An import field for the graphical function is the “parent” field i.e. the
handle where the graphical object should be attached, in our case
“demo_lhy”. Changing this value allows to move a control from a figure to
another.
See “uimenu” help file for more details.
8. LHY Tutorial Gui www.openeering.com page 8/18
Step 9: About dialog
The “About” dialog is a modal dialog created using the "messagebox"
function. Two types of windows are available:
"modal dialog": in a modal window users are required to interact
with it before it returns to the parent application.
"modeless dialog": in modeless or non-modal window the
request information is not essential to continue with the program.
A non-modal window can be left open while work continues
elsewhere.
function LHY_About()
msg = msprintf(gettext("LHY is developed by the Openeering
Team.nAuthor: M. Venturin"));
messagebox(msg, gettext("About"), "info", "modal");
endfunction
Step 10: Creating a frame
A frame is graphical object used to group other objects.
// Frames creation [LHY parameters]
my_frame = uicontrol("parent",demo_lhy, "relief","groove", ...
"style","frame", "units","pixels", ...
"position",[ margin_x margin_y frame_w frame_h], ...
"horizontalalignment","center", "background",[1 1 1], ...
"tag","frame_control");
// Frame title
my_frame_title = uicontrol("parent",demo_lhy, "style","text", ...
"string","LHY parameters", "units","pixels", ...
"position",[30+margin_x margin_y+frame_h-10 frame_w-60 20],
...
"fontname",defaultfont, "fontunits","points", ...
"fontsize",16, "horizontalalignment","center", ...
"background",[1 1 1], "tag","title_frame_control");
9. LHY Tutorial Gui www.openeering.com page 9/18
Step 11: Populate the frame
Each parameters is composed of the following elements:
a string that denote the parameter (style “text”);
an edit box (style “edit”) that is used as an input/output mask (the
input is recovering by searching all graphical objects having that
tag, and hence the tag must be unique among the elements)
// Adding model parameters
guih1 = frame_w;
guih1o = 240;
// ordered list of labels
labels1 = ["Tau", "s", "q", "smax", "a", "b", "g", "delta"];
// ordered list of default values
values1 = [5e4, 0.61, 3.443, 0.1, 0.163, 0.024, 0.062, 0.291];
// positioning
l1 = 40; l2 = 100; l3 = 110;
for k=1:size(labels1,2)
uicontrol("parent",demo_lhy, "style","text",...
"string",labels1(k), "position",[l1,guih1-
k*20+guih1o,l2,20], ...
"horizontalalignment","left", "fontsize",14, ...
"background",[1 1 1]);
guientry1(k) = uicontrol("parent",demo_lhy, "style","edit",
...
"string",string(values1(k)), "position",[l3,guih1-
k*20+guih1o,180,20], ...
"horizontalalignment","left", "fontsize",14, ...
"background",[.9 .9 .9], "tag",labels1(k));
end
11. LHY Tutorial Gui www.openeering.com page 11/18
Step 13: Add a button
Next, using the same command “uicontrol”, we add the “compute button”
(style “pushbutton”):
// Adding button
huibutton = uicontrol(demo_lhy, "style","pushbutton", ...
"Position",[110 100 100 20], "String","Compute", ...
"BackgroundColor",[.9 .9 .9], "fontsize",14, ...
"Callback","syscompute");
The button is associated to the callback "syscompute". This callback will
be explained and created at step 17.
Step 14: Solving function
The solving function is based on the code already developed in the tutorial
of the LHY model solved using "ode" function. See this tutorial for more
details.
function sol=solvingProblem(param, sim)
// Compute the solution
sol = struct();
// Assign ODE solver data
y0 = [sim.L0;sim.H0;sim.Y0];
t0 = sim.Tbegin;
t = sim.Tbegin:sim.Tstep:(sim.Tend+100*%eps);
f = LHY_System;
// Solving the system
sol.LHY = ode(y0, t0, t, f);
sol.t = t;
endfunction
12. LHY Tutorial Gui www.openeering.com page 12/18
Step 15: Display function
The display functions is derived from the "LHY_Plot" function of the
tutorial on LHY solved using "ode" function. See this tutorial for more
details.
function displayProblem(solh)
// Fetching solution
LHY = sol.LHY;
t = sol.t;
L = LHY(1,:); H = LHY(2,:); Y = LHY(3,:);
// Evaluate initiation
I = LHY_Initiation(L,H,Y, param);
// maximum values for nice plot
[Lmax, Lindmax] = max(L); tL = t(Lindmax);
[Hmax, Hindmax] = max(H); tH = t(Hindmax);
[Ymax, Yindmax] = max(Y); tY = t(Yindmax);
[Imax, Iindmax] = max(I); tI = t(Iindmax);
// Text of the maximum point
Ltext = msprintf(' ( %4.1f , %7.0f)',tL,Lmax);
Htext = msprintf(' ( %4.1f , %7.0f)',tH,Hmax);
Ytext = msprintf(' ( %4.1f , %7.0f)',tY,Ymax);
Itext = msprintf(' ( %4.1f , %7.0f)',tI,Imax);
// Plotting of model data
delete(gca());
plot(t,[LHY;I]);
legend(['Light Users';'Heavy users';'Memory';'Initiation']);
// Vertical line
set(gca(),"auto_clear","off");
xpolys([tL,tH,tY,tI;tL,tH,tY,tI],[0,0,0,0;Lmax,Hmax,Ymax,Imax]);
// Text of maximum point
xstring(tL,Lmax,Ltext); xstring(tH,Hmax,Htext);
xstring(tY,Ymax,Ytext); xstring(tI,Imax,Itext);
xlabel('Year');
set(gca(),"auto_clear","on");
my_plot_axes = gca();
my_plot_axes.title.font_size = 5;
my_plot_axes.axes_bounds = [1/3,0,2/3,1];
my_plot_axes.title.text = "LHY solution";
endfunction
13. LHY Tutorial Gui www.openeering.com page 13/18
Step 16: Default initial plot
The last step for "LHY_Gui" is to compute the solution with the default
data and to re-draw the window.
// Compute solution
sol = solvingProblem(param, sim);
// Redraw window
drawlater();
newaxes();
displayProblem(sol);
drawnow();
14. LHY Tutorial Gui www.openeering.com page 14/18
Step 17: Linking the computational function to the button
The "syscompute" function is associated to the “Compute button” (see
step 13) and performs the following steps:
it retrieves data from the object framework: this process is done
by the function "findobj" that searches from all graphical objects
those having the prefixed target tag;
it evaluates the available data in the field converting these data
from string into real using the function "evstr";
it performs the simulation with the "solvingProblem" function;
it redraws the window.
function syscompute
// retrive data
param = [];
tau = findobj("tag", "Tau"); param.tau = evstr(tau.string);
s = findobj("tag", "s"); param.s = evstr(s.string);
q = findobj("tag", "q"); param.q = evstr(q.string);
smax = findobj("tag", "smax"); param.smax =
evstr(smax.string);
a = findobj("tag", "a"); param.a = evstr(a.string);
b = findobj("tag", "b"); param.b = evstr(b.string);
g = findobj("tag", "g"); param.g = evstr(g.string);
delta = findobj("tag", "delta"); param.delta =
evstr(delta.string);
sim = [];
Tbegin = findobj("tag", "Tbegin");sim.Tbegin =
evstr(Tbegin.string);
Tend = findobj("tag", "Tend"); sim.Tend = evstr(Tend.string);
Tstep = findobj("tag", "Tstep"); sim.Tstep =
evstr(Tstep.string);
L0 = findobj("tag", "L0"); sim.L0 = evstr(L0.string);
H0 = findobj("tag", "H0"); sim.H0 = evstr(H0.string);
Y0 = findobj("tag", "Y0"); sim.Y0 = evstr(Y0.string);
// Compute solution
sol = solvingProblem(param, sim);
// Redraw window
drawlater();
my_plot_axes = gca();
my_plot_axes.title.text = "LHY solution";
newaxes();
displayProblem(sol);
drawnow();
endfunction
15. LHY Tutorial Gui www.openeering.com page 15/18
Step 18: Running and testing #1
Change the Scilab working directory to the current project working
directory and run the command exec('LHY_MainGui.sce',-1).
This command runs the main program and plots a chart similar to the one
shown on the right.
Step 19: Running and testing #2
Since we have used the function "evstr" it is possible to insert
expression in the input masks and see, in an easy way, the effects of
parameters changing in the solution.
For example, on the right we have reported the simulation where the
parameters b 0.024 3.2 and δ 0.291 exp 3.2 .
16. LHY Tutorial Gui www.openeering.com page 16/18
Step 20: Exercise #1
Try to modify the program adding the following feature: Every time the
“compute button” is pressed the program check if the LHY parameters are
changed with respect to the default values and if a parameter is changed
then the associated input mask is colored using the orange color as
depicted in the figure.
Step 20: Exercise #1 (Hints)
Some hints:
copy the mlist data "param" and "sim" into a global data structure
and save the name of their fields;
add a "updatedFields" function into the "syscompute"
function;
write the "updatedFields" function.
// global default data
global gparam gsim pf sf;
gparam = param;
gsim = sim;
// param and sim fields
pf = fieldnames(gparam); // param fields
sf = fieldnames(gsim); // sim fields
// Update fields
updateFields(param, sim);
17. LHY Tutorial Gui www.openeering.com page 17/18
function updateFields(param, sim)
global gparam gsim pf sf
// Loop over gparam/param elements
for i=1:size(pf,1)
// Get current field
cf = pf(i);
// check if they are different
checkequal = 0;
if(abs(gparam(cf)-param(cf))<= 1e-12) then
checkequal = 1;
end
// Find object
obj = findobj("tag", cf);
if(isempty(obj)) then
// object not found, skip, some problems?
continue;
end
// Colorize
if(~checkequal) then
// Object is modified: use new color
obj.BackgroundColor = [0.98 0.83 0.71];
else
// Object is not modified: use default color
obj.BackgroundColor = [.9 .9 .9];
end
end
// The same code for the field gsim/sim
endfunction
Step 21: Concluding remarks and References
In this tutorial we have shown how a GUI can be developed for the LHY
model.
On the right-hand column you may find a list of references for further
studies.
1. Scilab Web Page: Available: www.scilab.org.
2. Openeering: www.openeering.com.
18. LHY Tutorial Gui www.openeering.com page 18/18
Step 22: Software content
To report a bug or suggest some improvement please contact Openeering
team at the web site www.openeering.com.
Thank you for your attention,
Manolo Venturin
-------------------
GUI MODEL IN SCILAB
-------------------
----------------
Directory: model
----------------
LHY_Color_Gui.sci : GUI for the LHY model (ex. 1)
LHY_Gui.sci : GUI for the LHY model
LHY_Initiation.sci : Initiation function
LHY_System.sci : LHY system
--------------
Main directory
--------------
LHY_MainGui.sce : Main console GUI program
LHY_MainGuiColor.sce : Solution of the exercise
license.txt : The license file