Dynamo for pure math, geometry dynamics or physics?

Dynamo is great and thanks to its all creators. It is now for revit but it might extend its graphical hand to portray pure math, geometry and specially physics and dynamics. I had this dream for long that if software s could measure various parameters of physics as well action-reactions between bodies or portray all theorems of geometry and math etc. Already we have lot of games where objects thrown and collides but those are controlled by pre-codes and probably lot of softs might exist for this purpose (please let me know some of their names and functions in short). Anyway I feel that dynamo could fill the gap with its ease of use character!!

Certainly could be done. Just need to get the formulas listed and created. I think that most of core parts for a physical interaction already exist (time exists, vectors exist, forces are just numbers with a unit applied…). Some one just hast to wire them up and have some custom nodes created…

Maybe try taking a stab at one and publishing the results?

1 Like

@jacob.small right you are. The core part almost done but i am poor in coding :slight_smile: so i like to attract the coders of this community to throw their challenge to create dynamo-physics etc.

Got a first attempt for review? Or at least a list of formulas you’d want/need?

@jacob.small Hi so many thanks.
We might start with basic theorems of all disciplines and we may start with
Al zebra> (a+b)^2=a^2+b^2+2ab
Physics> F=ma
Geometry> a^2+b^2=c^2
etc.

Not sure if there is a need for these due to the simplicity and VERY basic coding dynamo skill set to create them from scratch. Also most of us are looking at dynamo from an AEC perspective and i don’t see these helping much if any in that industry…

That said, if you need it, and don’t have the coding chops just yet, here is a starting point for you to try to build on. Pardon the spelling errors which i’m sure are present.

Solving for legs:

Algebraic proof:

Force equals mass times acceleration:

1 Like

@Geom_On_Axis,

If you are doing physics/math/geometry dynamo is great. You can do it all with Dynamo nodes, but when you get familiar with coding I think you’ll fiind it easier to write expressions. For example, take the Superellipse (A very popular geometry in sports stadia)…

Wolfram Maths - Superellipse

you can express this quite easily in Dynamo. The following link is done in grasshopper, but can be translated to Dynamo as the two programs are very similar…

Think Parametric - Superellipse

But you could write the whole thing in code, which I find more efficient…

import clr
import math
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#Input Variables...
x = IN[0]
y = IN[1]
n = IN[2]
#Array storage for each quadrant...
q1 = []
q2 = []
q3 = []
q4 = []
#Point Array for sorted points...
pts = []
#crv = []
#Point location function...
def makePt(o, x, y, n):
	p = Point.ByCoordinates(x*(math.pow(math.cos(o),2/n)),y*(math.pow(math.sin(o),2/n)),0)
	return p
	
def cullAndFlip(ptList):
	arr = []
	arr = ptList
	arr.RemoveAt(0)
	arr.reverse()
	return arr	

i = 0
while i < 41:
	#Define resolution...
	o = ((math.pi/2)/40)*i
	#Make Points...
	q1.append(makePt(o, x, y, n)) #Quadrant 1
	q2.append(makePt(o, x*-1, y, n)) #Quadrant 2
	q3.append(makePt(o, x*-1, y*-1, n)) #Quadrant 3
	q4.append(makePt(o, x, y*-1, n)) #Quadrant 4	
	
	i += 1

#Order Points...
q1.RemoveAt(40)
q2 = cullAndFlip(q2)
q3.RemoveAt(40)
q4 = cullAndFlip(q4)

pts.append(q1)
pts.append(q2)
pts.append(q3)
pts.append(q4)

pts = [val for sublist in pts for val in sublist]

crv = PolyCurve.ByPoints(pts, True)

#Assign your output to the OUT variable.
OUT = crv

I wrote this years ago as I was getting familiar with Python and math so it’s a little wrong in places, but it works.

I also once created a game of Pong in Grasshopper (and attempted in Dynamo) as I was interested to see if I could do it. This used the most basic vector math and physics. But, the point is that you can do what you want in Dynamo/Grasshopper as long as your logic is good and you understand the content you are creating.

Cheers,
Dan

3 Likes

@jacob.small @Daniel_Woodcock1
Hi all,
probably we are getting the things. Hopefully you could transfer those codes into dynamo 3d…i am interested in that (as Daniel tried in a game). Specially for physics/dynamics, i like to visualize the f=ma theorem. Maybe it could be a cube(m) absorbed a hit(f) by a spheroid etc. Those solids must have the mass(m) etc physical properties/parameters so that different bodies will act differently as well earth’s g-force, even the speed of the air ( too much longing?:)) cud be counted on that event so that we will get the real dynamic dynamo for real world!

Could we bind dynamo with the games already created, (probably not as they are out of IM) so that we wouldn’t need to create solids in dynamo, a time consuming work?

Even i feel that everything in this world is parametric and exists with lot of properties data…so as a data mining soft, dynamo could be used as bio-dynamo (for medical), mecha-dynamo (for mechanical) etc!
That’s why could these wish list might be counted by the coders of dynamo as real projects to do?
Thanks again.

While you could do all this in Dynamo, I’m not sure it would be the best environment if you want to show dynamic physics. Sure, it is possible. There is an example of mesh being animated with a sin function in the Dynamo Zero touch examples. And I have animated stuff in Dynamo too, but if I were to be doing Particle studies like fluid dynamics or kinematic behaviour of colliding bodies I would use programs like processing 3.0 or a gaming engines like unity unless I just wanted to calculate a resultant vector or final position. In my opinion, there are far better geometry engines.

But unfortunately this is all done in code (Java specifically - which is very much like C#). I would wholeheartedly suggest you learn programming basics. Daniel schiffman has a great book that I encourage all reading this to buy (or read free online - but I much prefer a book) called “The Nature Of Code”

http://natureofcode.com/

He covers simple vector math to genetic algorithms to fractal math. He also has a YouTube channel called “The coding Train” (previously known as Coding Rainbow", while he is somewhat eccentric, he is very good and you will learn lots if you want to.

You can also look at Executable.io, part of ModeLab (who makes the Dynamo and Grasshopper Primers)…

http://executable.io/blog/

At this point in time, the fist blog post you see is about collision of solid bodies, and is done using processing 3.0 I believe. Processing is very good for simulation, but downside is that you need to know how to code - it’s not as hard as it looks! :wink:

Hope this helps,
Cheers,
Dan

4 Likes

@Daniel_Woodcock1
Hi Daniel,
Lot of thanks to you as i learned a bit of coding environment and about creators from your valuable post as well insisting me to learn the gems! I should make time to feel the real world digitally. In future please don’t forget to share more regarding this.
Thanks again.

1 Like

@Daniel_Woodcock1
H Daniel,
Probably i am missing another point to clear myself. From your last reply, it is obvious that Dynamo might not be perfect for dynamism to portray kinematic behavior of colliding bodies and you mentioned rather processing 3.0 or other gaming engines like unity etc.

But as of now dynamo is extracting data from revit, so my another intention was that if dynamo could be binned or used with processing 3.0 or other dynamic geometry engines to extract data?

Cause is that, revit is busy to build parametric assemblies with some data and math functions while dynamo extracting all its internal news to us as well becomes a good producer of math based geometries with numerous variations to use back in revit!

So i feel if dynamo could assist those dynamic geometry engines (those are busy in producing the mathematical animations of object behaviors) to extract all their related data for a specific time-event? So we might get dynamo-unity etc like dynamo revit? Though am not sure if those dynamic geometry engines are self-sufficient in re-leaving our all data of interests and dynamo could make its journey to the fourth dimension?!

I believe you’re looking for a workflow using project stingray. Sadly I haven’t done much of anything with it.

http://inthefold.autodesk.com/in_the_fold/2015/08/autodesks-stingray-engine-will-take-design-visualization-to-a-new-level-for-aec-industries.html

@jacob.small
Hi jacob, stingray might add extra dimension for visualization of processing 3.0 or unity> dynamo>stingray or processing 3.0 or unity> stingray>dynamo workflow so far but not sure.

Let’s say we are portraying f=ma theorem in processing 3.0. Now at a certain time of this event, i like to measure the acceleration/time/force/all object’s material properties/speed/ xyz force directions and values/g-force/air or medium’s effect on that event etc data and dynamo could do that job where assuming that processing 3.0 might not be able to dig deep like dynamo or busy in other means. Stingray could help the designer to visualize any changes in real time like if he/she changes the materials/speed etc of event-objects, that could be rendered live in stingray on real time of his changing.

Am i right? But thanks a lot as you probably open up another wing!