in

.NET Opensource

Community for opensource projects by Christoph Rüegg

Integration

Last post 09-28-2006 0:11 by MovGP0. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-13-2006 18:05

    • MovGP0
    • Top 10 Contributor
      Male
    • Joined on 11-21-2005
    • Austria
    • Posts 49

    Integration

    Hi,
    I've thought about Integration in Math.Net. Basically, I think on the Yttrium-Achritecture for doing that. An Architecture for doing Integration should have an Input for the Value to integrate. Also there might be two inputs, one to define the start and one for defining the endpoint of the range to integrate. On the output there is the current value of the range and the result of the integration. The whole thing might look like in the following example:

    Integrate f(x) from x = 0 to infinity:

                    +-----------+
                    + Integrate +
                    +-----------+
    double.MaxValue |           |
    --------------->|to   Result|>------------------------------
                    |           |
           0        |           |
    --------------->|from       |      +----------+
                    |           |      +   f(x)   +
                    |           |      +----------+
           +------->|f(x)      x|>-----|x   Result|---+
           |        |           |      +----------+   |
           |        +-----------+                     |
           |                                          |
           +------------------------------------------+

    I also want it to support even Quaternions as Input, and the Integration-Strategy should be setable with the Constructor. The Problem here is, that I have no Idea to write such an Architecture.

    @cdr: can you help me realizing such a thing? I need your help as Software Architect in that case.

  • 08-14-2006 23:41 In reply to

    Re: Integration

    Yes, that could be interesting. I assume you thought about numeric integration, not symbolic/algebraic?

    Actually, this design is quite complex, as the Integrate part would have to evaluate the function multiple times in its own single evaluation step. While this would work fine with a classic approach, it could become tricky here. That's fine, as it might show some weaknesses of the current yttrium architecture (that hopefully can be fixed)...

    About supporting various input data types: this is an important point of the yttrium architecture: you may change the input type any time, the engine automatically loads an architecture that can handle this type (however, you may loose state - obviously). You may also design the architecture to support a more general data type, e.g. any type with a special algebraic structure (e.g. Field, or VectorSpace), or to make it invariant, so it accepts any input types.

    In yttrium you may construct architectures manually, but they're usually automatically created for you, so configuring it in the constructor may be problematic (if you don't want to abandon this automatic construction). Alternatively, you could configure it with a special config input signal.

     

    Btw, what I had in mind about integration up to now:

    • Various (classical) numeric integration algorithms in Iridium (in the MathNet.Numerics.Integration namespace) (no Yttrium)
    • Symbolic Integration for Yttrium, in the Std-package, similar to the Diff/Derive implementation
    • Integration in a signal processing style, in the (Yttrium-based) Neodym Project. (Direct, maybe also a "running window" version)

    The last one (Neodym) looks similar to your idea, but is online instead of offline. That is, you just feed it with timed samples and it returns the current "running integral".

    Neodym A: 


                       +-----------+
                       + Integrate +
      Signal Source    +-----------+   "Current Running Integral"
    ------------------>| in    out |>--------------------------------->
                       |           |
                       +-----------+


    Neodym B:

                  +-------+      +--------+        +-----------+
                  + Clock +      + Signal +        + Integrate +
      Frequency   +-------+      +--------+        +-----------+
    ------+------>|  tick |>---->| clk    |        |           |
          |       +-------+      |    out |>------>| in        |   Running Integral
          +--------------------->| f      |        |       out |>--------------------->
          |                      +--------+        |           |
          +--------------------------------------->| f         |
                                                   +-----------+

    Neodym C:

                  +-------+      +--------+        +--------+      +-----------+
                  + Clock +      + Signal +        + Window +      + Integrate +
      Frequency   +-------+      +--------+        +--------+      +-----------+
    ------+------>|  tick |>---->| clk    |        |        |      |           |
          |       +-------+      |    out |>------>| in     |      | vector    | 
          +--------------------->| f      |        |   vect |>---->| in    out |>-->
          |                      +--------+        +--------+      |    scalar |
          +------------------------------------------------------->| f         |
                                                                   +-----------+

  • 09-28-2006 0:11 In reply to

    • MovGP0
    • Top 10 Contributor
      Male
    • Joined on 11-21-2005
    • Austria
    • Posts 49

    Re: Integration

    I've thought about this issure again. Integration is not that simply than setting up a formula with elementary operators. Instead its more like applying an algorithm.

    Symbolic solving might require to apply an kind of Tree-Walker-Algorithm which looks for--and removes--expressions that are keeping constant, while transforming expressions which are not.


    btw.:

    when you set up a basic operation like x=y+z, you're afaik creating a factor-graph, and therefore something like:

    x → Add
    Add → y
    Add → z 

    But, x=y+z implies also y=x-z and z=x-y, so I think it might make sense to set up all this possibilities during the setup. Therefore creating the above expression might look like:

    Variable x = new Variable("x");
    Variable y = new Variable("y");
    Variable z = new Variable("z");

    Add(ref x, ref y, ref z);

    z.Formula().ToString(); // returns "z = x+(-y)"

     Without need to solve the Formula, because the Function "Add" sets up the following Net:

    x → AddYZ
    AddYZ → y
    AddYZ → z

    y → AddXZ
    AddX → x AddX → NegateZ
    NegateZ → z

    z → AddXY
    AddX → x AddX → NegateY
    NegateY → y

    This will come with a memory-cost, because additional Operator-Objects and Pointers neet do get created, but therefore you get less computation and Pointer-Handling -- which results within more speed.

Page 1 of 1 (3 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems