1. Trang chủ
  2. » Ngoại Ngữ

Application of an optimisation algorithm to configure an internal fixation device

108 183 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

Application of an Optimisation Algorithm to Configure an Internal Fixation Device Salma Ibrahim, B.E (Medical) Submitted for the award of the degree of Master of Engineering in School of Engineering Systems of the faculty for Built Environment and Engineering, Queensland University of Technology 2010 Optimisation of an Internal Fixation Device Keywords Biomechanics, Optimisation Algorithm, Finite Element Modelling, Fracture Healing, Internal Fracture Fixation i Optimisation of an Internal Fixation Device Abstract Project Title: Application of an optimisation algorithm to configure an internal fixation device Author: Salma Ibrahim Supervisors: Dr Sanjay Mishra (Primary) Dr Gongfa Chen (Secondary) Fractures of long bones are sometimes treated using various types of fracture fixation devices including internal plate fixators These are specialised plates which are used to bridge the fracture gap(s) whilst anatomically aligning the bone fragments The plate is secured in position by screws The aim of such a device is to support and promote the natural healing of the bone When using an internal fixation device, it is necessary for the clinician to decide upon many parameters, for example, the type of plate and where to position it; how many and where to position the screws While there have been a number of experimental and computational studies conducted regarding the configuration of screws in the literature, there is still inadequate information available concerning the influence of screw configuration on fracture healing Because screw configuration influences the amount of flexibility at the area of fracture, it has a direct influence on the fracture healing process Therefore, it is important that the chosen screw configuration does not inhibit the healing process In addition to the impact on the fracture healing process, screw configuration plays an important role in the distribution of stresses in the plate due to the applied loads A plate that experiences high stresses is prone to early failure Hence, the screw configuration used should not encourage the occurrence of high stresses This project develops a computational program in Fortran programming language to perform mathematical optimisation to determine the screw configuration of an ii Optimisation of an Internal Fixation Device internal fixation device within constraints of interfragmentary movement by minimising the corresponding stress in the plate Thus, the optimal solution suggests the positioning and number of screws which satisfies the predefined constraints of interfragmentary movements For a set of screw configurations the interfragmentary displacement and the stress occurring in the plate were calculated by the Finite Element Method The screw configurations were iteratively changed and each time the corresponding interfragmentary displacements were compared with predefined constraints Additionally, the corresponding stress was compared with the previously calculated stress value to determine if there was a reduction These processes were continued until an optimal solution was achieved The optimisation program has been shown to successfully predict the optimal screw configuration in two cases The first case was a simplified bone construct whereby the screw configuration solution was comparable with those recommended in biomechanical literature The second case was a femoral construct, of which the resultant screw configuration was shown to be similar to those used in clinical cases The optimisation method and programming developed in this study has shown that it has potential to be used for further investigations with the improvement of optimisation criteria and the efficiency of the program iii Optimisation of an Internal Fixation Device Table of Contents Keywords i Abstract ii Table of Contents iv Figures and Tables vii Abbreviations used in the text ix Statement of Originality x Acknowledgements xi Introduction 1.1 Background 1.2 Problem 1.3 Aims 1.4 Significance of the Study 1.5 Outline of Thesis Literature Review and Background 2.1 Treatment of Long Bone Fractures 2.1.1 Internal Fixators 2.1.2 Fracture Healing 2.2 Factors Influencing the Strength of the Fixation Construct and Bone Healing11 2.2.1 Stiffness of Fracture Fixation 12 2.2.2 Physical Conditions for Fracture Healing 12 2.3 Influence of Working Length and Fracture Gap on Fixation Stability 14 2.4 Screw Positioning 18 2.5 Limitations of previous studies 19 2.6 Summary 20 Methods - Optimisation 21 3.1 Mathematical Definition of Optimisation 21 3.2 Types of Optimisation Problems and How to Solve Them 22 3.2.1 Constrained/ Unconstrained Optimisation Problems 22 3.2.2 Multi-modal Optimisation 24 3.2.3 Deterministic Methods 26 iv Optimisation of an Internal Fixation Device Powell s method 27 3.3.1 Conjugate Directions 27 3.3.2 The Algorithm .28 3.3.3 Golden Section Search Search in One Direction 32 3.4 Use of optimisation methods in medical engineering 33 3.5 Optimisation of Screw Configuration in Internal Fixators 35 3.5.1 Objectives and Constraints 35 3.5.2 Optimisation Criteria 36 3.5.3 Objective Function 37 3.5.4 Calculation of Function Value (with the use of FE method) 37 3.5.5 Data Transfer 41 Results 44 4.1 Case 1: Simplified Model 44 4.1.1 Bone Geometry 44 4.1.2 Plate and Screws Geometry 44 4.1.3 Material Properties 46 4.1.4 Boundary and Loading Conditions .47 4.1.5 Variables to be Optimised .47 4.1.6 Selection of Values for Optimisation Criteria 47 4.1.7 Solution for Simplified Model .51 4.2 Case 2: Clinical Model 55 4.2.1 Clinical Cases 55 4.2.2 Additional Cases 57 4.2.3 Femoral Bone Geometry 57 4.2.4 Plate and Screws of Femoral Construct 58 4.2.5 Assembly 58 4.2.6 Materials 58 4.2.7 Loading and Boundary Conditions .59 4.2.8 Variables to be Optimised .59 4.2.9 Selection of Optimisation Criteria .62 4.2.10 Solution 64 Discussion 72 5.1 Limitations of this Study 74 v Optimisation of an Internal Fixation Device 5.2 Improvements to the Model 76 5.3 Improvement to the Optimisation Criteria 77 5.4 Future Work - Improvements to the Optimisation Method 79 Conclusions 81 References 83 Appendix 87 Optimisation program including subroutines in Fortran 87 Python script file to read out values from FEA 94 vi Optimisation of an Internal Fixation Device Figures and Tables Figure LCP-combination hole allowing conventional plate fixation as well as application of locked screws (Source: (Perren, 2002)) Figure Internal fixator used with locked screws Fixator barely touches the bone as screws allow reliable maintenance of the initial distance between internal fixator and bone (Source: (Perren, 2002)) Figure Direct healing from osteotomy of sheep tibia with compression stabilisation The bone fragments are close and compressed and there is no displacement at the site of the osteotomy The shape of the osteones not change when crossing the fracture (Source: Perren, 2002) Figure Histological images of secondary fracture healing in bone (Source: J Bone Miner Res., 16, 1004 1014, 2001) 11 Figure Left: X-ray image of femoral fracture in 35 year old male with flexible fixation Right: X-ray image months after fixation, showing obvious signs of callus growth Source: (Chen et al., 2010) 15 Figure Seven week postoperative x-ray showing fracture fixation by placing several locking screws in main fragments The screw holes were occupied adjacent to the fracture site resulting in high stress concentrations occurring in that section of the plate Source: (Sommer et al., 2003) 16 Figure Example of contours of an objective function (Source: Rao, S S.; Engineering Optimization-Theory and Practice, 3rd Ed 1996, pp.363) 23 Figure A multi-modal function Source: (Singh et al., 2006) 25 Figure Conjugate Direction (Source: Rao, S S.; Engineering Optimization-Theory and Practice, 3rd Ed 1996, pp.363) 28 Figure 10 Progress of Powell's Method (Source: Rao, S S.; Engineering Optimization-Theory and Practice, 3rd Ed 1996, pp.363) 31 Figure 11 Illustration of Golden Section Search 32 Figure 12 Showing data transfer between different software packages 41 Figure 13 Screw positions (variables) to be optimised in the simplified model 45 Figure 14 Mesh of the simplified cylindrical model 47 Figure 15 (a) Rigid simplified construct, (b) flexible simplified construct 48 Figure 16 Nodes used to calculate displacements 49 Figure 17 Showing sharp edge (a cause of FE errors) in screw holes of the locking compression plate 51 Figure 18 Optimised solution for simplified model 51 Figure 19 Maximum principal stress distribution in cylindrical construct 52 Figure 20 (a) treatment of transverse fracture of 73 yr old patient (b) X-ray image showing failure of implant weeks post-op (c) treatment of fracture of a 35 year old male (d) Xray showing successful healing of fracture 56 Figure 21 Shows fixed screws (black, at each end of plate) and screw positions (yellow) to be optimised 60 Figure 22 (a) Fracture healing in patient after months using a flexible screw configuration (Source: J Eng Med Chen et al, 2010); (b) Simulation of the same combination used for FE analysis 61 vii Optimisation of an Internal Fixation Device Figure 23 (a) flexible construct, (b) rigid construct 63 Figure 24 (a) Screw configuration used in clinical case from Chen et al (2010); (b) Resultant screw configuration from optimisation algorithm 65 Figure 25 Maximum principal stress distribution in femoral construct of the optimised solution 67 Figure 26 (a) Flexible construct, (b) Construct with more rigidity due to shorter working length 68 Figure 27 Some screw configurations that were tried and tested by the optimisation algorithm White represents screws that were chosen by the optimisation algorithm that were tested Black represents screws that were fixed throughout the optimisation process 73 Figure 28 Illustration of concept of local versus global minimisation 75 Figure Boundaries for optimal healing in the sheep model s that lead to timely healing (Source: Epari et al, 2007) 78 Table 1Interfragmentary displacement and maximum principal stress for the most rigid and the most flexible cylindrical models 49 Table Comparison of displacements from solution and those from constraints for the cylindrical model 52 Table Comparison of displacement and stress resulting from flexible and rigid construct with that of solution construct for the cylindrical model 53 Table Shear, axial displacement and stress in plate resulting from the configuration from Chen et al (2010) 62 Table Interfragmentary displacement and maximum principal stress for most rigid and most flexible femur models 64 Table Comparison of displacements from solution and those from constraints 67 Table Comparison of displacement and stress resulting from flexible and rigid construct with that of solution construct 68 Table Axial and shear displacement resulting from the flexible and rigid constructs from Figure 27 (a) and (b) 69 Table Axial and shear displacements resulting from the removal of pairs of screws from each side of the fracture gap from the all screws in place construct 70 Table 10 Comparison of displacement and stress from optimised solution with that from screw configuration used in clinical case from Chen et al (2010) 70 viii Optimisation of an Internal Fixation Device Abbreviations used in the text FE = Finite Element LCP = Locking Compression Plate LISS = Less Invasive Stabilising System DCP = Dynamic Compression Plate TSP = Travelling Salesman Problem ix Optimisation of an Internal Fixation Device Conclusions This project developed a computational program in Fortran to perform mathematical optimisation to determine the best screw configuration for an internal fixation device within constraints of interfragmentary movement by minimising the corresponding stress in the plate The algorithm involved the interaction of a finite element software with an optimisation algorithm It was shown that mathematical programming is potentially advantageous in that it allows for the testing of a number of variables provided the required computational resources are available While some research groups (Stoffel et al, 2003; Tornkvist et al, 1996; Duda et al, 2002) have investigated the stresses produced in the internal fixation device, the study of the effects of screw configuration on interfragmentary movement (or a method of determining fracture healing progress) is necessary when determining its influence on the fracture healing process The optimisation algorithm allows for this calculation The optimisation program has been shown to predict the local optimal screw configuration in two cases The first case was a simplified bone construct whereby the screw configuration solution comparable with those recommended in biomechanical literature The second case was a femoral construct, of which the resultant screw configuration was shown to be similar to those used in clinical cases It was seen that the displacement constraints play a critical role in determining the ultimate screw configuration Increasing or decreasing the range of values impacted significantly on the solution Therefore, it is vital that the constraints chosen are close to representing the physiological situation 81 Optimisation of an Internal Fixation Device Mathematical programming allows the observation of trends of screw configurations that gradually progress towards the solution In addition, it shows the screw configurations that not satisfy the requirements To improve the screw configuration solution, the model should be refined to be more representative of the physiological fracture condition The optimisation criteria should be better defined in terms of the measurement of fracture healing progress (stiffness of construct or the measurement of stress or strains in the callus) 82 Optimisation of an Internal Fixation Device References Augat, P., et al (2003) "Shear Movement at the Fracture Site Delays Healing in a Diaphyseal Fracture Model." Journal of Orthopaedic Research 21(6): 1011-1017 BJD (1998) "The Bone and Joint Decade 2000-2010 Consensus Document: Severe Trauma to the Extremities." Brighton, C T (1984) A.A.O.S.: Instructional Course Lectures Principles of Fracture Healing Cheal, E J., et al (1983) "Stress Analysis of a Simplified Compression Plate Fixation System for Fractured Bones." Computers and Structures 17(5-6): 845-855 Chen, G., et al (2010) "Computational Investigations of Mechanical Failures of Internal Plate Fixation." Proceedings of the Institution of Mechanical Engineers, Part H: Journal of Engineering in Medicine 224(1): 119-126 Claes, L E., et al (1999) "Magnitudes of Local Stress and Strain Along Bony Surfaces Predict the Course and Type of Fracture Healing." Journal of Biomechanics 32(3): 255-266 Claes, L E P., et al (1998) "Effects of Mechanical Factors on the Fracture Healing Process." Clinical Orthopaedics & Related Research Fracture Healing Enhancement 355(Supplement): S132-S147 Del Valle, M., et al (1988) "Application of the Powell Method to the Optimisation of Flow Injection Systems." Journal of Chemometrics 3: 285-292 Duda, G N., et al (2002) "Mechanical Conditions in the Internal Stabilization of Proximal Tibial Defects." Clinical Biomechanics 17: 64-72 Duda, G N., et al (2002) "Interfragmentary Motion in Tibial Osteotomies Stabilised with Ring Fixators." Clinical Orthopaedics and Related Research 369: 162-172 Ellis, T., et al (2001) "Screw Position Affects Dynamic Compression Strain in an in Vitro Fracture Model." Journal of Orthopaedic Trauma 15(5): 333-337 Epari, D R., et al (2007) "Timely Fracture-Healing Requires Optimization of Axial Fixation Stability." The Journal Of Bone And Joint Surgery American Volume 89(7): 1575-1585 83 Optimisation of an Internal Fixation Device Esen, Ö., et al (2008) "A Mathematical Immunochemoradiotherapy Model: A Multiobjective Approach." Nonlinear Analysis: Real World Applications 9(2): 511517 Field, J R., et al (1999) "The Influence of Screw Omission on Construction Stiffness and Bone Surface Strain in the Application of Bone Plates to Cadaveric Bone." Injury 30(9): 591-598 Goodship, A E., et al (1985) "The Influence of Induced Micromovement Upon the Healing of Experimental Tibial Fractures." The Journal of Bone and Joint Surgery (Br) 67-B(4): 650-655 Hou, S.-M., et al (2004) "Mechanical Tests and Finite Element Models for Bone Holding Power of Tibial Locking Screws." Clinical Biomechanics 19(7): 738-745 Kenwright, J., et al (1989) "Controlled Mechanical Stimulation in the Treatment of Tibial Fractures." Clinical Orthopaedics and Related Research 241: 36-47 Korvick, D L., et al (1988) "The Effects of Screw Removal on Bone Strain in an Idealised Plated Bone Model." Veterinary Surgery 17(3): 111-116 Maratt, J D., et al (2008) "An Integer Programming Model for Distal Humerus Fracture Fixation Planning." Computer Aided Surgery 13(3): 139 - 147 Mathews, J H., Fink, Kurtis D (2004) Numerical Methods Using Matlab New Jersey, Prentice-Hall, Inc Muraca, R F., et al (1972) Materials Data Handbook California, USA, Western Applied Research and Development Inc Nelder, J A., et al (1965) "A Simplex Method for Function Minimization." The Computer Journal 7: 308-313 Perren, S M (2002) "Review Article: Evolution of the Internal Fixation of Long Bone Fractures." The Journal of Bone and Joint Surgery (Br) 84-B(8): 1093-1110 Press, W H., Vettering, W T., Teukolsky, S A., Flannery, B P (1992) Numerical Recipes in Fortran 77: The Art of Scientific Computing Cambridge, Cambridge University Press Rao, S S (1996) Engineering Optimization: Theory and Practice New York, Wiley Rho, J Y., et al (1993) "Young's Modulus of Trabecular and Cortical Bone Material: Ultrasonic and Microtensile Measurements." Journal of Biomechanics 26(2): 111119 84 Optimisation of an Internal Fixation Device Riemer, B L., et al (1992) "Immediate Plate Fixation of Highly Comminuted Femoral Diaphyseal Fractures in Blunt Polytrauma Patients." Orthopaedics 15: 907-916 Rozema, F R., et al (1992) "Computer-Aided Optimization of Choice and Positioning of Bone Plates and Screws Used for Internal Fixation of Mandibular Fractures." International Journal of Oral and Maxillofacial Surgery 21(6): 373-377 Ruedi, T P., et al (2001) A.O Principles of Fracture Management Stuttgart, AO Publishing and Thieme Sanders, R., et al (2002) "Minimal Versus Maximal Plate Fixation Techniques of the Ulna: The Biomechanical Effect of the Number of Screws and Plate Length." Journal of Orthopaedic Trauma 16(3): 166-171 Seebeck, J., et al (2005) "Mechanical Behavior of Screws in Normal and Osteoporotic Bone." Osteoporosis International 16(0): S107-S111 Shipley, R J., et al (2002) Fatigue Properties of Implant Materials, Asm Handbook, Vol.11, Fatigue Analysis and Prevention Ohio, ASM International Singh, G., et al (2006) "Comparison of Multi-Modal Optimization Algorithms Based on Evolutionary Algorithms." Association for Computer Machinery: 1305-1312 Sommer, C., et al (2003) "First Clinical Results of the Locking Compression Plate (Lcp)." Injury 34(Supplement 2): 43-54 Stoffel, K., et al (2003) "Biomechanical Testing of the L.C.P- How Can Stability in Locked Internal Fixators Be Controlled?" Injury 34: S-B11-S-B19 Taha, H A (1976) "Operations Research: An Introduction." Tornkvist, H., et al (1996) "The Strength of Plate Fixation in Relation to the Number and Spacing of Bone Screws." Journal of Orthopaedic Trauma 10(3): 204208 Wagner, M., et al (2007) "Locked Plating: Biomechanics and Biology and Locked Plating: Clinical Indications." Techniques in Orthopaedics 22(4): 209-218 Walsh, G R (1975) Methods of Optimisation New York, John Wiley and Sons Ltd Welfare, A I o H a (2006) "Australian Hospital Statistics 2004 05." Health Services Series no 26: AIHW cat no HSE 41 Woo, S L.-Y., et al (1984) "Less Rigid Internal Fixation Plates: Historical Perspectives and New Concepts." Journal of Orthopaedic Research 1(4): 431-449 85 Optimisation of an Internal Fixation Device Yamagishi, M., et al (1955) "The Biomechanics of Fracture Healing." The Journal of Bone and Joint Surgery 37: 1035-1068 86 Optimisation of an Internal Fixation Device Appendix Optimisation program including subroutines in Fortran !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! OPTIMISATION OF STRESS IN INTERNAL FIXATION PLATE USING POWELL'S METHOD Using the screw materials for the screw holes as variables, this program optimises the stress in the internal plate fixator The screw materials are interchanged according to the displacement calculated between the fracture gap, and the stress in the whole plate The optimisation procedure used is POWELL'S METHOD The object function is calculated in the function, E_FUNC The DISPLACEMENT AND STRESS are calculated by ABAQUS (finite element method); It is in functon E_FUNC The programs needed to run this optimisation procedure are: Martin_01.py - to read stress and displacement from odb Martin_01.inp - input file for ABAQUS analysis PracticalExampleOptiVar.txt - file with variables to be optimised !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PROGRAM test IMPLICIT NONE REAL, PARAMETER :: TOLER = ! the fractional tolerance in the function value such that failure to decrease ! by more than this amount on one iteration signals doneness INTEGER, PARAMETER :: NOPTI = ! number of variables EXTERNAL E_FUNC REAL,DIMENSION(6) :: OPV ! starting point (e.g.20000.,20000.,20000.,20000.) Young’s modulus of screws ! see first DO loop INTEGER IOPTI REAL ENERGY DO 10 IOPTI=1, NOPTI OPV(IOPTI) =0.0001 10 CONTINUE WRITE(*,*) "OPVAR = ", (OPV(IOPTI), IOPTI=1, NOPTI) CALL POWELL(NOPTI, OPV, TOLER, ENERGY, E_FUNC) ! call powell's method to minimise the stress WRITE (*, *) 'Energy = ' , ENERGY WRITE (*, *) (OPV(IOPTI), IOPTI=1, NOPTI ) 87 Optimisation of an Internal Fixation Device END PROGRAM FUNCTION E_FUNC(NOPTI, OPV) IMPLICIT NONE REAL, PARAMETER :: Force=580,YOUNG=2.0e+05 !compressive load on bone in Newtons REAL,DIMENSION(6):: OPVAR, OPV INTEGER NOPTI,IOPTI,status, i REAL penalty,Disfix,E_FUNC,X1,X2,DisplaX, Y1,Y2,DisplaY, DisplacementX, DisplacementY REAL Displacement, penalty2,ave2 ! Stiffness, MaxPrincipalStress, REAL, DIMENSION(132056):: value CHARACTER*50 AAA(6) DATA AAA /'*Material, name=Screw_11',& '*Material, name=Screw_10',& '*Material, name=Screw_09',& '*Material, name=Screw_06',& '*Material, name=Screw_05',& '*Material, name=Screw_04'/ 10 DO 10 IOPTI=1, NOPTI OPVAR(IOPTI) = ABS(OPV(IOPTI))* YOUNG WRITE(*,*) 'OPV(IOPTI)*YOUNG = ',OPVAR(IOPTI) CONTINUE WRITE(*,*) "E-func WRITE(*,*) "E-func OPV = ", (OPV(IOPTI), IOPTI=1, NOPTI) OPVAR = ", (OPVAR(IOPTI), IOPTI=1, NOPTI) E_FUNC = Displacement=0 ! Write into a file, 'PracticalExampleOptiVar.txt', the materials of the screws of the plate ! These are the variables to be optimised in the optimisation procedure ! The DATA above is cut out from the 'Assemb4Weak.inp' input file, and saved into ! a new file called 'TrussOptiVar.txt' For each iteration in the optimisation ! procedure, these cross-sectional areas are rewritten ! In the 'Truss.inp' file, the keyword *INCLUDE, input=PracticalExampleOptiVar.txt must be ! written in place of the cut-out variables So the file 'PracticalExampleOptiVar.txt' will be ! included in ABAQUS input file 'Assemb4Weak.inp' ! ! ! ! ! ! OPEN (UNIT= 6, FILE='PracticalExampleOptiVar.txt') loop1: DO IOPTI=1, NOPTI OPVAR(IOPTI) = ABS(OPVAR(IOPTI)) roundingmodulus: IF (OPVAR(IOPTI).LT.99500) THEN OPVAR(IOPTI) = 1000 ELSE IF (OPVAR(IOPTI).GE.99500) THEN OPVAR(IOPTI) = 200000 END IF roundingmodulus END DO loop1 DO IOPTI=1, NOPTI WRITE (6, *) AAA(IOPTI) WRITE (6, *) '*Elastic' WRITE (6, 100) OPVAR(IOPTI), ', 0.3' 100 FORMAT (' ',ES10.3,A) END DO 88 Optimisation of an Internal Fixation Device CLOSE (6) OPEN (UNIT = 5, FILE="Cylinder_CompTors_6VarsOpti310709.lck", IOSTAT=status, ACTION='READ', STATUS='OLD') deletelockfile: IF (status == 0.) THEN CALL SYSTEM ("echo y | del Cylinder_CompTors_6VarsOpti310709.lck") END IF deletelockfile CALL SYSTEM ("echo y | abaqus job=Cylinder_CompTors_6VarsOpti310709 interactive") CALL SYSTEM ("abaqus python Cylinder_CompTors_6VarsOpti310709.py") ! Call ABAQUS to the finite element analysis ! Call python script file 'PracticalExampleOpti2.py' ! The 'PracticalExampleOpti2.py' is used to read from the ABAQUS 'Assemb4Weak.odb' file, the ! displacement and stress values and write them into a file called ! 'PracticalExampleDispRes.txt', so that Fortran is able to read the numbers OPEN (UNIT = 5, FILE='PracticalExampleDispRes.txt') READ (5, *) X1,Y1,X2,Y2 CLOSE (5) DisplaX = ABS(X1-X2) DisplaY = ABS(Y1-Y2) !WRITE(*,*) 'X1 = ', X1 !, X1, 'X2 = ', X2 !WRITE(*,*) 'Y1 = ', Y1, 'Y2 = ', Y2 !WRITE(*,*) 'DisplaX = ', DisplaX !WRITE(*,*) 'DisplaY = ', DisplaY !Displacement = SQRT((ABS(DisplaX)**2) + (ABS(DisplaY)**2)) WRITE(*,*) 'Displacement in x direction = ', DisplaX WRITE(*,*) 'Displacement in y direction = ', DisplaY DisplacementX = DisplaX DisplacementY = DisplaY !openif: IF (status == 0) THEN OPEN (UNIT=5,FILE='PracticalExampleStressRes.txt',ACTION='READ',STATUS='OLD', IOSTAT=status) DO i = 1, 132056 READ (5, *) value(i) ! reads the mises stress of all 517588 elements in element set, PLATE PLUS SCREWS END DO CLOSE (5) ! ! MaxPrincipalStress = (SUM(value, 1, value>100) / COUNT(value>100, 1)) WRITE(*,*) 'MaxPrincipalStress = ', MaxPrincipalStress WRITE(*,*) 'largest value max principal= ', MAXVAL(value,1) ! this is the average Von Mises stress in the element set, 'SET_MIDDLEOFPLATE' !END IF openif ! on one side,i.e steel screws on screw and 8, and No_Screw material in the rest of ! the screws holes The strongest screw combination is the one where all the ! steel screws are connected to the bone 89 Optimisation of an Internal Fixation Device penalty = 1.0e+06 Disfix = 1.2 E_FUNC = MAXVAL(value,1) IF (DisplacementX.LT.0.9 OR DisplacementX.GT.1.4) THEN E_FUNC = E_FUNC + penalty * ABS(Displacement-Disfix) END IF IF (DisplacementY.LT.0.9 OR DisplacementY.GT.1.45) THEN E_FUNC = E_FUNC + penalty * ABS(Displacement-Disfix) END IF ! Calculate the object function, using penalty to introduce the condition of ! the same displacement The displacement at the loading point is fixed at: ! Disfix = 0.4 Penalty parameter = 1.e+06 DO 20 IOPTI=1, NOPTI ave2 = OPV(IOPTI) IF ( ave2.LT.0.5) THEN penalty2=ABS(ave2-0.0001) ELSE IF ( ave2.GE.0.5) THEN penalty2=ABS(ave2-1.0) END IF 20 E_FUNC = E_FUNC + (penalty2*penalty) CONTINUE ! Penalty2 is to control the variables (Young's modulus) By forcing ave2 (Young's modulus) ! to go to 0.01 for the NoScrew part, and to go to for the steel part ! We want to reach the condition where (Displa - Disfix = 0) So when this ! condition is not true, it is multiplied by the penalty number ! Gradually E_FUNC should become smaller WRITE(*,*) ' E_FUNC = ', E_FUNC RETURN END FUNCTION ! Subroutine POWELL uses the subroutines mnbrak and linmin,and functions ! f1dim and golden, from Numerical Recipes SUBROUTINE powell (n, p, ftol, fret, func) IMPLICIT REAL (A-H, Q-Z) DIMENSION p(n) REAL, EXTERNAL :: f1dim, func PARAMETER (NMAX=1225, ITMAX=50000) DIMENSION xi(NMAX, NMAX), pt(NMAX), ptt(NMAX), xit(NMAX) INTEGER IOPTI WRITE(*,*) "From Powell Subroutine OPVAR = ", (p(IOPTI), IOPTI=1, n) ! produces matrix of direction wectors that are conjugate to each other ! e.g if n=3 then matrix = [1 0] ! [0 0] ! [0 1] 1301 i=1,n 1301 j=1,n xi(i,j)=0 1301 continue 1302 i=1,n xi(i,i)=1 90 Optimisation of an Internal Fixation Device 1302 continue fret=func(n, p) 11 j=1,n pt(j)=p(j) 11 continue iter=0 iter=iter+1 fp=fret ibig=0 del=0 13 i=1,n 12 j=1,n xit(j)=xi(j,i) 12 continue fptt=fret call linmin(p,xit,n,fret,func) if (abs(fptt-fret).gt.del) then del=abs(fptt-fret) ibig=i endif 13 continue if (2.*abs(fp-fret).le.ftol*(abs(fp)+abs(fret))) return 14 j=1,n ptt(j)=2.*p(j)-pt(j) xit(j)=p(j)-pt(j) pt(j)=p(j) 14 continue fptt=func(n, ptt) if (fptt.ge.fp) goto t=2.*(fp-2.*fret+fptt)*(fp-fret-del)**2-del*(fp-fptt)**2 if (t.ge.0.) goto call linmin (p, xit, n, fret,func) 15 j=1,n xi(j,ibig)=xi(j,n) xi(j,n)=xit(j) 15 continue goto END ! SUBROUTINE LINMIN (p, xi, n, fret, func) IMPLICIT REAL (A-H, Q-Z) DIMENSION p(n), xi(n) PARAMETER (NMAX=1225, TOL=1.E-03) DIMENSION pcom(NMAX), xicom(NMAX) COMMON /f1com/ pcom, xicom, ncom REAL, EXTERNAL :: f1dim, func ncom=n 11 j=1,n pcom(j)=p(j) xicom(j)=xi(j) 11 continue ax=0 xx=1 call mnbrak (ax,xx,bx,fa,fx,fb,f1dim,func) fret=golden(ax,xx,bx,f1dim,func,TOL,xmin) fret= brent(ax,xx,bx,f1dim,func,TOL,xmin) 12 j=1,n xi(j)=xmin*xi(j) p(j)=p(j)+xi(j) 12 continue 91 Optimisation of an Internal Fixation Device return end FUNCTION f1dim(x,func) IMPLICIT REAL (A-H, O-Z) PARAMETER (NMAX=1225) DIMENSION pcom(NMAX), xicom(NMAX), xt(NMAX) COMMON /f1com/ pcom, xicom, ncom 11 j=1,ncom xt(j)=pcom(j)+x*xicom(j) 11 continue f1dim=func(ncom, xt) return END SUBROUTINE mnbrak (ax, bx, cx, fa, fb, fc, f1dim,func) ! Mnbrak: this subroutine is used to bracket a minimum in one dimensional minimisation ! This provides the initial guess for the search for the minimum in that dimension IMPLICIT REAL (A-H, O-Z) REAL, EXTERNAL :: f1dim, func PARAMETER (GOLD=1.618034, GLIMIT=100., TINY=1.E-15) fa=f1dim(ax,func) fb=f1dim(bx,func) if (fb.gt.fa) then dum=ax ax=bx bx=dum dum=fa fa=fb fb=dum endif cx=bx+GOLD*(bx-ax) fc=f1dim(cx,func) if (fb.ge.fc) then r=(bx-ax)*(fb-fc) q=(bx-cx)*(fb-fa) if ( abs(q-r) lt TINY ) then WRITE(6,*) ax, bx, cx, fa, fb, fc stop endif u=bx-((bx-cx)*q-(bx-ax)*r)/(2.*sign(max(abs(q-r), TINY), q-r)) ulim=bx+GLIMIT*(cx-bx) if ((bx-u)*(u-cx).gt.0.) then fu=f1dim(u,func) if (fu.lt.fc) then ax=bx fa=fb bx=u fb=fu return else if (fu.gt.fb) then cx=u fc=fu return 92 Optimisation of an Internal Fixation Device endif u=cx+GOLD*(cx-bx) fu=f1dim(u,func) else if ((cx-u)*(u-ulim).gt.0.) then fu=f1dim(u,func) if (fu.lt.fc) then bx=cx cx=u u=cx+GOLD*(cx-bx) fb=fc fc=fu fu=f1dim(u,func) endif else if ((u-ulim)*(ulim-cx).ge.0.) then u=ulim fu=f1dim(u,func) else u=cx+GOLD*(cx-bx) fu=f1dim(u,func) endif ax=bx bx=cx cx=u fa=fb fb=fc fc=fu goto endif return END FUNCTION golden(ax,bx,cx,f1dim,func,tol,xmin) IMPLICIT REAL (A-H, O-Z) REAL,EXTERNAL :: f1dim, func PARAMETER (R=.618034, C=1.-R) x0=ax x3=cx if (abs(cx-bx).gt.abs(bx-ax)) then x1=bx x2=bx+C*(cx-bx) else x2=bx x1=bx-C*(bx-ax) endif f1=f1dim(x1,func) f2=f1dim(x2,func) if (abs(x3-x0).gt.tol*(abs(x1)+abs(x2))) then if (f2.lt.f1) then x0=x1 x1=x2 x2=R*x1+C*x3 f1=f2 f2=f1dim(x2,func) else x3=x2 x2=x1 x1=R*x2+C*x0 f2=f1 f1=f1dim(x1,func) endif goto 93 Optimisation of an Internal Fixation Device endif if (f1.lt.f2) then golden=f1 xmin=x1 else golden=f2 xmin=x2 endif return END Python script file to read out values from FEA # to print axial displacement from Step-1(compression) from odbAccess import * from abaqusConstants import * odb = openOdb(path='Cylinder_CompTors_6VarsOpti310709.odb') step1 = odb.steps['CompressionTorsion'] lastFrame = odb.steps['CompressionTorsion'].frames[-1] #for fieldName in lastFrame.fieldOutputs.keys(): # print fieldName myAssembly = odb.rootAssembly #for instanceName in odb.rootAssembly.instances.keys(): # print instanceName #for nodesets in odb.rootAssembly.nodeSets.keys(): # print nodesets centre = odb.rootAssembly.nodeSets['NODE_DISP'] displacement = lastFrame.fieldOutputs['U'] centreDisplacement = displacement.getSubset(region=centre) centreValues = centreDisplacement.values dispFile = open('PracticalExampleDispRes.txt','w') for v in centreValues: # print v.data[1] # print v.magnitude dispFile.write('%10.4f\n %10.4f\n' % (v.data[0],v.data[1])) dispFile.close() odb.close() # to print out the Von Mises stress in the middle of the plate # in the set SET_MIDDLEOFPLATE from odbAccess import * from abaqusConstants import * odb = openOdb(path='Cylinder_CompTors_6VarsOpti310709.odb') step1 = odb.steps['CompressionTorsion'] myAssembly = odb.rootAssembly lastFrame = odb.steps['CompressionTorsion'].frames[-1] centre = odb.rootAssembly.elementSets['PLATE_PLUS_SCREWS'] stress = lastFrame.fieldOutputs['S'] centreStress = stress.getSubset(region=centre) centreValues = centreStress.values dispFile = open('PracticalExampleStressRes.txt','w') for v in centreValues: # print v # this gets all the values for the region(centreStress) # from here we can see all the attributes or types of values # that are present under the attribute, values # mises=v.mises # elementlabel=v.elementLabel 94 Optimisation of an Internal Fixation Device # print elementlabel, mises dispFile.write('%10.4f' % (v.maxPrincipal)+'\n') dispFile.close() odb.close() 95 .. .Optimisation of an Internal Fixation Device Keywords Biomechanics, Optimisation Algorithm, Finite Element Modelling, Fracture Healing, Internal Fracture Fixation i Optimisation of an Internal. .. of an Internal Fixation Device Abstract Project Title: Application of an optimisation algorithm to configure an internal fixation device Author: Salma Ibrahim Supervisors: Dr Sanjay Mishra (Primary)... to perform mathematical optimisation to determine the screw configuration of an ii Optimisation of an Internal Fixation Device internal fixation device within constraints of interfragmentary movement

Ngày đăng: 07/08/2017, 15:52

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w