Skip to content

Option to render elementary differentials using summation notation #103

@ketch

Description

@ketch

There is one thing that's in the TOMS paper that BSeries.jl actually still doesn't do, which is to write the elementary differentials for an unspecified RHS function $f$ using the notation that is used e.g. in the books of Hairer et. al. -- see column 5 of the table from the paper:
Screen Shot 2023-02-28 at 8 16 32 AM

I would like to add this option. Here's some simple code that generates this as a LaTeX string:

function elementary_differential_string(t)
    indices = ["i","j","k","l","m","n"];
    labels = copy(indices[1:length(t.level_sequence)]);
    edstring = ""
    for i in 1:order(t)
        edstring *= "f^{"
        edstring *= labels[i]
        edstring *= "}_{"
        for j in i+1:order(t)
            if t.level_sequence[j] == t.level_sequence[i]
                break
            elseif t.level_sequence[j]-t.level_sequence[i] == 1
                edstring *= labels[j]
            end
        end
        edstring *= "} "
    end
    edstring = replace(edstring,"_{}"=>"")
    return edstring
end

Before going ahead, I wanted to get your opinion (@ranocha).

  • Is direct string generation the best approach? In principle we could generate the products of partial derivatives symbolically first and then render those. This is more elegant but otherwise I don't see an advantage to it.
  • How should the user specify that they want the elementary differentials in this form? My plan is to implement a global option like the one in RootedTrees.jl for how to render trees.
  • There is a minor issue of needing enough distinct index labels for a given tree. My plan is to just start with "i" and go through the end of the alphabet. In practice it seems unlikely that someone would work with a tree that exhausts this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions