September 2005 - Posts

Working with Yttrium
26 September 05 12:11 | admin | 1 comment(s)
The intention "Make the simple things simple and the hard things possible" of the Designing Reusable Class Libraries PDC05 presentation is continuously realized in Yttrium (although some other guidelines are still violated - one of the reasons why I still have not published any code yet). At least many things can be implemented in a general way (thus "hard things" are possible), or one constrains them and profits from lot of support for the simpler cases. If you only want to consume (but not extend) the framework, you work first of all with the classes in the workplace namespace, as well as with the static classes most modules provide (Std in the standard module, Dsp in the Neodym signalprocessing module etc., just like System.Math). You may still dive gradually deeper into the depths of the framework till you finally work directly with ports and architectures.

I've written a small test case (unit tests integrated in VisualStudio 2005), pointing out what such a simple case could look like. The following case tests (among other things) the Evaluate functionality of MathSystems. Of course the asserts are included only to test the correct behaviour...

[TestMethod]
public void SimpleSystemAsFunction()
{
    Project p = new Project();
    MathSystem s = p.CurrentSystem;
    Builder b = p.Builder;
    Context c = p.Context;

    Signal x = new Signal(c); // x
    x.AddConstraint(RealSetProperty.Instance); // x is real
    Signal x2 = b.Square(x); // x^2
    Signal sinx2 = Std.Sine(c,x2); // sin(x^2)

    Assert.AreEqual<int>(0, s.InputSignalCount, "Input A");
    Assert.AreEqual<int>(0, s.OutputSignalCount, "Output A");
    Assert.AreEqual<int>(0, s.BusCount, "Bus A");
    Assert.AreEqual<int>(3, s.SignalCount, "Signal A");
    Assert.AreEqual<int>(2, s.PortCount, "Port A");

    s.PromoteAsInput(x);
    s.PromoteAsOutput(sinx2);

    Assert.AreEqual<int>(1, s.InputSignalCount, "Input B");
    Assert.AreEqual<int>(1, s.OutputSignalCount, "Output B");
    Assert.AreEqual<int>(0, s.BusCount, "Bus B");
    Assert.AreEqual<int>(3, s.SignalCount, "Signal B");
    Assert.AreEqual<int>(2, s.PortCount, "Port B");

    double ret = Math.Round(s.Evaluate(Math.PI)[0],4);

    Assert.AreEqual<double>(-0.4303, ret, "Result");
}

In praxis this will probably more look like the following:

Project p = new Project();
MathSystem s = p.CurrentSystem;
Context c = p.Context;

Signal x = new Signal(c); // x
Signal x2 = p.Builder.Square(x); // x^2
Signal secx2 = Std.Secant(c, x2); // sec(x^2)
Signal diff = Std.Derive(c, secx2, x); // d/dx sec(x^2)
Signal diffSimple = Std.AutoSimplify(c, diff);

s.PromoteAsInput(x);
s.PromoteAsOutput(diffSimple);
s.RemoveUnusedObjects();

ComplexValue cv = (ComplexValue)s.Evaluate(ComplexValue.I)[0];
// cv.Value = 0 - I*5.7649 (Complex Number)
Filed under: ,
Yttrium: New MathSystem Frontend
23 September 05 09:56 | Christoph Rüegg | with no comments
Today I've extended the set of classes you usually work with (most important ones are Project and Builder, both in the Workplace namespace) with a new class called MathSystem. MathSystem encapsulates a system, that is a network of signals and ports, to a kind of blackbox with in- and output signals as well as buses. From the outside, a MathSystem may seem to be similar to a port. Indeed, such a system may be loaded as a CompoundProcess in an architecture and thus into a port, allowing hierarchical modularized systems. Beside, a MathSystem may simply be used as a numeric function by calling the provided evaluate method directly. This method maps the input arguments to the input signals, simulates the system for an instant and extracts and returns the output signal values afterwards. However, such systems do not behave different to signals not part of the systems: all signals in the same context are controlled by the same internal scheduler, whether the signals are part of some systems or not. Another important function of MathSystems is serialization: You may serialize a MathSystem completely to an XML tree, as well as reconstruct a system from such a tree. There are also some other more internal functions, like the deconstruction of signals and ports networks not used any more and reducing scheduling and evaluation cost. Last but not least, MathSystem will play an import role in other workplace classes like MathFunction and Project.
Filed under: ,
New Math.NET website online
13 September 05 04:19 | Christoph Rüegg | with no comments
As announced here I've redesigned the Math.NET website completely, now matching the new developments and architectures. The pages are not finished yet, but complete enough to replace the outdated predecessor, at last:

Math.NET Project

Math.NET Numerics: Iridium
Math.NET Symbolics: Yttrium
Math.NET SignalProcessing: Neodym
Math.NET Symbolics: Classic
Filed under: ,
Neodym: signal processing will be based on Yttrium
06 September 05 10:27 | Christoph Rüegg | with no comments
Today I thought a bit about the Neodym Math.NET signal processing package while going through the documents of an ETH lecture on digital information transfer. It looks as if some of the concepts and formalism could be modelled almost smoothly with the new Yttrium architecture. The numeric and mathematic analytic part is covered at the same time, while we win a lot of flexibility by Yttrium immediately.

 In addition to the previous classes, Neodym will offer an interface with which it can be loaded directly into Yttrium as a module - suitable new parts (like the new information transfer name space for analogous and digital information transmission) will work directly with Yttrium objects like signals and architectures.

Of course it's not a coincidence that the signal processing pakage is well compatible with the new signal based Yttrium architecture ...
Filed under: , ,
Yttrium: Designer &amp;amp; Blackboard Demo
02 September 05 07:53 | Christoph Rüegg | with no comments
Beside of the central Assembly (which contains the Yttrium Core as well as the Std Library module), Math.NET Symbolics: Yttrium also comes with a Designer Assembly, built on top of the Netron Graph Library. This designer is applied, for example, in the Blackboard Demo. Such a grafical interface is more important in Yttrium than it was in the old Symbolics Classic, because the interaction possibilities have increased and due to the introduction of the signals and optional circular systems the complexity has risen, too. Naturally the current development state of the designer does not contain the full functional range yet, and the Blackboard demo is still basically a development and test tool...

The following two Screenshots show the Blackboard demo in action - the first one taken after the automatic simplification of a circular system, the other after the derivation of a trigonometric expression:




Filed under: ,