Artichoke, and resuming Revit API development – Part 1
It has been a very long time since I last posted. It was a very busy period and it is just this time that I got myself a time to do new post.
Very recently, I pursued a temporary work through Upwork that uses my Revit API development abilities. Fortunately, I was able to pull off the project with little revisions after testing. It was a difficult project however because I have to create algorithms and comply to all the requirements they need, which Revit API alone cannot provide.
But I somehow need to rest for a few weeks before I resume another set of projects coming from the country where I am now.
I am so happy to be back to developing programs with Revit API.
And so with Dynamo packages. That is why I made major updates to Rutabaga and created a new package named Artichoke.
Artichoke is just a package used for those who like to experiment on much sophisticated mathematics like calculus, Fourier, 1/f spectrum, intermittent chaos and quaternions (yes, quaternions)! This package uses MathNet.Numerics and MathNet.Symbolics. Before, the Fourier nodes were included in Rutabaga. But since I want to dedicate Artichoke to all mathematical nodes that I made and will make, I removed the Fourier nodes from Rutabaga (and I will update this later in the Dynamo Packages) and transferred them to Artichoke.
To explain what Artichoke does, let us start with the Calculus nodes.
Calculus has four nodes, namely:
DerivativeFirst = acquires the first derivative of the equation passed through and get the value from the differentiated equation.
Derivative = gets the value of the derivative of the equation passed in a certain order.
PartialDerivativeBi = acquires the value from the partial derivative of an equation with two variables, on a certain order and which index should be set constant (0 for x and 1 for y).
IntegralDefinite = acquires the value from the definite integral of the equation passed.
All the nodes must have equations (that are strings) that only have one variable named ‘x’, except for PartialDerivateBi that requires two variables named ‘x’ and ‘y’. These are the only conditions for using these nodes.
To set the right notation for the equation needed by the nodes, we do it this way. Let us say you have an equation like
x3 + 3x2 + 6x + 9
The notation for these equations shall look like
Wherein the caret (^) sign indicates the following number is an exponent to the preceding number, and the multiplication of two numbers must have an asterisk (*) between them.
Bringing this equation to three nodes as shown below:
will give us the solutions and answers in the below image.
Note, however, that there are issues with regards to the rounding off of numbers as results of the nodes. But, nevertheless, the answers are right.
One good thing when using the DerivativeFirst node is that it also returns the derivative of the equation as a string value. As of this posting, we can re-use this value to re-evaluate for its derivative. But I have in mind now that it is possible to reiterate this value to what order the derivative is set. So a possible update will come very soon.
Next, we look at the partial derivative node.
In the figure below, I am getting the value of the partial derivative in terms of y (which is set here as a boolean to “false”).
So the value of the partial derivative based on the conditions given above will be:
Using the same script above but setting the left Boolean node value to True will give an answer of 99.
In the next post, I will be discussing about Quaternions using Artichoke.
By the way.
For those of you who are waiting for the updated version of Celery, I am still making things work properly as I am upgrading the package to its new version, in addition with new nodes and new features in some of the nodes. Stay tuned.