LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Symbolic differentiation

I am looking for a LabVIEW 6i VI that can perform symbolic differentiation. So far I have found nothing. Any ideas?

In the mean time have worked on my own implementation and it seems to work fine. But I need to add more "recognition" parts in it before it is ready.

If there is an interest in having this VI (set of VIs) as a common resource, let me know and we can jointly make this happen. /Mikael Garcia
0 Kudos
Message 1 of 13
(4,338 Views)
Could you please elaborate on what is "symbolic differentiation"? Is that similar to MATLAB handling of symbolic equations?

Certainly, I am willing to help to make this happen!

E. Vargas
www.vartortech.com
0 Kudos
Message 2 of 13
(4,338 Views)
Enrique,
That is great! What I mean is that if you have a string that is "sin(x^2)+y+z" and ask for the derivative with respect to "x", you get the string "cos(x^2)*2*x".

So far I have a set of VI's that can do exactly this for almost all mathematical functions. I have also added some tricks to get nicer results like:

0*x*sin(x)*exp(x+2) ->0
1*x+3 - > x+3
(x+2)^1 -> (x+2)
and so on.

However, we still need to test it in more detail, take care of errors in a better way, and add the remaining functions.

How do you want me to send you my VI's? As a .llb file in an email?

/Mikael
0 Kudos
Message 3 of 13
(4,338 Views)
You can link to Mathematica and do any manner of symbolic
manipulation I think. Integration would be handier than differentiation
for me at least.I have never used pure differentiation due to noise
problems.




Mikael Garcia wrote:

> Enrique,
> That is great! What I mean is that if you have a string that is
> "sin(x^2)+y+z" and ask for the derivative with respect to "x", you get
> the string "cos(x^2)*2*x".
>
> So far I have a set of VI's that can do exactly this for almost all
> mathematical functions. I have also added some tricks to get nicer
> results like:
>
> 0*x*sin(x)*exp(x+2) ->0
> 1*x+3 - > x+3
> (x+2)^1 -> (x+2)
> and so on.
>
> However, we still need to test it in more detail, take care of errors
> in a better way, and add the remaining
functions.
>
> How do you want me to send you my VI's? As a .llb file in an email?
>
> /Mikael
0 Kudos
Message 4 of 13
(4,338 Views)
Yes, I also thought about linking to another application. That is also a good solution. However, the obvious drawback for me is that then the user has to have that software installed in order to run the LabVIEW program. To make it pure LabVIEW is a better solution for me.

Noise problems? I guess you mean if you do it numerically, or? /Mikael
0 Kudos
Message 5 of 13
(4,338 Views)
Mikael Garcia wrote in news:506500000005000000203E0000-
993342863000@exchange.ni.com:

> Yes, I also thought about linking to another application. That is also
> a good solution. However, the obvious drawback for me is that then the
> user has to have that software installed in order to run the LabVIEW
> program. To make it pure LabVIEW is a better solution for me.
>
> Noise problems? I guess you mean if you do it numerically, or? /Mikael

I can almost guarantee that programming labview to do this will be more
expensive than buying a licensed copy of a Maple-based program for each
machine than you need this to run on, unless time and money are no concern.

Perhaps there are some "free" programs that will serve wel
l. Python is a
powerful scripting language that seems to have some symbolic math libraries
available. I believe Python supports "com" communication with other
applications. Search for "Python symbolic math" in google and see what
comes up. Getting this up and running may not be simple, but it will be far
simpler than building a symbolic processer in labview.

Scott
0 Kudos
Message 7 of 13
(4,338 Views)
Scott,
I absolutely agree with you. Linking to another software is by far easier. However, although this might sound like a mega project, it is not! I am surprised how simple my implementation turned out to be... /Mikael
0 Kudos
Message 8 of 13
(4,338 Views)
Here is my email address:

mikaelgarcia@canada.com

With your help I am sure we can make a nice piece of software to upload as a resource here on DE.

/Mikael
0 Kudos
Message 6 of 13
(4,338 Views)
Regarding the use of external software on this, if you are going to go to that length, I would use HiQ. I am certain it has a very fleible licensing agreement, and it's already on the LabVIEW installation disk. However; I agree with the notion of keeping it in LabVIEW. Simplicity is the greatest strength of a program or project.

I would still be curious to know what symbolic differentiation is though, didn't really see a good explanation in the thread.
0 Kudos
Message 9 of 13
(4,337 Views)
Yes, my explanation of what I am trying to do was not the best. Let me give it a new try.

In LabVIEW 6i there is a VI for taking a derivative of a function numerically. You can provide the VI with a function, f(x), as a formula string and you can get the numerical derivative, f'(x) at any point (x).

However, for higher order of derivatives or for special applications, the numerical derivative might not be enough. That is why I would love to have the ability to get the exact expression (function) for the derivative. With such expression one can calculate the exact derivative and take higher order of derivatives , f''(x), f'''(x) without suffering from the limitations that the numerical derivatives have.

In other words, what I am trying to do is to ha
ve a VI that knows all the rules of algebra and gives me the derivative as a formula. /Mikael
0 Kudos
Message 10 of 13
(4,337 Views)