[Ktechlab-devel] Improving the code

Zoltan Padrah zoltan.padrah at gmail.com
Mon Aug 29 15:47:29 UTC 2016


 Hi Mathias,

as I see it from the project development view, there are two major
directions for improvements in KTechLab:
(1) keeping it updated with Qt/KDE libraries, fixing bugs,
(2) adding / experimenting with new features.

Currently, when I have time, I keep working on (1), in order to allow
people to run KTechLab. Unfortunately the last "official" release is
based on Qt3, which is deprecated, the Qt4 version is in the works,
but it needs more fixes, and distributions are moving towards Qt5
these days.

For your studies, I assume that you want to experiment with new
features, unless your professor would see value in "making program X
work properly on platform Y".

In the simulation there is a lot of math involved, including
circuit/component models and numerical methods. I recommend to
familiarize yourself a little bit with the theory, in order to
understand what's happening in KTechLab in simulation.
There is some documentation about the internals of KTechLab on the wiki:
https://github.com/ktechlab/ktechlab/wiki
It is not complete by far, but it can be useful.

About adding new features, there have been some ideas floating around,
feel free to take inspiration from:

https://github.com/ktechlab/ktechlab/wiki/Feature-Requests

https://sourceforge.net/p/ktechlab/feature-requests/



> No problem about the e-mail format. One of my completion of course work proposals envolves a OpenCl-based filtering of ECG signal. I was having some problems loading the data in the device with C++, so I forgot that project. My final project now is only the circuit of a electrocardiography with a real-time plotting Qt gui. I saw that ktechlab was developing for Qt4. I think that its a pretty good idea


About plotting: currently there is a time-vs-value plot in KTechLab,
in real-time, but there is also an oscilloscope-like view, which as
far as I know does not work. That could be also fixed.

> I am thinking, the algoritms probably work with state equations in matrix's and differential equations. So its a good start studying component models and matrix circuit solutions?

Approximately yes, it works with state equations. The differential
equations are solved iteratively. Yes, I think is a good idea to start
studying how such circuit solving works.


> A big improve it will be a simulation program that solves matrix problems with OpenCl or Cuda based algorithms. I don't know any Windows circuit simulation program, like NI Multisim, that do this kind of thing.

I find this interesting, too. In your master studies it might be
feasible to try to solve circuits with GPGPU -- OpenCL (or Cuda, but
that's proprietary AFAIK...) --. As a first step I recommend to just
try to solve a matrix equation with GPGPU, and then try a whole
circuit model. Maybe linear only first, then components with state,
and there are non-linear, too. Note that the solving of circuits with
non-linear components requires iterative approach, so it would be
interesting to see if only the solving of the matrix is offloaded,
then the performance is increasing, or not really.

If you are selecting your courses for your master studies, then for a
particular course hopefully I can tell how it is related to the
workings of KTechLab.


Best regards,

 Zoltan



2016-08-27 22:13 GMT+03:00 Mathias Scroccaro <mathias.scroccaro at gmail.com>:
> Hello Alan,
>
> No problem about the e-mail format. One of my completion of course work
> proposals envolves a OpenCl-based filtering of ECG signal. I was having some
> problems loading the data in the device with C++, so I forgot that project.
> My final project now is only the circuit of a electrocardiography with a
> real-time plotting Qt gui. I saw that ktechlab was developing for Qt4. I
> think that its a pretty good idea
>
> I am thinking, the algoritms probably work with state equations in matrix's
> and differential equations. So its a good start studying component models
> and matrix circuit solutions?  A big improve it will be a simulation program
> that solves matrix problems with OpenCl or Cuda based algorithms. I don't
> know any Windows circuit simulation program, like NI Multisim, that do this
> kind of thing.
>
> Sorry for my english.
>
> 2016-08-27 11:39 GMT-03:00 Alan Grimes <ALONZOTG at verizon.net>:
>>
>> Mathias Scroccaro wrote:
>> > Hi , my name is Mathias , I'm a Brazilian university student. I'm
>> > almost finished my course in electronic engineering and I want to
>> > engage in a master's program . I would like to help improve the
>> > program code and would like to know the best area to study the master
>> > who could contribute positively in the program circuit algorithms.
>> > Congrats for the already developed code, Mathias
>>
>>
>> My e-mail program is having trouble with this message for some reason,
>> my apologies for formatting issues. =\
>>
>> In response to your question, many long years ago I went through the
>> code, focusing on the simulator, to improve the code, I was expecting a
>> gui re-write so I left most of the gui code alone.
>>
>> Once again, it's been years since I've spent time with the code. To the
>> best of my recollection, the biggest simulator issue is reviewing the
>> models.
>>
>> Lets say you had a circuit with a generator powering a resistor and a
>> chain of two resistors. So you have two current branches, you need to
>> compute two currents, and then you can derive the third current from
>> that, So you have three current branches... Current nodes are voltage
>> points so you have three of those two, the top of the generator, the
>> bottom of the generator, and the node between the resistors...
>>
>> The branch with the stack of resistors is interesting because you only
>> need to compute the current of that branch once. So you need to figure
>> out where you need to compute currents and select the best part to use
>> as a current probe.
>>
>> Then you need to select which model to use, a model that just computes
>> voltage or one with current too. Several years after working on the
>> code, I bought a book on circuit simulation... So yeah, you have to go
>> through all those equations and check everything.
>>
>> Ktechlab uses a kinda crude numeric integration approach that's almost
>> good enough for low frequency work.
>>
>> Another interesting idea is to look at the crude matrix library that I
>> had written for a university project and then put in ktechlab because it
>> was cleaner than what was there, and see whether an OpenCL-based
>> approach has any benefits.
>>
>>
>> Now if you want to talk about Ktechlab 2.0 then you are talking about
>> solving differential equations to figure out filter characteristics and
>> stuff, probably using one of the more traditional back-ends which are
>> much better developed.
>>
>> --
>> IQ is a measure of how stupid you feel.
>>
>> Powers are not rights.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Ktechlab-devel mailing list
>> Ktechlab-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ktechlab-devel
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Ktechlab-devel mailing list
> Ktechlab-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ktechlab-devel
>




More information about the Ktechlab-devel mailing list