当前位置:网站首页>Improving the efficiency of randomly generated sphere interference inspection by block division
Improving the efficiency of randomly generated sphere interference inspection by block division
2022-04-21 13:41:00 【soar3033】
Improve the efficiency of randomly generated sphere interference inspection through block division
In material research , Regular use Matlab To simulate various situations of materials —— For example, simulate the distribution of battery particles and subsequent calculation .
In material simulation , Our first step is generally to generate the material to be simulated . One of the methods used is to generate a certain number of particles of specific size at random positions . For example, the following figure looks like :

When these particles are randomly generated , For every randomly generated particle, we have to judge the positional relationship between the newly generated particle and other existing particles , If interference occurs, the newly generated particles need to be regenerated . The time complexity of such a calculation method is O(N!) Of , As the number of particles to be generated increases, the calculation time will become long .
In order to improve the efficiency of calculation , We judge the interference between newly generated particles and existing particles , Block division can be adopted . That is to divide the space into several blocks , Each time, the newly generated particles only interfere with the existing particles in several blocks , In this way , Reduce the amount of calculation .
In the following illustration , We divide the generated space into 10x10 Block . One new particle at a time , We will no longer check the interference between new particles and all existing particles , Instead, only the block where the new particles are located and the existing particles in the eight surrounding blocks are checked for interference . When our particle formation is completely random , Then our interference calculation is only the original way 9/100.

In the case of block method , Regardless of the total number of blocks , We all just need to 9 Block by block . therefore , When we divide space into x When a block , The efficiency is the of the original efficiency x/9. however , It should be noted that , Blocks cannot be increased indefinitely , Because we must ensure that the block can hold the largest particles , Otherwise, there will be problems in the calculation .

In this way , We can quickly and randomly generate a specific number of particles of different sizes .
The method of randomly generating particles by block method Matlab Code
版权声明
本文为[soar3033]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211339506120.html
边栏推荐
- Industry video super resolution new benchmark, Kwai & Dalian research, boarded CVPR 2022
- LLVM之父Chris Lattner:编译器的黄金时代
- leetcode:无数个面额的硬币得到amount的选法(dp)
- The monomer test uses assert Assert that (expected, matcher)
- Which brand of running headphones is good and suitable for sports
- 程序员爆出自己的薪资税前月薪15000
- Huffman coding
- 关于电脑使用慢慢变慢的几大原因分析
- 字符串 - 1. 字符串长度 (10 分)C语言标准函数库中包括 strlen 函数,用于计算字符串的长度。作为练习,我们自己编写一个功能与之相同的函数。
- Ali Tianchi competition -- street view character coding recognition
猜你喜欢

metasploit渗透

Which brand of running headphones is good and suitable for sports

How many insurance evaluation companies are there in Haikou? Where is it specificly? Where can I find it?

Dynamic implementation of address book

国际物流集运系统源码,海外仓储跨境转运系统源码

哈夫曼编码

通讯录的动态实现

滚动条样式修改

leetcode:无数个面额的硬币得到amount的选法(dp)

Stm32cupemx installation
随机推荐
《物联网开发实战》06 物模型:如何定义智能电灯?(学习笔记)
专家系统实例及其骨架系统
An example of expert system and its skeleton system
数字IC入门工具大全之 英特尔 Quartus Prime是什么?三个版本有什么区别
thread库和 asio 库区别
MySQL学习笔记-day03
How many insurance evaluation companies are there in Haikou? Where is it specificly? Where can I find it?
Industry video super resolution new benchmark, Kwai & Dalian research, boarded CVPR 2022
SQLyog导入sql文件
北京大学ACM Problems 1012:Maya Calendar
How to recover if U disk data is lost? U disk data recovery, two schemes completed
List存放map值
Peking University ACM problems 1009: edge detection
字符串串动变化 (10 分)下列程序中,函数fun的功能是:在字符串str中找出ASCII码值最大的字符,将该字符前的所有字符向后顺序移动一个位置,然后将该字符放到第一个位置上。
工具函数---小数位处理
Review questions and answers of architectural physics and equipment for class I registered architect examination in 2022
通讯录的动态实现
What about first-class insurance? Is there a charge? What are the waiting requirements?
leetcode:824. Goat Latin [simple string manipulation]
About ` object Thoughts on the impossibility of calling clone() ` subclass