Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

06-26-2018 06:29 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Labels:

Hi,

Can anyone suggest the correct structure of how to solve recursive equations in LabVIEW?

For instance, I would like to calculate the coefficients of g matrix [g_0,g_1,...,g_n]

which can be defined by : please see the attached photo.

Note that g_0=1;

Ameer

Highlighted
Options

**CLA // LabVIEW 2016 // BALUG // GCentral.org // Unofficial Forum Rules and Guidelines // Ask Smart Questions**

06-26-2018 06:36 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

You could use a recursive VI 🙂

Highlighted
Options

06-28-2018 08:00 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

The most straight-forward (but sometimes programmatically challenging) way to solve a recursive problem is, as gregoryj points out, to use a recursive algorithm. In LabVIEW, you do this by making your VI "reentrant".

However, another method that can be a little easier for some problems is to try to transform the recursive problem into an iterative one, as iteration (a.k.a. "looping") is something most languages (including LabVIEW) supports quite well.

Here your best tools are Pencil and Paper. Write down explicitly the formulas for g0, g1, g2, and g3. Notice that each formula can be expressed as a summation between another array, v, the elements of the previously-generated elements of g, and some coefficients that depend on the specific index of g being generated. The only "trick" is that you use the elements of the g array in the opposite order of the elements in the g array, but that's just an "indexing" problem. So an iterative solution to generating, say, N elements of g from N elements of v should be simple to code in LabVIEW once you "see" the iterative pattern.

Bob Schor