(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 11094, 343]*) (*NotebookOutlinePosition[ 11784, 367]*) (* CellTagsIndexPosition[ 11740, 363]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Comparing Results of Transient Simulation", "Title"], Cell[TextData[{ "E.B. Rudnyi, 2005, ", ButtonBox["http://Evgenii.Rudnyi.Ru/, ", ButtonData:>{ URL[ "http://Evgenii.Rudnyi.Ru/"], None}, ButtonStyle->"Hyperlink"], ButtonBox["http://www.imtek.uni-freiburg.de/simulation/mor4ansys/", ButtonData:>{ URL[ "http://www.imtek.uni-freiburg.de/simulation/mor4ansys/"], None}, ButtonStyle->"Hyperlink"] }], "Text"], Cell[CellGroupData[{ Cell["Setting up Directory and Loading Functions", "Subtitle"], Cell["Write the directory name with the files and run", "Text"], Cell["SetDirectory[\".\"]", "Input"], Cell["\<\ It is assumed that the functions are in the current directory. They \ have been enclosed in the archive for your convenience. \ \>", "Text"], Cell[BoxData[ \(<< Post4MOR.m\)], "Input"], Cell[TextData[{ "The latest version of functions and the documentation can be found at ", ButtonBox["http://Evgenii.Rudnyi.Ru/soft/Post4MOR.tar.gz,", ButtonData:>{ URL[ "http://Evgenii.Rudnyi.Ru/soft/Post4MOR.tar.gz"], None}, ButtonStyle->"Hyperlink"], " If you have ", StyleBox["Mathematica", FontSlant->"Italic"], " starting 5.1 and Internet access, the latest version can be loaded by \ executing" }], "Text"], Cell[TextData[StyleBox["ToExpression[Import[\"http://Evgenii.Rudnyi.Ru/soft/\ Post4MOR/Post4MOR.m\",\"Text\"]]", FontFamily->"Arial", FontWeight->"Bold"]], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Loading Files", "Subtitle"], Cell["\<\ If you have different files names, please make changes accordingly.\ \ \>", "Text"], Cell["Loading the reduced system", "Text"], Cell[BoxData[ \(sys = ReadSystem["\"]\)], "Input"], Cell["Loading ANSYS results for transient simulation", "Text"], Cell[BoxData[{ \(fixstep\ = \ ReadResult["\"]\), "\[IndentingNewLine]", \(adaptive\ = \ ReadResult["\"]\), "\[IndentingNewLine]", \(logtime\ = \ ReadResult["\"]\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Comparing Different Integration Strategies in ANSYS", "Subtitle"], Cell["\<\ First, let us compare different simulation strategies in ANSYS to \ integrate in time between each other. Plot temperature vs. time. logtime is red, adaptive is green, fixstep is \ blue.\ \>", "Text"], Cell[BoxData[ \(\(PlotResult[{logtime, adaptive, fixstep}, PlotStyle \[Rule] {RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}];\)\)], "Input"], Cell["\<\ Plot difference temperature vs. time in respect to fixstep: \ logtime-fixstep in red, adaptive-fixstep in green. \ \>", "Text"], Cell[BoxData[ \(\(PlotResult[Difference[fixstep, {logtime, \ adaptive}], PlotStyle \[Rule] {RGBColor[1, 0, 0], RGBColor[0, 1, 0]}];\)\)], "Input"], Cell["\<\ Plot Log10[temperature] vs. Log10[time]. It is common to make such \ a plot in electro-thermal simulation. logtime is red, adaptive is green, \ fixstep is blue. It was necessary to take Abs as because of numerical errors \ there were negative values.\ \>", "Text"], Cell[BoxData[ \(\(PlotResult[{logtime, adaptive, fixstep}, PlotStyle \[Rule] {RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}, FunctionX \[Rule] Log10, FunctionY \[Rule] \((Log10[Abs[#]] &)\)];\)\)], "Input"], Cell["\<\ As one can see, there is considerable difference in results for \ different strategies. This means that the numerical integration in time \ introduces numerical errors and it is important to remember about this while \ comparing results of the reduced model with those from ANSYS. The question \ what a simulation strategy for integration in time is the best is left as an \ exercise. Below we make comparison of the reduced system with ANSYS results for logtime \ only.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Transient Simulation of the Reduced System", "Subtitle"], Cell["\<\ In order to integrate the reduced system in time, there are two \ choices. First is to use the same integration method and the same integration \ points as in ANSYS.\ \>", "Text"], Cell[BoxData[ \(res1\ = \ AnsysTransientSolution[XSeries[logtime], sys]\)], "Input"], Cell[TextData[{ "Second is to employ NDSolve (an integrator available in ", StyleBox["Mathematica", FontSlant->"Italic"], "). NDSolve chooses integration points adaptively by itself." }], "Text"], Cell[BoxData[ \(res2\ = \ TransientSolution[XSeries[logtime], sys, Verbose \[Rule] True]\)], "Input"], Cell["\<\ We can expect that the solution by NDSolve is more accurate but it \ takes more time. The simulation time can be recorded by means of function \ AbsoluteTiming.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Comparing Results of Transient Simulation of Reduced and ANSYS \ models\ \>", "Subtitle"], Cell["\<\ As was mentioned above, we will use logtime simulation results from \ ANSYS. \ \>", "Text"], Cell["\<\ Plot temperature vs. time. ANSYS model is red, reduced model is \ green for res1 and blue for res2.\ \>", "Text"], Cell[BoxData[ \(\(PlotResult[{logtime, res1, res2}, PlotStyle \[Rule] {RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}];\)\)], "Input"], Cell["\<\ Plot difference temperature vs. Log10[time] in respect to ANSYS. \ \ \>", "Text"], Cell[BoxData[ \(\(PlotResult[Difference[logtime, {res1, \ res2}], PlotStyle \[Rule] {RGBColor[0, 1, 0], RGBColor[0, 0, 1]}, FunctionX \[Rule] Log10];\)\)], "Input"], Cell["\<\ It is interesting to see that the difference between res1 and ANSYS \ results is smaller than for res2. However, it should be noted that res2 is \ more accurate than res1! The explanation is simple. When we use \ AnsysSimulationResult, it introduces about the same numerical errors during \ the time integration as ANSYS by itself. Note that the difference between \ res2 and ANSYS is comparable with that between logtime and adaptive for \ ANSYS.\ \>", "Text"], Cell["\<\ Plot Log10[temperature] vs. Log10[time]. It is a common plot in \ electro-thermal simulation. ANSYS model is red, reduced model is green for \ res1 and blue for res2. It was necessary to take Abs as because of numerical \ errors there were negative values.\ \>", "Text"], Cell[BoxData[ \(\(PlotResult[{logtime, res1, res2}, PlotStyle \[Rule] {RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}, FunctionX \[Rule] Log10, FunctionY \[Rule] \((Log10[Abs[#]] &)\)];\)\)], "Input"], Cell["\<\ The last plots reveals that the reduced model overestimate \ temperatures at the beginning. This was hidden above as the absolute error is \ actually quite small. \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Local Error Indicator", "Subtitle"], Cell[TextData[{ "We can estimate local error and choose an optimal dimension of the reduced \ system as described in paper ", ButtonBox["Error indicators for fully automatic extraction of heat-transfer \ macromodels for MEMS", ButtonData:>{ URL[ "http://stacks.iop.org/0960-1317/15/430"], None}, ButtonStyle->"Hyperlink"], "." }], "Text"], Cell["Compute an error indicator for 1, 10, and 100 Hz.", "Text"], Cell[BoxData[ \(\(er1 = LocalErrorIndicator[FrequencyConvergence[1, sys]];\)\)], "Input"], Cell[BoxData[ \(\(er10 = LocalErrorIndicator[FrequencyConvergence[10, sys]];\)\)], "Input"], Cell[BoxData[ \(\(er100 = LocalErrorIndicator[FrequencyConvergence[100, sys]];\)\)], "Input"], Cell["Make a plot Log10[Relative Error] vs. system dimension", "Text"], Cell[BoxData[ \(\(MultipleListPlot[{er1, er10, er100}, SymbolShape \[Rule] {PlotSymbol[Triangle, Filled \[Rule] False], PlotSymbol[Box, Filled \[Rule] False], PlotSymbol[Diamond, Filled \[Rule] False]}, SymbolStyle \[Rule] {RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}, PlotLegend \[Rule] {"\<1 Hz\>", "\<10 Hz\>", "\<100 Hz\>"}, LegendBorder \[Rule] {}, LegendPosition \[Rule] {\(-0.7\), \(-0.4\)}, LegendSize \[Rule] {0.8, 0.28}, Evaluate[Imtek`Post4MOR`Private`defaultPlotOptions]];\)\)], "Input"], Cell["\<\ What a frequency and what tolerance to choose in order to determine \ an optimal model dimension depends on an engineering problem.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Using SLICOT for Sequential Model Reduction", "Subtitle"], Cell[TextData[{ "A reduced model obtained by MOR for ANSYS can be reduced even further. For \ details, see paper cited in the previous section.\n\nSLICOT (", ButtonBox["http://www.slicot.de/", ButtonData:>{ URL[ "http://www.slicot.de/"], None}, ButtonStyle->"Hyperlink"], ") is a library implementing several Grammian-based methods for model \ reduction. Mathlink interface to SLICOT is available at ", ButtonBox["http://evgenii.rudnyi.ru/soft/slicot.tar.gz", ButtonData:>{ URL[ "http://evgenii.rudnyi.ru/soft/slicot.tar.gz"], None}, ButtonStyle->"Hyperlink"], ". In the documentation, you will find an example of the application of \ SLICOT to the microthruster model." }], "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"5.2 for Macintosh", ScreenRectangle->{{0, 1024}, {0, 702}}, WindowSize->{621, 616}, WindowMargins->{{91, Automatic}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{1, Automatic} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 58, 0, 168, "Title"], Cell[1837, 55, 387, 10, 55, "Text"], Cell[CellGroupData[{ Cell[2249, 69, 62, 0, 91, "Subtitle"], Cell[2314, 71, 63, 0, 36, "Text"], Cell[2380, 73, 36, 0, 32, "Input"], Cell[2419, 75, 150, 3, 55, "Text"], Cell[2572, 80, 46, 1, 33, "Input"], Cell[2621, 83, 440, 11, 74, "Text"], Cell[3064, 96, 167, 3, 59, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[3268, 104, 33, 0, 59, "Subtitle"], Cell[3304, 106, 93, 3, 36, "Text"], Cell[3400, 111, 42, 0, 36, "Text"], Cell[3445, 113, 60, 1, 33, "Input"], Cell[3508, 116, 62, 0, 36, "Text"], Cell[3573, 118, 241, 4, 71, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3851, 127, 71, 0, 91, "Subtitle"], Cell[3925, 129, 211, 6, 93, "Text"], Cell[4139, 137, 177, 3, 71, "Input"], Cell[4319, 142, 137, 3, 55, "Text"], Cell[4459, 147, 172, 3, 52, "Input"], Cell[4634, 152, 274, 5, 93, "Text"], Cell[4911, 159, 252, 4, 90, "Input"], Cell[5166, 165, 495, 10, 169, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[5698, 180, 62, 0, 91, "Subtitle"], Cell[5763, 182, 189, 4, 74, "Text"], Cell[5955, 188, 89, 1, 33, "Input"], Cell[6047, 191, 205, 5, 55, "Text"], Cell[6255, 198, 122, 3, 52, "Input"], Cell[6380, 203, 184, 4, 74, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6601, 212, 99, 3, 123, "Subtitle"], Cell[6703, 217, 101, 3, 36, "Text"], Cell[6807, 222, 123, 3, 55, "Text"], Cell[6933, 227, 170, 3, 71, "Input"], Cell[7106, 232, 91, 3, 36, "Text"], Cell[7200, 237, 186, 3, 71, "Input"], Cell[7389, 242, 471, 8, 131, "Text"], Cell[7863, 252, 280, 5, 93, "Text"], Cell[8146, 259, 245, 4, 90, "Input"], Cell[8394, 265, 187, 4, 55, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[8618, 274, 41, 0, 59, "Subtitle"], Cell[8662, 276, 358, 9, 74, "Text"], Cell[9023, 287, 65, 0, 36, "Text"], Cell[9091, 289, 93, 1, 52, "Input"], Cell[9187, 292, 104, 2, 52, "Input"], Cell[9294, 296, 106, 2, 52, "Input"], Cell[9403, 300, 70, 0, 36, "Text"], Cell[9476, 302, 609, 10, 223, "Input"], Cell[10088, 314, 155, 3, 55, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[10280, 322, 63, 0, 91, "Subtitle"], Cell[10346, 324, 720, 15, 169, "Text"] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)