Canvas Development: Difference between revisions

From ASCEND
Jump to navigation Jump to search
Grivan (talk | contribs)
Grivan (talk | contribs)
Line 9: Line 9:
===Simple Rankine Cycle===
===Simple Rankine Cycle===
A simple Rankine cycle has been modelled as a use case to see what all is missing.
A simple Rankine cycle has been modelled as a use case to see what all is missing.
[[Image:Screenshot-ASCEND_Canvas_Modeller.png|thumb|250px|left|Canvas modeller for ASCEND, showing a simple Rankine Cycle solved.]]
[[Image:Screenshot-Block_Description.png|thumb|200px|right|Instance browser showing partial results.]]
*Global Model equations
*Global Model equations
:''Implementation'':A 'Canvas Properties' pop-up allows for additions of extra declarations to the MODEL.  
:''Implementation'':A 'Canvas Properties' pop-up allows for additions of extra declarations to the MODEL.  

Revision as of 20:09, 12 July 2010

This article is about planned development or proposed functionality. Comments welcome.

This page aims to document all the GSoC 2010 development carried out by Grivan. The goals and tasks are additionally listed over here for a quick look. Efforts will be to make the modeller powerful enough for some real and serious modelling. Use Cases are being developed as to see what do we expect from our modeller to be able to do for us, to identify the most important aspects and implement them.

Use Cases

We want to be able to solve following descriptions from our Canvas Based Modeller. These would help us identify as to what things require our immediate attention. This will help identify the missing elements from our design, and how best these should be implemented.

TODO : Add more ideas, put a concrete solution overview to each Case.

Simple Rankine Cycle

A simple Rankine cycle has been modelled as a use case to see what all is missing.

Error creating thumbnail: File missing
Canvas modeller for ASCEND, showing a simple Rankine Cycle solved.
Error creating thumbnail: File missing
Instance browser showing partial results.
  • Global Model equations
Implementation:A 'Canvas Properties' pop-up allows for additions of extra declarations to the MODEL.
  • Set up of extra components
Implementation: Pump, Turbine, Boiler, Condenser have been annotated to provide blocks with suitable parameters.

Regenerative Rankine Cycle

Rankine cycle is a thermodynamic process that converts heat energy into work. John Pye has already written an ASCEND language based model for this process here models/johnpye/rankine.a4c. We would want to develop a steady state model of regenerative Rankine cycle. This particular model would require from us to:

  • Set up of extra components
Implementation: Pump, Turbine, Boiler, Condenser, Feedwater Heater, TEE piece. In addition take care of the ALIASES keyword used in the text model. TODO
  • Elimination of redundant equations in closed loop flows.
    Multiple loops present in the system.
Implementation: Still needs to be discussed. TODO
  • Specifications of flow streams.
    It should be possible to switch between stream components, water to CO2 to toluene for example.
    This however should not involve redrawing the whole model again.
Implementation: Streams can be defined in the canvas by selecting the particular connections and specifying the stream component, the connections to these components at the ports must use the values of stream component provided. TODO
  • Providing complex flow streams.
    A regenerative cycle requires to specify the fraction of steam extracted at the bled point, that is a TEE in our sense. Such a fraction must be supplied by the user while making such connections. Assuming an open feedwater scheme.
Implementation: This should be easy as a simple TEE component must have a fixable variable 'fraction'.
  • Present graphical models used to create the flowsheet in a more intuitive form. In styles of a PID or a PFD.
Implementation: See #Support for user-customisable custom icon types.

Ammonia Synthesis Reactor

Ammonia is basically manufactured by chemical combination of nitrogen and hydrogen gases at high temperature and pressure in the presence of a catalyst. The reactor could be desirable complexity which has to be decided. In any case Ammonia synthesis requires complex flow streams.

  • The simulation type needs to determined. What kind of reactor will be used for example plug flow or Gibbs.
  • In this case connections may need to be manually specified in order to provide complex flows as required.

Non-Chemical Models

ASCEND is a powerful language, it is fairly general to support all kinds of mathematical models. For example take look at these:

Specification of flow streams should not make the modeller lose it generality. Other chemical process modellers make the modeller specific for use with chemical engineering models. However we would also want to have our modeller models of mechanical and electrical architecture. Basically maintain the ASCEND's general approach.

  • Flow streams have to be mentioned such that it does not affect the type of system being modelled does not require specification of flow streams or it is obvious.
    • For example, current and torque/energy/tension are obviously the streams in an electrical model and a particular mechanical model.

Dynamic Modelling of Servo Motor with backlash and PID control

  • TODO : Add description

Update for Gaphas HEAD

The following section lists all the updating that needs to be done or has been done to work with latest gaphas head.

Aspects

One of the features that enhances the usability of the canvas is the dragging of ports to ports support to specify a stream. In reality these provides ARE_THE_SAME arguments when the ASCEND code is created.

  • The Aspects of gaphas API define the 'how' and Tools the 'what'.
  • Specific handlers now have to be created to handle events like line disconnection on either of the ports, re-connection etc.
  • This should be carefully designed to have no problems in the future as it is already an important component.

Line Connection

Line Connection now uses Aspects, it is quite stable.

GUI Usability Improvements

TODO : Keep adding details

Undo/Redo Support

An Undo/Redo support would enhance the Usability. The gaphas library provides a very low level access to changes in its classes in form of multiple actions those of which could be executed to perform an Undo action. What is being done is to segregate the Actions observed into user level Transactions which could be applied to perform one Undo or a Redo.

  • A basic but working mechanism is present.
  • The mechanism breaks at undoing Line Connections.

Bugs

Maybe this bug list could be useful for that.

Support for user-customisable custom icon types

We want to be able to generate icons for models by embedding some kind of user definable code inside the model and/or add a graphical file itself. We want to make the resizing of the blocks such that it just works. Say for example if a motor is to be circle, it has to remain a circle. Additionally it would require us to read the model code and identify the constraint codes and pass them to Gaphas.
TODO : Add exact Implementation details

Specification of flow streams

To provide reusable modelling architecture for modelling systems with non-trivial flow streams, the flow streams should be manually specified. This provides and excellent way to have the same model provide simulation for any number of streams. Two implementations have to be taken care of to specify streams;

  • GUI implementation:
    This would provide a suitable GUI to select the stream.
  • Application level implementation
    This would add actual stream modifications to the block code.

Currently in process of studying how streams are handled by the ASCEND language itself.

TODO : Add implementation details

Type Information

While connecting two blocks together the type of input and output port of the connector must be matched, also if we can extract Type information on variables in our model both Unit checking and port checking should be fairly easy. Type checking isn't very easy right now. Looking for ways.

TODO : Add implementation details

Key Deliverables

To set a stone for the GSoC project following have to be implemented

  • Canvas Model for a Regenerative Rankine cycle
  • Ammonia synthesis reactor
  • Support for user customisable icon-types for blocks
  • Undo Support

Weekly Reports

The weekly reports will be filed here. Week 0 starts from 24th of May up-to 30th of May and so on.

Week 0

24th-May-10 to 30th-May-10

  • Set up environment
  • Attempt to try and get modeller running
    1. Code updates for Gaphas HEAD using and Arijit's patch and some extra edits
      Except for connections feature canvas code successfully updates for Gaphas HEAD
    2. Code updates for py-gtksourceview2, enabled syntax highlighting
  • Other minor issues resolved
  • Unavailable for project completely due to scheduled end semester exams from 24th-July-10 to 2nd-July-10

Week 1

31st-May-10 to 6th-June-10
This was a 'pull-up-socks' week, main aim was to get back on after exams and prioritise work

  • Attempt to fix the connections code
    1. Connection disconnection done, using Gaphas' new Aspects API. Still need a way to reconnect
  • Start identifying crucial aspects for Canvas Modelling
  • Started developing Use-Cases
  • Had a meet with Prof Kannan. Got a huge motivation
    1. Got in touch with Shrikanth and Ankit to identify aspects for use of Canvas modeller in a class room environment
    2. Got in touch with Delhi FOSS community
  • Started working on implementation details for Type-Checking, Closed-Loop flow sheets, User-customisable icons
  • Got this wiki page up

Week 2

7th-June-10 to 13th-June-10
TODO List

  • Complete study of use cases
  • Have connections code completely set, robust and future ready
  • Have implementation details of at least one of the GUI features

Status of work

  • The canvas connection code is completely done. User can connect/disconnect items multiple times.
  • Improved the block propertied dialogue box a lot.
    1. Shifted the basic structure to XML, using Glade.
    2. Due to no implementation of #Type Information, setting units may still create a problem.
    3. Parameters are now viewable through a List view.
  • Use cases still need more work.
  • Worked out some details of implementing Undo/Redo system. Starting the work to implement them.

Week 3

14th-June-10 to 20th-June-10
TODO List

Status of Work

  • A very basic Undo system in place.

Issues

  • Identifying a way to record Undo transactions took a large part of the week, could not complete other objectives.

Week 4

21st-June-10 to 27th-June-10
TODO LIST

Status of Work

  • Did many improvements to the Undo system.
  • Improved the Key Accel's
  • Improved Connections code.

Issues

  • Callback functions do not record in gaphas as an event, so Undo system breaks at undoing a disconnect of Line Connection.
  • Went through much of ASCEND API, but still not being able to identify Types and thus Units of parameters of blocks. For a temporary solution tried a failed attempt to get a Simulation of the String Model and identify Types.
  • Problem lies in not being able to get #Type Information in the model by name, which is the only information we have from annotations.
  • Finding ways for #Support for user-customisable custom icon types implementation details, studied how Modellica handles Graphic properties of blocks.

Week 5

28th-June-10 to 4th-July-10
TODO List

Week 6

5th-July-10 to 11th-July-10
TODO List

Week 7

12th-July-10 to 18th-July-10

  • Submit Mid Term Evaluations

Week 8

19th-July-10 to 25th-July-10

  • TODO

Week 9

26th-July-10 to 1st-August-10

  • TODO

Week 10

2nd-August-10 to 8th-August-10

  • TODO

Week 11

9th-August-10 to 16th-August-10

  • Finalise work
  • Submit End Term Evaluations
  • Tie loose ends