# Solving a system of three ordinary differential equations

Hello Everyone,

fist of all thank you for this community, I use touchdesigner since about 2 years mainly to create live visuals / effects for VJing. Now I want to dabble a bit more in installation related stuff.

So far I managed quite ok with TD and learned most of what I know by now from tutorials and as a “passive” member of the forum, but now I need your help

I want to visualize a Lorenz System, by drawing a point or a line in SOP, but I do have an issue in calculating the ordinary differential equations that is the bases of the system.

I so far tried python scripts but I do not know how trigger the script every frame. I also tried to work with the feedback chop and created the formula with chops.

My goal is not to calculate all possible solutions at ones for a given time frame, but solve the equation numerically every frame to draw the next position.

I somehow miss one key component to get it running.

Does someone of you a resource where this topic might be covered? I would welcome any hint

Best
Laxaman

Not sure if it helps for specifically what you’re doing, but there are a number of Lorenz/Strange Attractor examples, tutorials and repos to be found here and elsewhere online made in Touch.

To get a python script to run every frame you would use an “execute DAT” set to start or end frame run ( depending on what you need to update/use, sometimes I use both). You can write your code directly in that DAT under the applicable callback, import another, run another DAT’s code within that callback, anything really, and then use it to manipulate whatever ops you need to load/store info for your equations.

1 Like

Thank you for the input with the “exectue DAT”. Thank you for the hint that it is already a “solved problem”, I will keep it as a back up. Currently I’m still trying to figure it out by my self as a learning challenge.

Hello,
I have worked on it some time ago. I remember it was useful to use the parametric version of the Lorenz equation, using time as parameter in a compute shader.
My friend Jive Faury made a .tox version of his work on it, here:

1 Like

That is a very nice set up, thank you for sahring!