Path extension - Derivative and integrate

Flesh out your ideas for new or improved Inkscape features before submitting a request.
User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Path extension - Derivative and integrate

Postby Grobe » Thu Sep 05, 2013 1:48 am

Hi.

Say I have a path that start on left and going toward right.

I really would like Inkscape to be able to make a derivate path out of the original path. Also it would be great if there was possible to be able to create an integral path from the original path.

I do not expect the integral or derivate output path to be absolutely excact in mathematically terms. A close aproximation would be enough.

For me, the reasons to be able to create a derivate and intregral is this:
I spend some time drawing voltage/time curves. When making timing diagrams, there is always a need for both derivate the curve as well as integrate it. Most cases just for understanding the result. Drawing the derivates and integrals of a curve by hand means I have to guess a lot. Having this to happens automatically would really make my work easier and spare me for some time.
I'm sure I can find more reasons to wish for this.

I'm planning to write a feature request, but I would like to have a discussion around it first. Maybe there is a workaround already, but I cannot anything relevant by googling it. Google just think that I by "Inkscape derivate" means software that shares code or something, making any search result totaly wasted.

Is there any specific details left important to mention in a feature request regarding this?


Thanks
Attachments
Inkscape_derivate_integral.svg
(6.62 KiB) Downloaded 258 times
:lol:

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Path extension - Derivative and integrate

Postby Lazur » Thu Sep 05, 2013 2:08 am

Great idea!

With derivates I have some similar problem on that topic with Cassini-ovals.
The feature you described could possibly give a decent way to draw that.

My guess would be some can relatively easily make an extension to draw the derivate path as there is a python function to get tangents of the curve?
-By the way, if you have a mathematical function for the curve, you can count the derivate function of it online, like here.

With primitive functions I have no clue.

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: Path extension - Derivative and integrate

Postby Grobe » Thu Sep 05, 2013 2:27 am

Lazur URH wrote:-By the way, if you have a mathematical function for the curve, you can count the derivate function of it online, like here.
If I had a mathematical function (oposed to freehand curve like this) I would have used a dedicated software, eg. Geogebra.
:lol:

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Path extension - Derivative and integrate

Postby hulf2012 » Thu Sep 05, 2013 6:24 am

Hello Grobe:
Have you checked this?
http://tavmjong.free.fr/INKSCAPE/MANUAL ... ionPlotter

I've tested after seeing your post. The first derivative option it's just for smoothing the plot of the function

I've tested:
f(x) = x**2 or pow(x,2)
f ' (x) = 2*x
F (x) = pow(x,3)/3

Or do you want something more complex, like an algebraic solver?
EDIT: Now I see your response to Lazur.... So for graphing your function you have a collection of points?
Do you want some script that calculate the first derivade in a numerical point?...
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Path extension - Derivative and integrate

Postby hulf2012 » Fri Sep 06, 2013 2:48 am

Hello:
I have taken a look at this:
Numerical integration:
http://en.wikipedia.org/wiki/Numerical_integration

Numerical differentiation:
http://en.wikipedia.org/wiki/Numerical_differentiation

A library for geometric computations:
http://wiki.inkscape.org/wiki/index.php/Lib2geom
Which it's not actualized since 2009?

- I think that, to begining you have to get a set of points that represents the primitive function
- With that set of points, maybe it's posible to construct a polynomial function
- Derive and integrate that function in a set of points
- On the other hand, your function has discontinuities. It could complicate the solution.

- One of the first steps would be : convert the points of a path-svg into a table of points (x,y or V,t in your case)

- With that table convert it to a polynomial function
- Derive and integrate

Greetings
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

User avatar
Grobe
Posts: 411
Joined: Tue Feb 02, 2010 2:20 am

Re: Path extension - Derivative and integrate

Postby Grobe » Sun Nov 10, 2013 3:50 am

:lol:


Return to “Inkscape Ideas”