ModelingToolkit V11 Library Split and Licensing, Community Feedback Requested

MTK base is not GPL licensed. What you (and everyone else in this thread) needs to do is check if your models are higher index DAEs, because then you will be affected. How to check this is still unclear to me.

Just to be clear, the artifact/output in this case is an executable binary/library.

My understanding is it would be considered a derivative according to AGPL.

Yes. If they can request all the source code of the simulator, then I would need to first ask for permission to use this framework. Furthermore, there will be parts impossible to share due to NDAs. Hence, if this is the case, it will be a no go for me unfortunately.

Above quote from the AGPL is extremely clear:

The output from running a covered work is covered by this License only if the output, given its
content, constitutes a covered work.

The fact whether or not your compiled model was generated using MTK has no bearing on whether it is covered.

It is covered only if it consititutes a covered work due to its content.

I gave several examples how this could be. For example, docstrings for various MTK things. If you redistribute a model, and this model contains copy-righted docstrings / text assets from MTK, then you need to comply with copyright on these docstrings, irregardless of whether you ran MTK and it auto-generated these docstrings from its text assets or whether you never ran MTK and just copied the MTK docstrings (and lawyers must lawyer about the situation if you generated your docstring via LLM that happened to reurgitate the MTK docstrings!).

It does not matter whether the output of the consulting work is software or reports. The only thing that matters is whether the deliverable is derived from MTK or output of MTK.

If you compile your proprietary C code with GCC, then you get software that is output of GCC and GPL demands nothing. If you compile gcc with gcc, then you get software that is both output and derived from GCC and you must compy with GPL. If you compile your proprietary C++ code with GCC, then you get software that is output of GCC and derived work of GNU libstdc++, and thanks to the ā€œruntime exceptionā€ GPL demands nothing.

Whether you use or not use MTK to generate your deliverable, or whether your deliverable is software itself, is entirely irrelevant. You must look at your deliverable, and ask: ā€œBy its contentā€, if you had typed this by hand, after having read MTK source code, would it be considered a derived work?

If this hypothetical by-hand process would involve copying significant parts of MTK internals, then the answer is yes. If this hypothetical by-hand process only involves running some algorithm conveniently implemented by MTK on your customers data, then the answer is no.

I think this applies to your case, taken from here → GPL FAQ

In what cases is the output of a GPL program covered by the GPL too? (#WhatCaseIsOutputGPL)

The output of a program is not, in general, covered by the copyright on the code of the program. So the license of the code of the program does not apply to the output, whether you pipe it into a file, make a screenshot, screencast, or video.

The exception would be when the program displays a full screen of text and/or art that comes from the program. Then the copyright on that text and/or art covers the output. Programs that output audio, such as video games, would also fit into this exception.
…

Since you say the users will be only be interacting with the output like documentation and data sheets, the output itself is not GPL unless you are including the code with it.

2 Likes

If you stick the data you generate into an open source database (say PostgreSQL), and then monitor the open source data base with another open source program, say Lazarus, and have Lazarus send out the emails, then if I read this thread correctly, there would be no possibility of infringement, at the cost of additional complexity?

1 Like

Hum, interesting! However, I need to verify if this additional complexity is worthy given the migration cost to MTK.

Indeed, but my understanding from following the thread is that there are only a fraction of users who would need the AGPL tools. So unless you are part of the group that needs to do the high order modeling (as explained by Chris in earlier posts), then the part of MTK you may remain MIT licensed and you have nothing to worry about.

1 Like

@Ronis_BR we can take a look at your current codes, but if it’s related to the controlled ODEs you were doing before, I would be surprised if you needed more than MTKBase.

Nice! Thanks @ChrisRackauckas. Yes, I started to migrate that satellite simulator I presented in JuliaCon. I will check if everything I need is in MTKBase.

Wondering if the license at https://sleef.org/ is of value in your thinking?

1 Like

Hi! I just want to add a feedback here to help future users.

I checked if MTKBase was sufficient to migrate all our satellite AOCS simulators to MTK. Regrettably, the answer is no.

Our system is huge, and I encountered numerous errors. Subsequently, I attempted to simplify the algorithm to identify the root cause. Eventually, I arrived at this minimal working example, which is a simple RL circuit:

using OrdinaryDiffEq
using ModelingToolkitBase
using ModelingToolkitStandardLibrary.Blocks
using ModelingToolkitStandardLibrary.Electrical
using ModelingToolkitBase: t_nounits as t

@component function MagneticTorqueRod(; name, R::Float64 = 10.0, L::Float64 = 0.1)
    @named voltage = Constant(k = 10.0)

    @named source = Voltage()
    @named resistor = Resistor(R = R)
    @named inductor = Inductor(L = L, i = 0.0)
    @named ground = Ground()

    equations = [
        connect(voltage.output, source.V)
        connect(source.p, resistor.p)
        connect(resistor.n, inductor.p)
        connect(inductor.n, source.n)
        connect(source.n, ground.g)
    ]

    return System(equations, t; name, systems = [source, voltage, resistor, inductor, ground])
end

@mtkcompile sys = MagneticTorqueRod()

prob = ODEProblem(sys, [], (0.0, 1.0))
sol = solve(prob, Tsit5())

This example works perfectly if we using MTK v11. However, if we use MTKBase, I get the following error:

ERROR: LoadError: Cyclic guesses detected in the system. Symbolic values were found for the following variables/parameters in the map: 
inductorā‚Špā‚Ši(t)  => inductorā‚Špā‚Ši(t)
resistorā‚Špā‚Ši(t)  => resistorā‚Špā‚Ši(t)
inductorā‚Šv(t)  => inductorā‚Šv(t)
sourceā‚Špā‚Ši(t)  => sourceā‚Špā‚Ši(t)
sourceā‚Ši(t)  => sourceā‚Ši(t)
sourceā‚Šv(t)  => sourceā‚Šv(t)
sourceā‚Špā‚Šv(t)  => sourceā‚Špā‚Šv(t)
inductorā‚Špā‚Šv(t)  => inductorā‚Špā‚Šv(t)
groundā‚Šgā‚Ši(t)  => groundā‚Šgā‚Ši(t)
sourceā‚Šnā‚Šv(t)  => sourceā‚Šnā‚Šv(t)
resistorā‚Šnā‚Ši(t)  => resistorā‚Šnā‚Ši(t)
resistorā‚Špā‚Šv(t)  => resistorā‚Špā‚Šv(t)
sourceā‚Šnā‚Ši(t)  => sourceā‚Šnā‚Ši(t)
resistorā‚Šv(t)  => resistorā‚Šv(t)
inductorā‚Šnā‚Ši(t)  => inductorā‚Šnā‚Ši(t)
resistorā‚Šnā‚Šv(t)  => resistorā‚Šnā‚Šv(t)
resistorā‚Ši(t)  => resistorā‚Ši(t)
In order to resolve this, please provide additional numeric guesses so that the chain can be resolved to assign numeric values to each variable. Alternatively, the `missing_guess_value` keyword can be used to set a fallback guess for all variables. The keyword must be passed an instance of the `MissingGuessValue` sum-type.

After receiving significant assistance from @cryptic.ax, I managed to ā€œfixā€ the issue by using the keyword missing_guess_value = MissingGuessValue.Constant(0). However, I needed to use a DAE solver like Rodas5P. Regrettably, this approach is not suitable for my original use case. In this simple example, the solver is significantly slower (10x) in the MTKBase version compared to the MTK version.

The drawback here for me is huge. Unfortunately, some part of my contribution to the Julia ecosystem happens as part of my work. Hence, I just cannot use something that can force me to disclose the source code given the current applicable law in Brazil. To do that, I will need to pursue a permit that will likely be denied.

I completely understand the business decision behind this. However, I wanted to point out that I was about to initiate a project to integrate SatelliteToolbox.jl into the MTK ecosystem, enabling users to conveniently work with satellite modeling and design within the MTK environment. Consequently, I will suspend this activity as I won’t be able to incorporate it into my daily routine.

11 Likes

This is very unfortunate. I suspect it will be a similar story for other use cases involving electrical circuits. Perhaps this is something structural that can still be addressed in MTKBase?

That is not the only option you have, even if you are forced to use the GPL version of MTK.

Are you working at a University? I am in the fortunate position of being able to publish most of my (paid) work under an open-source license. Only if I work on projects with commercial partners is this not allowed. Sometimes I try to split projects: keep the simulation core open source and develop closed-source software on top of it for the commercial partner. Not sure if that would be allowed with the new MTK library.

Hi @langestefan !

I think I did not understand.

I work at a research institute of the Brazilian government. I can contribute (during paid hours) to any open-source project given that this work is somehow used in the projects we are current working on. With the new MTK licensing, I cannot use this library on some internal projects because theoretically people can request the source code of what I am using. The downside is that I will not be able to contribute to the ecosystem during paid hours, only in my free time.

You maybe be able to buy a license from JuliaHub that does not require publishing the code. I’m sure an arrangement can be made?

Things are not that easy. Since I work for the government, I have to follow some legislation (and some are very archaic). For example, it is nearly impossible to buy software that does not have a perpetual license (like a signature). I also need to justify why I am buying a software where there are open-source alternatives.

Since it is so difficult to give the work back to the community, I arranged with my institute that I can use a small part of my paid time to contribute to the ecosystem as long as the work is related to what we need in the institute. That’s how SatelliteToolbox.jl, SatelliteAnalysis.jl, and even PrettyTables.jl could reach the current state.

5 Likes

I understand it’s not easy. But is at least an option worth exploring. And if you are succesful, then others can benefit from that as well.

What about AGPL + commercial license if a company does not want to comply with the AGPL license?

One problem is that until now, JuliaHub has not sold licenses for particular components like MTK11 separately. You always have to buy a cloud-hosted one-year license for everything, including Dyad and whatever. This is something other vendors do better (in the sense of being better for small companies and projects).