CN102043759A - Method for validating numerical calculation programs of mathematical model - Google Patents

Method for validating numerical calculation programs of mathematical model Download PDF

Info

Publication number
CN102043759A
CN102043759A CN2010106187935A CN201010618793A CN102043759A CN 102043759 A CN102043759 A CN 102043759A CN 2010106187935 A CN2010106187935 A CN 2010106187935A CN 201010618793 A CN201010618793 A CN 201010618793A CN 102043759 A CN102043759 A CN 102043759A
Authority
CN
China
Prior art keywords
convergence
mathematical model
solution
governing equation
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2010106187935A
Other languages
Chinese (zh)
Inventor
杨振虎
梁益华
周磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
AVIC No 631 Research Institute
Original Assignee
AVIC No 631 Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by AVIC No 631 Research Institute filed Critical AVIC No 631 Research Institute
Priority to CN2010106187935A priority Critical patent/CN102043759A/en
Publication of CN102043759A publication Critical patent/CN102043759A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method for validating numerical calculation programs of a mathematical model, comprising the following steps: 1) determining a control equation for program solution; 2) determining a theoretical convergence order of a discrete method; 3) determining all branch programs of the mathematical model; 4) determining a fictitious solution; 5) inputting the fictitious solution at the right end of the control equation to form a source item; 6) adding the source item to the right end of the original control equation to obtain a numerical solution of the control equation; 7) judging whether the numerical solution and the fictitious solution are consistent or not; 8) carrying out mesh refinement to obtain errors on different meshes, and calculating the actual convergence order by the numerical solution; and 9) completing the current test if the actual convergence order is consistent with the theoretical convergence order. In the method of the invention, a group of analytic solutions which can satisfy the requirements of program validation are constructed from the viewpoint of converse thinking, and the program is validated by achieving the precision order of the program, thus simplifying the program test, and providing a large amount of analytic solutions.

Description

A kind of verification method of mathematical model numerical evaluation program
Technical field
The present invention relates to a kind of numerical evaluation program correctness verification method that is used to have mathematical model, especially for the verification of correctness of the large program of finding the solution partial differential equation.
Background technology
The differential equation is nonlinear partial differential equation particularly, because the restriction of mathematics state of the art, its analytic solution are difficult to obtain in general.This just brings very big inconvenience to the checking of its numerical solution program.For a long time, the examination to these programs mainly contains following several method: high precision solution method or analytic solution method; The expert judgments method; Carry out the method for program and program run result's contrast.The two kinds of methods in back are to set up the method for confidence level, but they can not replace strict program verification, simultaneously because high precision solution is limited, or be difficult to simple expression, and analytic solution only just exist under some hypothesis under many circumstances, these hypothesis often make in the equation some default, make checking not have universal significance.
Summary of the invention
In order to solve existing technical matters in the background technology, the present invention proposes a kind of verification method of mathematical model numerical evaluation program, construct one group from the viewpoint of reverse thinking and can satisfy the analytic solution that program verification requires, come program is verified from program realization accuracy order, simplified program test, a large amount of analytic solution are provided.
Technical solution of the present invention is: a kind of verification method of mathematical model numerical evaluation program, and its special character is: said method comprising the steps of:
1) determines the governing equation of program solution, suppose the boundary condition of this governing equation;
2) determining step 1) in the theoretical degree of convergence of discrete method of governing equation;
3) determine all branched programs of mathematical model to be tested; And judge according to boundary condition that governing equation is whether suitable and decide branched program, if calmly suitable, then carry out step 4);
4) determine that the imaginary of governing equation separate;
5) will fabricate the right-hand member of separating the input governing equation and form source item;
6) source item is added the right-hand member of former governing equation, and finish the input of calculation procedure, the numerical solution of controlled equation;
7) judge that whether numerical solution is consistent with imaginary value of separating, if consistent, then carries out step 8);
8) carry out mesh refinement and obtain error on the different grids, and utilize the actual degree of convergence of numerical solution calculation control equation;
9) actual degree of convergence and theoretical degree of convergence are compared,, then finish and work as Pretesting if actual degree of convergence is consistent with theoretical degree of convergence.
Above-mentioned steps 7) if numerical solution is separated inconsistently with fabricating, then carries out the step 10) debugging and right a wrong in, after finding mistake and correcting, then return step 7).
Above-mentioned steps 9) if actual degree of convergence and theoretical degree of convergence are inconsistent, then carry out the step 10) debugging and right a wrong, after finding mistake and correcting, then return step 7).
Above-mentioned steps 9) comprises also that afterwards step 11) judges whether that needs determine new imaginary separating, if then return step 4) and continue.
Above-mentioned steps 1) boundary condition of governing equation comprises can pressing maybe and can not press, have sticking or do not have sticking in.
Above-mentioned steps 8) the concrete mode of mesh refinement is in: the structured grid integral multiple is encrypted, non-structured grid is carried out the subdivision refinement to each limit mid point line of each triangular element.
Above-mentioned steps 10) actual degree of convergence and the inconsistent reason of theoretical degree of convergence comprise in: mistake, the computational accuracy rank that the test of test formula or foundation exists have mistake, error of calculation tolerance on given time, position or the realistic accuracy existence is wrong or convergence is incomplete.
The advantage of this method: fabricate and separate method as a kind of new program verification method, it has the advantage that the exact solution method is equal to, has very strong vitality, some coordinate transforms of writing and being done of the correctness of testing-program time spatial spreading that can be strict, boundary condition, program.In other words, influence the place of calculating on the realistic accuracy rank and all passed through test.This method implements fairly simple, and the great advantage of fabricating the method for separating is to have simplified program test, and a large amount of analytic solution are provided, and can avoid the unreliability of Richardson extrapolation in the grid convergence method of testing.
Embodiment
Referring to Fig. 1, the present invention proposes a kind of verification method of mathematical model numerical evaluation program, may further comprise the steps:
1) determines the governing equation of program solution, suppose the boundary condition of this governing equation;
2) determining step 1) in the theoretical degree of convergence of discrete method of governing equation;
3) determine all branched programs of mathematical model to be tested; And judge according to boundary condition that governing equation is whether suitable and decide branched program, if calmly suitable, then carry out step 4);
4) determine that the imaginary of governing equation separate;
5) will fabricate the right-hand member of separating the input governing equation and form source item;
6) source item is added the right-hand member of former governing equation and finish the input of calculation procedure, the numerical solution of controlled equation;
7) judge that whether numerical solution is consistent with imaginary value of separating, if consistent, then carries out step 8); If inconsistent, then carry out the step 10) debugging and right a wrong; If after finding wrong also correction, return step 7) and proceed;
8) carry out mesh refinement and obtain error on the different grids, and utilize the actual degree of convergence of numerical solution calculation control equation; The concrete mode of mesh refinement is: the structured grid integral multiple is encrypted, non-structured grid is carried out the subdivision refinement to each limit mid point line of each triangular element;
9) actual degree of convergence and theoretical degree of convergence are compared, if actual degree of convergence equals theoretical degree of convergence, then program is finished, if actual degree of convergence and theoretical degree of convergence are inconsistent, then carries out step 10);
10) carry out debugging and correction process, actual degree of convergence and the inconsistent reason of theoretical degree of convergence comprise: mistake, the computational accuracy rank that the test of test formula or foundation exists have mistake, error of calculation tolerance on given time, position or the realistic accuracy existence is wrong or convergence is incomplete;
11) judge whether to reselect new imaginary separating, if return step 4) and carry out; When all checkings are passed through, then degree finishes.
With one dimension Burger ' s equation is example, and the principle of this method is described.
To one dimension Burger ' s equation:
∂ u ∂ t + ∂ ∂ x ( 1 2 u 2 ) = 0
Lu = ∂ u ∂ t + ∂ ∂ x ( 1 2 u 2 )
Can choose to fabricate and separate
u e=e x+t
Source item
f=e x+t+e 2(x+t)
For the correctness that guarantees that source item realizes in program, can be by symbol process software Mathematica/maple etc., it can directly export the program code of Fortran linguistic form.
To the modification of boundary condition, mainly according to the type on border, for general boundary condition (Dirichlet border, Neumann border, Robin border etc.), boundary condition acts on to fabricate to separate with boundary operators and gets final product.As to the Dirichlet border: Should be revised as

Claims (7)

1. the verification method of a mathematical model numerical evaluation program is characterized in that: said method comprising the steps of:
1) determines the governing equation of program solution, suppose the boundary condition of this governing equation;
2) determining step 1) in the theoretical degree of convergence of discrete method of governing equation;
3) determine all branched programs of mathematical model to be tested; And judge according to boundary condition that governing equation is whether suitable and decide branched program, if calmly suitable, then carry out step 4);
4) determine that the imaginary of governing equation separate;
5) will fabricate the right-hand member of separating the input governing equation and form source item;
6) source item is added the right-hand member of former governing equation, and finish the input of calculation procedure, the numerical solution of controlled equation;
7) judge that whether numerical solution is consistent with imaginary value of separating, if consistent, then carries out step 8);
8) carry out mesh refinement and obtain error on the different grids, and utilize the actual degree of convergence of numerical solution calculation control equation;
9) actual degree of convergence and theoretical degree of convergence are compared,, then finish and work as Pretesting if actual degree of convergence is consistent with theoretical degree of convergence.
2. the verification method of mathematical model numerical evaluation program according to claim 1, it is characterized in that: in the described step 7) if numerical solution with fabricate separate inconsistent, then carry out the step 10) debugging and right a wrong, after finding mistake and correcting, then return step 7).
3. the verification method of mathematical model numerical evaluation program according to claim 2, it is characterized in that: described step 9) is if actual degree of convergence and theoretical degree of convergence are inconsistent, then carry out the step 10) debugging and right a wrong, after finding mistake and correcting, then return step 7).
4. the verification method of mathematical model numerical evaluation program according to claim 3 is characterized in that: also comprise that step 11) judges whether that needs determine new imaginary separating after the described step 9), if then return the step 4) continuation.
5. according to the verification method of claim 1 or 2 or 3 or 4 described mathematical model numerical evaluation programs, it is characterized in that: the boundary condition of governing equation comprises can pressing maybe and can not press, have sticking or do not have sticking in the described step 1).
6. the verification method of mathematical model numerical evaluation program according to claim 5, it is characterized in that: the concrete mode of mesh refinement is in the described step 8): the structured grid integral multiple is encrypted, non-structured grid is carried out the subdivision refinement to each limit mid point line of each triangular element.
7. the verification method of mathematical model numerical evaluation program according to claim 6 is characterized in that: actual degree of convergence and the inconsistent reason of theoretical degree of convergence comprise in the described step 10): mistake, the computational accuracy rank that the test of test formula or foundation exists have mistake, error of calculation tolerance on given time, position or the realistic accuracy existence is wrong or convergence is incomplete.
CN2010106187935A 2010-12-31 2010-12-31 Method for validating numerical calculation programs of mathematical model Pending CN102043759A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010106187935A CN102043759A (en) 2010-12-31 2010-12-31 Method for validating numerical calculation programs of mathematical model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010106187935A CN102043759A (en) 2010-12-31 2010-12-31 Method for validating numerical calculation programs of mathematical model

Publications (1)

Publication Number Publication Date
CN102043759A true CN102043759A (en) 2011-05-04

Family

ID=43909904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010106187935A Pending CN102043759A (en) 2010-12-31 2010-12-31 Method for validating numerical calculation programs of mathematical model

Country Status (1)

Country Link
CN (1) CN102043759A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121875A (en) * 2017-12-27 2018-06-05 陕西航空电气有限责任公司 A kind of Topology Optimization Method that platform is solved based on Matlab and CFX joints
CN110598367A (en) * 2019-10-12 2019-12-20 中南大学 Footprint-guided efficient aviation electromagnetic numerical simulation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121875A (en) * 2017-12-27 2018-06-05 陕西航空电气有限责任公司 A kind of Topology Optimization Method that platform is solved based on Matlab and CFX joints
CN110598367A (en) * 2019-10-12 2019-12-20 中南大学 Footprint-guided efficient aviation electromagnetic numerical simulation method

Similar Documents

Publication Publication Date Title
CN103995780B (en) A kind of program error localization method based on sentence frequency statistics
CN104573277A (en) Vehicle suspension system performance analysis method
CN103134546A (en) Semi-automatic examination method for special vehicle pointer instrument
CN109147013A (en) A kind of in-depth figure automatic generation method, equipment and the storage medium of component
CN104615808B (en) A kind of test method and reference model device of hardware computation component to be tested
CN102495926B (en) Test method and device of three-dimensional original model
CN103885341B (en) Performance analysis system based on automotive performance simulator and method
CN106933572B (en) Measurement model based on LLVM intermediate representation program slice
Szárnyas et al. The TTC 2015 Train Benchmark Case for Incremental Model Validation.
CN105096678A (en) Method and apparatus for assisting in evaluating answer quality of mathematical question
CN102043759A (en) Method for validating numerical calculation programs of mathematical model
Kim et al. An integrated software testing framework for FPGA-based controllers in nuclear power plants
CN107562808B (en) Method for verifying heterogeneous double-chain automatic data
CN104166778B (en) Automobile chair guide rail contact site rigidity and damping optimization method
CN103970654A (en) Software reliability virtual test method
Hofer et al. Combining models for improved fault localization in spreadsheets
CN102183896B (en) A kind of system utilizing Matlab to test nuclear power station relay protective scheme
CN107809345B (en) Gateway data checking tool, method and device for checking gateway data
Beine A model-based reference workflow for the development of safety-critical software
CN104899371B (en) Survey of Transmission Line method and device
CN110262891B (en) Automatic multifunctional resource recycling system across virtualization platforms
CN112329124A (en) CAE model error checking method and device, computer equipment and storage medium
CN114579084A (en) Formalization processing method and device for control software of engine
CN109933948A (en) A kind of Formal Verification, device, formal verification platform and readable storage medium storing program for executing
CN109635480A (en) A kind of control logic verifying and adjustment method based on graphics software

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110504