Modeling and simulating physical objects is a very popular scientific research method. Generally speaking, this application can be implemented using C language or Matlab . As a programming language, LabVIEW can also easily build models, especially the Simulation Module of 8.2 , which makes simulation modeling more convenient and intuitive. This article will take the implementation of a bouncing ball model as an example to introduce three ways to use LabVIEW to build models.
1.
Simulation Module
The Simulation Module is relatively new to LabVIEW , but I believe it will have more powerful functions in future versions and will be more complete and easy to use. The program for modeling an elastic ball using this module is as follows:
As you can see, the entire model has three adjustable parameters: elastic coefficient (the ratio of the ball's velocity to its original velocity when it hits the ground), initial velocity, and initial height. In the Simulation Loop , the gravitational acceleration g is first integrated to obtain the velocity value, and then integrated to obtain the position value. It also determines whether the position has passed the 0 point (i.e., whether it has hit the ground). If it has passed the 0 point, the velocity is multiplied by the elastic coefficient and the position is reset to 0 .
2.
G Code
Without the Simulation Module , this simple physical model can be simulated using only LabVIEW G code. The following figure is a program written in LabVIEW :
As can be seen from the figure, we use the For loop to make the simulation loop count 200 times , and the dt of each time is 0.1 . According to dt and the physical dynamics formula, we can get the current speed and position information, and then perform the zero detection as in the previous example, and perform the corresponding operation. It can be seen that programming with LabVIEW is a little cumbersome, mainly because there are too many mathematical operations, which makes the entire Diagram occupy too much space.
3.
Mathscript
Mathscript
is also
a new feature of
LabVIEW 8.2
. Currently,
LabVIEW
advocates a mixed programming method of text and graphics, which can take into account the advantages of both programming methods and maximize development efficiency. The following figure is
a simulation code written
in
Mathscript
:
The entire Mathcript code is m - code, that is, as long as you can run these codes smoothly under Matlab , 90% of them can be directly pasted into this node to run. If you study the program carefully, you can see that its operation method is similar to that of G Code , but because of the use of text programming, the code is more efficient, which is also the biggest reason why hybrid programming is used.
The following is a comparison of the results of these three simulation methods:
It can be seen that the algorithm of Simulation Module uses the professional Rounge-Kutta calculation method (ie Solver ), so it can be confirmed to be reliable in the actual simulation results. Then the other two methods can also make their simulation effects close to Simulation Module under the condition of reducing dt .
To summarize, modeling with LabVIEW is a relatively new method at present, but because LabVIEW has very powerful data acquisition functions, interface functions and other advantages, if these are integrated with modeling, it is very convenient to carry out advanced applications such as rapid prototyping and hardware-in-the-loop testing.
Previous article:Amplitude and phase difference measurement based on Labview
Next article:Research on Timing in LabVIEW
Recommended ReadingLatest update time:2024-11-16 22:48
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Arduino Nano collects temperature and humidity data through LabVIEW and DHT11
- Modern Testing Technology and System Integration (Liu Junhua)
- Computer Control System Analysis, Design and Implementation Technology (Edited by Li Dongsheng, Zhu Wenxing, Gao Rui)
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- I recently found an article (PPT) to solve the EMC problem of a certain system. I just found it after exploring a little bit (share it...
- Serial port sending and receiving string examples
- Radio information
- Force value jitter problem
- VGA Chinese Character Display.pdf
- Seeking guidance, a few questions about RA2A1's SDADC
- Mother's Day is coming, what do you have to say?
- Four-tube buck-boost converter FSBB
- PCB Handbook: Eliminate Schematic Design Errors with Automated Verification | Mentor Prize-giving Event
- 6ull mini board size