From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation Diagram fundamentals help

Gentlemen/Ladies:

I'm really new to LabViow, but basicly need materials for Simulation
Diagrams. I need some sort of starter code along the lines of
an OpAmp integrator (with time constant calculations or inputs) and
the differentiator (with time constant calculations/inputs) circuits
that feed into it. This would simultaneously (1)put me on familiar
ground quickly and (2) move me toward solving a simulation problem.
Neither the User's Manual, the Quickstart guide, or the Tutorial
touched on this and yet this is fundamental to what really needs to be
done NOW where I am that most of the stuff is useless otherwise.

A VI that simulates a linear circuit would, at the least, get
me started.

I suspected getting in contact with LabVIEW
enthusiasts
via "newsgroups" was probably more productive than any
other method of getting valuable information quickly.
I hope I'm not wrong.

2Penny
0 Kudos
Message 1 of 4
(2,468 Views)
Hi,

I think you are having trouble getting started with the integral or differential parts of your equations. If so, please take a look at Integral x(t).vi and Derivative x(t).vi under All Functions>>Analyze>>Signal Processing>>Time Domain. Please be advised that these VIs are not a part of LabVIEW Base package but only come with LabVIEW Full Development System or LabVIEW Professional Development System.

If none of these suggestions help, or if I�m not correctly understanding your issue, please reply with comments or answers to the discussion above and any additional information that may help, and I�ll be happy to look further into it.

Regards,
Ankita A.
National Instruments
0 Kudos
Message 2 of 4
(2,468 Views)
2Penny -
It helps to think of the simulation diagram as a differential equation solver - that is, it is a place for you to describe the differential relationships between quantities that affect your system.

Suppose you want to simulate the response of an LRC circuit, with your output voltage being that measured over the capacitor. In this case, the important quantity you're after is the charge in the capacitor (Q). The relationships are:

LQ'' + RQ' + Q/C = Vin(t)
Vout(t) = Q/C
Q(0) = Q'(0) = 0

You want to separate out the relationships among the derivatives:
Q = integral(Q')
Q' = integral(Q'') = integral((1/L)*(Vin - RQ' - Q/C))


So you can simulate this circuit with two integrator blocks - integrator one takes in a wire for Q' and put
s out a wire for Q. Integrator two takes in Q'' and outputs Q'. The relations above simply say that the input to integrator two (the Q'' input) should consist of feedback from integrator two's output (Q') and integrator one's output (Q).

Hope that makes a little more sense - and I'll grant you that this is a pretty simple circuit. I've attached a VI to demonstrate.

As long as your integral relationships are linear with constant coefficients, as above, you can also use a transfer function to do the integration for you. In this case you would use Vout(s)/Vin(s) = [1/(LCs^2 + RCs + 1)]

I guess the last key thing that I'd say is that in general you want to integrate quantities in order to solve a differential equation - which means that you will use derivative blocks sparingly if at all when building a model for a system.

cheers,
- kevin
0 Kudos
Message 3 of 4
(2,468 Views)
Greetings, 2Penny:

You are right about this forum being the best way to get information in a hurry. There are countless thousands of man-hours of experience right here!
One of the best tools for analog circuit simulation is the FORMULA node. Think of any analog component as a mathematical engine that performs some function upon an input signal. As a ridiculously simple example, you can model an amplifier with a simple multiplication function..i.e., the output signal is the input signal times the gain. As you get more sophisticated, such as adding feedback, of course, the equations will become more complex. However, ANY analog circuit can be represented by one or more formula nodes. I recommend that you look at some semiconductor data books to get
a feel for characteristic curves which can all be modeled with fomula nodes. (True circuit modeling programs like SPICE perform a similar function) Labview traditionally hasn't been the ideal platform for modeling raw components like transistors, being far more at home in simulating SYSTEMS, but it's becoming much better for "low-level" modeling, especially when combined with Matlab and other external engines.
There are a lot of analog modeling examples on this Labview site, as well...although you may have to spend some considerable browsing time.
Hope this has been of some help. Good Luck!

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 4 of 4
(2,468 Views)