Refine Mesh |
Copy Code
|
---|---|
//Use a loop to refine the mesh of the Simply Supported Plate example project SetUnits("Kips & Inches"); //open the Simply Supported Plate example before running the script //Try finer and finer mesh until the extreme MY moment stops changing var meshSetting = 100; var delta = 100.0; //initialize to a big value var moment = 100.0; //initialize to a big value int i = 0; //keep track of the number of iterations needed to find the converged value var tolerance = 0.001; //stop when the moment changes by less than 0.001 k-in/in while(delta > tolerance) { i++; meshSetting *= 2; SetMeshCustom(meshSetting); await Analysis(); //interested in the negative moment at the center var newMoment = MomentY(false); delta = Math.Abs(moment - newMoment); moment = newMoment; } //Print out the final results $"MY = {moment:f4}; Final Delta = {delta:f4}; Trials = {i}" |