(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 9.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 47483, 1408] NotebookOptionsPosition[ 42717, 1257] NotebookOutlinePosition[ 43266, 1278] CellTagsIndexPosition[ 43223, 1275] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["\<\ MMQ para fun\[CCedilla]\[OTilde]es n\[ATilde]o-lineares em apenas 1 ou 2 par\ \[AHat]metros e lineares nos demais\ \>", "Subtitle", CellChangeTimes->{{3.5931567226747637`*^9, 3.5931567678177023`*^9}, { 3.593793885447564*^9, 3.5937938933388453`*^9}, {3.6252176086592817`*^9, 3.62521761109692*^9}, 3.6742947506776114`*^9}], Cell["Vito, 7/6/2016", "Text", CellChangeTimes->{{3.674297229258487*^9, 3.674297235812721*^9}}], Cell[BoxData[ RowBox[{"Needs", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.674297613115051*^9, 3.6742976208641424`*^9}}], Cell[CellGroupData[{ Cell["dados experimentais", "Subsubsection", CellChangeTimes->{{3.59401751458419*^9, 3.5940175203044357`*^9}}], Cell[BoxData[ RowBox[{"seno", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "490", ",", "210"}], "}"}], ",", RowBox[{"{", RowBox[{"33", ",", "1400", ",", "400"}], "}"}], ",", RowBox[{"{", RowBox[{"67", ",", RowBox[{"-", "850"}], ",", "350"}], "}"}], ",", RowBox[{"{", RowBox[{"100", ",", RowBox[{"-", "130"}], ",", "220"}], "}"}]}], "}"}]}]], "Input", CellChangeTimes->{{3.5940173424659224`*^9, 3.5940175014279203`*^9}, { 3.6252206174052944`*^9, 3.6252206359687357`*^9}}], Cell[BoxData[ RowBox[{"graficoDados", "=", RowBox[{"ErrorListPlot", "[", RowBox[{"seno", ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5940175485388536`*^9, 3.5940175634607515`*^9}, { 3.59401774491718*^9, 3.5940177502609377`*^9}, {3.6252207060035896`*^9, 3.625220708191188*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Ajuste dos par\[AHat]metros", "Subsection"]], \ "Subsubsection", CellChangeTimes->{{3.5940177602765784`*^9, 3.5940177652297106`*^9}}], Cell[BoxData[ RowBox[{"fitSemCuidado", "=", RowBox[{"NonlinearModelFit", "[", RowBox[{ RowBox[{"seno", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Alpha]", " ", RowBox[{"Sin", "[", RowBox[{"\[Omega]", " ", "t"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"\[Alpha]", ",", "\[Omega]"}], "}"}], ",", RowBox[{"{", "t", "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.594017572257639*^9, 3.594017656382766*^9}, { 3.5940177281827803`*^9, 3.594017730120283*^9}, {3.59401781990413*^9, 3.5940178371385307`*^9}, {3.6252207618033237`*^9, 3.6252207636784086`*^9}}], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"{", RowBox[{"graficoDados", ",", RowBox[{"Plot", "[", RowBox[{ RowBox[{"fitSemCuidado", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "100"}], "}"}]}], "]"}]}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.5940177338390384`*^9, 3.5940177364484177`*^9}, { 3.5940177886853333`*^9, 3.5940178446385417`*^9}}], Cell[BoxData[ RowBox[{"fitSemPesos", "=", RowBox[{"NonlinearModelFit", "[", RowBox[{ RowBox[{"seno", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Alpha]", " ", RowBox[{"Sin", "[", RowBox[{"\[Omega]", " ", "t"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Alpha]", ",", "1000"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Omega]", ",", "0.06"}], "}"}]}], "}"}], ",", RowBox[{"{", "t", "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5940178567323103`*^9, 3.594017877263591*^9}, { 3.594019806841358*^9, 3.594019809872613*^9}, {3.6252208296825776`*^9, 3.6252208314639482`*^9}}], Cell[BoxData[ RowBox[{"fitSemPesos", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.5940198279820147`*^9, 3.5940198397476573`*^9}}], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"{", RowBox[{"graficoDados", ",", RowBox[{"Plot", "[", RowBox[{ RowBox[{"fitSemPesos", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "100"}], "}"}]}], "]"}]}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.594017901263627*^9, 3.594017902607379*^9}, { 3.59401981490387*^9, 3.5940198169663725`*^9}}], Cell[BoxData[ RowBox[{"fitCerto", "=", RowBox[{"NonlinearModelFit", "[", RowBox[{ RowBox[{"seno", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Alpha]", " ", RowBox[{"Sin", "[", RowBox[{"\[Omega]", " ", "t"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Alpha]", ",", "1000"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Omega]", ",", "0.06"}], "}"}]}], "}"}], ",", RowBox[{"{", "t", "}"}], ",", RowBox[{"Weights", "\[Rule]", RowBox[{"1", "/", RowBox[{ RowBox[{"seno", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], ",", RowBox[{"VarianceEstimatorFunction", "\[Rule]", RowBox[{"(", RowBox[{"1", "&"}], ")"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.594019851747675*^9, 3.594019893653988*^9}, { 3.5940223879101863`*^9, 3.5940223909883175`*^9}, {3.625220848058557*^9, 3.6252208531681733`*^9}}], Cell["\<\ Note que a principal mudan\[CCedilla]a por usar os pesos corretos \ est\[AAcute] no desvio-padr\[ATilde]o de \[Omega]\ \>", "Text", CellChangeTimes->{{3.594019934075924*^9, 3.594019962435342*^9}}], Cell[BoxData[ RowBox[{"fitCerto", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.5940199007946243`*^9, 3.594019908669636*^9}, { 3.5940223952383223`*^9, 3.5940223959726973`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Verificando a tendenciosidade por simula\[CCedilla]\[ATilde]o", \ "Subsection", CellChangeTimes->{{3.5940199804978685`*^9, 3.594019989404132*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"simulacaoMedicao", "[", RowBox[{"dados_", ",", "a_", ",", "\[Omega]_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "\[Sigma]", ",", "y"}], "}"}], ",", RowBox[{ RowBox[{"x", "=", RowBox[{"dados", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"\[Sigma]", "=", RowBox[{"dados", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"RandomVariate", "[", RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{"a", " ", RowBox[{"Sin", "[", RowBox[{"\[Omega]", " ", RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}]}], " ", "]"}]}], ",", RowBox[{"\[Sigma]", "[", RowBox[{"[", "i", "]"}], "]"}]}], " ", "]"}], " ", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "dados", "]"}]}], "}"}]}], " ", "]"}]}]}], " ", "]"}]}]], "Input", CellChangeTimes->{{3.594019992872887*^9, 3.594020040935459*^9}, { 3.594020093263663*^9, 3.5940203212327547`*^9}, {3.594020359873438*^9, 3.594020360201564*^9}, {3.5940205138736687`*^9, 3.594020515014296*^9}}], Cell[BoxData[ RowBox[{"simulacaoMedicao", "[", RowBox[{"seno", ",", "1000", ",", "0.06"}], "]"}]], "Input", CellChangeTimes->{{3.5940203406234097`*^9, 3.5940203522015514`*^9}, { 3.594020521529931*^9, 3.594020522467432*^9}, {3.62522092589065*^9, 3.625220927765746*^9}}], Cell[BoxData[ RowBox[{"fit", "=", RowBox[{"NonlinearModelFit", "[", RowBox[{ RowBox[{"simulacaoMedicao", "[", RowBox[{"seno", ",", "1267", ",", "0.0615"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Alpha]", " ", RowBox[{"Sin", "[", RowBox[{"\[Omega]", " ", "t"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Alpha]", ",", "1000"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Omega]", ",", "0.06"}], "}"}]}], "}"}], ",", RowBox[{"{", "t", "}"}], ",", RowBox[{"Weights", "\[Rule]", RowBox[{"1", "/", RowBox[{ RowBox[{"seno", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], ",", RowBox[{"VarianceEstimatorFunction", "\[Rule]", RowBox[{"(", RowBox[{"1", "&"}], ")"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5940204028735027`*^9, 3.5940204151703963`*^9}, { 3.5940205283111906`*^9, 3.594020529217444*^9}, {3.6252209413758373`*^9, 3.6252209485324397`*^9}}], Cell[BoxData[ RowBox[{"fit", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.594020611433366*^9, 3.5940206264958887`*^9}}], Cell["\<\ Criar uma fun\[CCedilla]\[ATilde]o que ajusta e devolve s\[OAcute] os par\ \[AHat]metros ajustados\ \>", "Text", CellChangeTimes->{{3.594020479451743*^9, 3.594020498936147*^9}}], Cell[BoxData[ RowBox[{"fit", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.594020637537458*^9, 3.594020657443738*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"fit", "[", "\"\\"", "]"}], "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.594021190366413*^9, 3.594021192788292*^9}}], Cell["\<\ Aten\[CCedilla]\[ATilde]o, n\[ATilde]o confundir o par\[AHat]metro da fun\ \[CCedilla]\[ATilde]o simulaFit - \[Omega]0 - com a vari\[AAcute]vel \[Omega] \ da fun\[CCedilla]\[ATilde]o \[Alpha] Sin[\[Omega] t] que entra em \ NonlinearModelFit\ \>", "Text", CellChangeTimes->{{3.5940213576791644`*^9, 3.594021421027299*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"simulaFit", "[", RowBox[{"dados_", ",", "a0_", ",", "\[Omega]0_"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"NonlinearModelFit", "[", RowBox[{ RowBox[{"simulacaoMedicao", "[", RowBox[{"dados", ",", "a0", ",", "\[Omega]0"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Alpha]", " ", RowBox[{"Sin", "[", RowBox[{"\[Omega]", " ", "t"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Alpha]", ",", "1000"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Omega]", ",", "0.06"}], "}"}]}], "}"}], ",", RowBox[{"{", "t", "}"}], ",", RowBox[{"Weights", "\[Rule]", RowBox[{"1", "/", RowBox[{ RowBox[{"dados", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], ",", RowBox[{"VarianceEstimatorFunction", "\[Rule]", RowBox[{"(", RowBox[{"1", "&"}], ")"}]}]}], "]"}], "[", "\"\\"", "]"}], "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}], " "}]], "Input", CellChangeTimes->{{3.5940205331549487`*^9, 3.5940206041989803`*^9}, { 3.5940210992256513`*^9, 3.594021171085134*^9}, {3.594021206538312*^9, 3.5940212194289565`*^9}, {3.5940213181947303`*^9, 3.5940213353666306`*^9}, { 3.5940220348784065`*^9, 3.594022040440915*^9}}], Cell[BoxData[ RowBox[{"simulaFit", "[", RowBox[{"seno", ",", " ", "1268.", ",", "0.0615"}], "]"}]], "Input", CellChangeTimes->{{3.5940212252727156`*^9, 3.5940212640540237`*^9}, { 3.625221004692418*^9, 3.6252210070206547`*^9}}], Cell["\<\ \[AGrave]s vezes, o algoritmo de NonlinearModelFit pode n\[ATilde]o encontrar \ o m\[IAcute]nimo com a precis\[ATilde]o estabelecida (quando n\[ATilde]o se \ estabelece um AccuracyGoal, a rotina usa AccuracyGoal=1/2 PrecisionGoal que, \ por default, \[EAcute] MachinePrecision=16 d\[IAcute]gitos. Assim, ele est\ \[AAcute] tentando encontrar os valores com 8 d\[IAcute]gitos de precis\ \[ATilde]o, que pode ser muito. Nesse caso, pode-se mudar simulaFit para \ incluir na chamada de NolinearModelFit a op\[CCedilla]\[ATilde]o AccuracyGoal\ \[Rule]5, por exemplo.\ \>", "Text", CellChangeTimes->{{3.5940216302167206`*^9, 3.5940217394981346`*^9}, { 3.594021798174926*^9, 3.594021894659446*^9}, {3.5940219919564667`*^9, 3.594022027315895*^9}, {3.6252211639517307`*^9, 3.625221239830619*^9}, { 3.6252212840203915`*^9, 3.625221286973668*^9}}], Cell[BoxData[ RowBox[{"repeticoes", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"simulaFit", "[", RowBox[{"seno", ",", " ", "1268.", ",", "0.0615"}], "]"}], ",", RowBox[{"{", "10000", "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5940214251523046`*^9, 3.5940214543554735`*^9}, { 3.62522102677166*^9, 3.625221027396692*^9}}], Cell[BoxData[ RowBox[{"GraphicsRow", "[", " ", RowBox[{"{", RowBox[{ RowBox[{"Histogram", "[", RowBox[{"repeticoes", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}], " ", "]"}], ",", RowBox[{"Histogram", "[", RowBox[{"repeticoes", "[", RowBox[{"[", RowBox[{"All", ",", "2"}], "]"}], "]"}], " ", "]"}]}], "}"}], " ", "]"}]], "Input", CellChangeTimes->{{3.594021477277383*^9, 3.5940215181384273`*^9}, { 3.5940221115503964`*^9, 3.594022117144155*^9}, {3.6252212589409804`*^9, 3.625221264191247*^9}}], Cell[BoxData[ RowBox[{"Mean", "[", "repeticoes", "]"}]], "Input", CellChangeTimes->{{3.5940215321384487`*^9, 3.5940215382478323`*^9}, { 3.5940221219879117`*^9, 3.594022122909787*^9}, {3.6252212955834756`*^9, 3.6252212961929073`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"StandardDeviation", "[", "repeticoes", "]"}], "/", "100"}]], "Input", CellChangeTimes->{{3.594021566951*^9, 3.5940215861541543`*^9}, { 3.5940221274566703`*^9, 3.5940221284722977`*^9}, {3.62522130083377*^9, 3.6252213015681696`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Mean", "[", "repeticoes", "]"}], "-", RowBox[{"{", RowBox[{"1268.", ",", "0.0615"}], "}"}]}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"StandardDeviation", "[", "repeticoes", "]"}], "/", "100"}], ")"}]}]], "Input", CellChangeTimes->{{3.5940222031755342`*^9, 3.5940222306599503`*^9}, { 3.625221305959032*^9, 3.6252213105373783`*^9}}], Cell["\<\ Neste caso, a tendenciosidade \[EAcute] pequena, muito menor que o \ desvio-padr\[ATilde]o do resultado, e n\[ATilde]o precisa ser corrigida - h\ \[AAcute] algo errado com os n\[UAcute]meros do texto! J\[AAcute] o \ desvio-padr\[ATilde]o estimado merece ser modificado:\ \>", "Text", CellChangeTimes->{{3.5940222673006306`*^9, 3.5940223100350695`*^9}, { 3.5940224135196*^9, 3.594022454425911*^9}}], Cell[BoxData[ RowBox[{"StandardDeviation", "[", "repeticoes", "]"}]], "Input", CellChangeTimes->{{3.5940222412693415`*^9, 3.5940222590037427`*^9}, 3.594022359894518*^9, {3.6252213188503036`*^9, 3.6252213226317663`*^9}}], Cell[BoxData[ RowBox[{"fitCerto", "[", "\"\\"", "]"}]], "Input"], Cell["Conclus\[ATilde]o: A= = 1270(300), \[Omega]=0,0615(20) ", "Text", CellChangeTimes->{{3.5940224786759477`*^9, 3.594022515379128*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Frequentemente \[EAcute] melhor desenhar a curva de soma dos res\[IAcute]duos \ em fun\[CCedilla]\[ATilde]o do par\[AHat]metro n\[ATilde]o-linear\ \>", "Subsection", CellChangeTimes->{{3.62522241883295*^9, 3.6252224612101116`*^9}, { 3.6742967305544267`*^9, 3.6742967324354715`*^9}}], Cell[CellGroupData[{ Cell["\<\ primeiro, um exemplo no caso de um \[UAcute]nico par\[AHat]metro \ n\[ATilde]o-linear\ \>", "Subsubsection", CellChangeTimes->{{3.6742967786380177`*^9, 3.6742968001025467`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"qChapeu", "[", RowBox[{"dado_", ",", "\[Omega]_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"u", ",", "aChapeu"}], "}"}], ",", RowBox[{ RowBox[{"u", "=", RowBox[{"Sin", "[", RowBox[{"\[Omega]", " ", RowBox[{"dado", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}]}], " ", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"aChapeu", "=", RowBox[{ RowBox[{"Total", "[", " ", RowBox[{ RowBox[{"dado", "[", RowBox[{"[", RowBox[{"All", ",", "2"}], "]"}], "]"}], " ", RowBox[{"u", "/", RowBox[{ RowBox[{"dado", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], " ", "]"}], "/", RowBox[{"Total", "[", RowBox[{ RowBox[{"u", "^", "2"}], "/", RowBox[{ RowBox[{"dado", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}], " ", "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Total", "[", " ", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"dado", "[", RowBox[{"[", RowBox[{"All", ",", "2"}], "]"}], "]"}], "-", RowBox[{"aChapeu", " ", "u"}]}], ")"}], "^", "2"}], "/", RowBox[{ RowBox[{"dado", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}], " ", "]"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input", CellChangeTimes->{{3.6252226168129606`*^9, 3.625222862821102*^9}, { 3.625222914589403*^9, 3.625222915526932*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"qChapeu", "[", RowBox[{"seno", ",", "\[Omega]"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Omega]", ",", "0.001", ",", "0.2"}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\[Omega]", ",", RowBox[{"OverHat", "[", "Q", "]"}]}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.62522292074594*^9, 3.625222968967987*^9}, { 3.625241412006819*^9, 3.6252414607252784`*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"qChapeu", "[", RowBox[{"seno", ",", "\[Omega]"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Omega]", ",", "0.05", ",", "0.07"}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\[Omega]", ",", RowBox[{"OverHat", "[", "Q", "]"}]}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.674296817897702*^9, 3.6742968277989855`*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ quando n\[ATilde]o se observa o fen\[OHat]meno em toda sua faixa de varia\ \[CCedilla]\[ATilde]o, \[EAcute] muito pior\ \>", "Subsection", CellChangeTimes->{{3.6252230112670355`*^9, 3.6252230458938093`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"simulSeno", "[", RowBox[{ "a_", ",", "\[Sigma]a_", ",", "fperiodo_", ",", "n_", ",", "periodo_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"t", ",", "u"}], "}"}], ",", RowBox[{ RowBox[{"t", "=", " ", RowBox[{"fperiodo", " ", "periodo", " ", RowBox[{ RowBox[{"Range", "[", "n", "]"}], "/", "n"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"u", "=", RowBox[{"a", " ", RowBox[{"Sin", "[", RowBox[{"2", "Pi", " ", RowBox[{"t", " ", "/", "periodo"}]}], " ", "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"t", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"RandomVariate", "[", " ", RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{"u", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "\[Sigma]a"}], " ", "]"}], " ", "]"}], ",", "\[Sigma]a"}], " ", "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "n"}], "}"}]}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input", CellChangeTimes->{{3.6252231077407246`*^9, 3.625223297032484*^9}, { 3.625239423555213*^9, 3.6252394614127293`*^9}, {3.6252394950245533`*^9, 3.625239615961882*^9}, 3.6252409348212147`*^9, {3.6252410026798787`*^9, 3.625241009524127*^9}, {3.625241067132966*^9, 3.6252410987412634`*^9}, { 3.625241231226158*^9, 3.6252412416331663`*^9}, {3.625241318899021*^9, 3.625241329337281*^9}}], Cell[BoxData[ RowBox[{"facil", "=", RowBox[{"simulSeno", "[", RowBox[{"1000", ",", "100", ",", "1", ",", "4", ",", "100"}], "]"}]}]], "Input", CellChangeTimes->{{3.625240852428999*^9, 3.625240884927963*^9}, { 3.625241275895887*^9, 3.6252412772553606`*^9}, {3.625241333053831*^9, 3.625241349226885*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"qChapeu", "[", RowBox[{"facil", ",", "\[Omega]"}], "]"}], ",", RowBox[{"{", RowBox[{"\[Omega]", ",", "0.001", ",", RowBox[{"4", RowBox[{"Pi", "/", "100"}]}]}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\[Omega]", ",", RowBox[{"OverHat", "[", "Q", "]"}]}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.625241375213154*^9, 3.625241401740449*^9}, 3.625241475366967*^9}] }, Open ]], Cell[CellGroupData[{ Cell["\<\ mude a incerteza e a fra\[CCedilla]\[ATilde]o do per\[IAcute]odo e veja como \ o m\[IAcute]nimo perde defini\[CCedilla]\[ATilde]o\ \>", "Subsection", CellChangeTimes->{{3.625241653600442*^9, 3.6252416858684187`*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Evaluate", "[", " ", RowBox[{"qChapeu", "[", RowBox[{ RowBox[{"simulSeno", "[", RowBox[{"1000", ",", "30", ",", "0.1", ",", "4", ",", "100"}], "]"}], ",", "\[Omega]"}], "]"}], " ", "]"}], ",", RowBox[{"{", RowBox[{"\[Omega]", ",", "0.001", ",", RowBox[{"8", RowBox[{"Pi", "/", "100"}]}]}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\[Omega]", ",", RowBox[{"OverHat", "[", "Q", "]"}]}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.6252414959153414`*^9, 3.6252416204938717`*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["N\[ATilde]o linear em dois dos par\[AHat]metros", "Subtitle", CellChangeTimes->{{3.6252215075113025`*^9, 3.625221515621584*^9}}], Cell[CellGroupData[{ Cell["forma funcional", "Subsubsection", CellChangeTimes->{{3.5941005273394938`*^9, 3.5941005409176407`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", RowBox[{"t_", ",", "a_", ",", "b_", ",", "w1_", ",", "w2_"}], "]"}], ":=", RowBox[{ RowBox[{"a", " ", RowBox[{"Sin", "[", RowBox[{"w1", " ", "t"}], "]"}]}], "+", RowBox[{"b", " ", RowBox[{"Cos", "[", RowBox[{"w2", " ", "t"}], "]"}]}]}]}]], "Input", CellChangeTimes->{{3.5940615052516255`*^9, 3.5940615905842066`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Ajuste dos par\[AHat]metros a dados com boa precis\[ATilde]o", "Section", CellChangeTimes->{{3.5940630897482824`*^9, 3.594063113515149*^9}}], Cell[CellGroupData[{ Cell["dados experimentais", "Subsubsection", CellChangeTimes->{{3.594100551573907*^9, 3.5941005542145357`*^9}}], Cell[BoxData[ RowBox[{"p2", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "170", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "188", ",", "11"}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "213", ",", "12"}], "}"}], ",", RowBox[{"{", RowBox[{"16", ",", "235", ",", "12"}], "}"}], ",", RowBox[{"{", RowBox[{"21", ",", "209", ",", "12"}], "}"}], ",", RowBox[{"{", RowBox[{"26", ",", "199", ",", "11"}], "}"}], ",", RowBox[{"{", RowBox[{"31", ",", "200", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"37", ",", "124", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"42", ",", "91", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"47", ",", "37", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"52", ",", RowBox[{"-", "29"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"58", ",", RowBox[{"-", "78"}], ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"63", ",", RowBox[{"-", "125"}], ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"68", ",", RowBox[{"-", "190"}], ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"73", ",", RowBox[{"-", "228"}], ",", "12"}], "}"}], ",", RowBox[{"{", RowBox[{"79", ",", RowBox[{"-", "261"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"84", ",", RowBox[{"-", "287"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"89", ",", RowBox[{"-", "282"}], ",", "15"}], "}"}], ",", RowBox[{"{", RowBox[{"94", ",", RowBox[{"-", "274"}], ",", "14"}], "}"}], ",", RowBox[{"{", RowBox[{"99", ",", RowBox[{"-", "212"}], ",", "13"}], "}"}], ",", RowBox[{"{", RowBox[{"105", ",", RowBox[{"-", "211"}], ",", "11"}], "}"}], ",", RowBox[{"{", RowBox[{"110", ",", RowBox[{"-", "154"}], ",", "9"}], "}"}], ",", RowBox[{"{", RowBox[{"115", ",", RowBox[{"-", "99"}], ",", "7"}], "}"}], ",", RowBox[{"{", RowBox[{"120", ",", RowBox[{"-", "58"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"126", ",", "5", ",", "4"}], "}"}]}], "}"}]}]], "Input", CellChangeTimes->{{3.5940624105531445`*^9, 3.5940624119907207`*^9}, { 3.6252215549204645`*^9, 3.625221555717379*^9}, {3.625221599844673*^9, 3.625221600063405*^9}}], Cell[BoxData[ RowBox[{"ErrorListPlot", "[", RowBox[{"p2", ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input", CellChangeTimes->{{3.594062440289071*^9, 3.5940624580243998`*^9}, { 3.625221621611413*^9, 3.6252216217207756`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["ajuste e resultados", "Subsubsection", CellChangeTimes->{{3.5941005634645495`*^9, 3.594100565698928*^9}}], Cell[BoxData[ RowBox[{"fit", "=", RowBox[{"NonlinearModelFit", "[", RowBox[{ RowBox[{"p2", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"f", "[", RowBox[{"t", ",", "a1", ",", "a2", ",", "w1", ",", "w2"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"a1", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"a2", ",", "180"}], "}"}], ",", RowBox[{"{", RowBox[{"w1", ",", "0.05"}], "}"}], ",", RowBox[{"{", RowBox[{"w2", ",", "0.03"}], "}"}]}], "}"}], ",", "t", ",", RowBox[{"Weights", "\[Rule]", RowBox[{"1", "/", RowBox[{ RowBox[{"p2", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], ",", RowBox[{"VarianceEstimatorFunction", "\[Rule]", RowBox[{"(", RowBox[{"1", "&"}], ")"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.594062480181776*^9, 3.5940626017206683`*^9}, { 3.594063241023388*^9, 3.5940632554772615`*^9}, {3.594063386155981*^9, 3.594063408908242*^9}, {3.625221629580558*^9, 3.6252216348308268`*^9}}], Cell[BoxData[ RowBox[{"fit", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.594062526591748*^9, 3.594062533107713*^9}, { 3.5940626092679653`*^9, 3.594062620690436*^9}}], Cell[BoxData[ RowBox[{"chiP2", "=", RowBox[{"Total", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"fit", "[", "\"\\"", "]"}], "/", RowBox[{"p2", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}]}], ")"}], "^", "2"}], " ", "]"}]}]], "Input", CellChangeTimes->{{3.59406486393932*^9, 3.594064871017786*^9}, { 3.594064983804948*^9, 3.5940649871176214`*^9}, {3.62522164519073*^9, 3.625221654597465*^9}}], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"w1", ",", "w2"}], "]"}]], "Input", CellChangeTimes->{{3.6742970638392577`*^9, 3.67429706909533*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["estimativas precisam ser precisas", "Subsubsection", CellChangeTimes->{{3.5941005768708196`*^9, 3.5941005812145767`*^9}}], Cell[BoxData[ RowBox[{"NonlinearModelFit", "[", RowBox[{ RowBox[{"p2", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"f", "[", RowBox[{"t", ",", "a1", ",", "w1", ",", "a2", ",", "w2"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"a1", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"w1", ",", "180"}], "}"}], ",", RowBox[{"{", RowBox[{"a2", ",", "0.03"}], "}"}], ",", RowBox[{"{", RowBox[{"w2", ",", "0.08"}], "}"}]}], "}"}], ",", "t", ",", RowBox[{"Weights", "\[Rule]", RowBox[{"1", "/", RowBox[{ RowBox[{"p2", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], ",", RowBox[{"VarianceEstimatorFunction", "\[Rule]", RowBox[{"(", RowBox[{"1", "&"}], ")"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.5940626897257247`*^9, 3.594062711945631*^9}, { 3.5940632677122965`*^9, 3.594063296541935*^9}, {3.5940634224402065`*^9, 3.5940634790993876`*^9}, {3.6252216659417987`*^9, 3.625221671504572*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["gr\[AAcute]ficos para avalia\[CCedilla]\[ATilde]o da qualidade do \ ajuste", "Subsubsection", CellChangeTimes->{{3.594100589198963*^9, 3.5941006131833744`*^9}}], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"{", RowBox[{ RowBox[{"ErrorListPlot", "[", RowBox[{"p2", ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}], ",", RowBox[{"Plot", "[", RowBox[{ RowBox[{"fit", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "130"}], "}"}]}], "]"}]}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.5940628000908604`*^9, 3.5940628300455728`*^9}, { 3.6252216837708516`*^9, 3.625221683942734*^9}}], Cell["\<\ \[EAcute] muito comum graficar-se o res\[IAcute]duo normalizado pelos \ desvios-padr\[OTilde]es dos dados, mas \[EAcute] melhor usar o desvio-padr\ \[ATilde]o do res\[IAcute]duo calculado com a matriz H, como no \ pr\[OAcute]ximo gr\[AAcute]fico, embora neste caso fa\[CCedilla]a pouca \ diferen\[CCedilla]a porque temos um bom n\[UAcute]mero de dados, com precis\ \[OTilde]es semelhantes\ \>", "Text", CellChangeTimes->{{3.594100623980265*^9, 3.594100769652359*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{ RowBox[{"p2", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"fit", "[", "\"\\"", "]"}], "/", RowBox[{"p2", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}]}]}], "}"}], "]"}], " ", "]"}]], "Input", CellChangeTimes->{{3.594100378042392*^9, 3.594100410198695*^9}, { 3.6252217037989025`*^9, 3.625221707783477*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{ RowBox[{"p2", "[", RowBox[{"[", RowBox[{"All", ",", "1"}], "]"}], "]"}], ",", RowBox[{"fit", "[", "\"\\"", "]"}]}], "}"}], "]"}], " ", "]"}]], "Input", CellChangeTimes->{{3.5941004993238287`*^9, 3.59410050754259*^9}, { 3.6252217139556866`*^9, 3.6252217297064943`*^9}}], Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{ RowBox[{"fit", "[", "\"\\"", "]"}], ",", RowBox[{"fit", "[", "\"\\"", "]"}]}], "}"}], "]"}], " ", "]"}]], "Input", CellChangeTimes->{{3.594100462448773*^9, 3.594100469839409*^9}, { 3.594100774746117*^9, 3.594100784699257*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Simulando uma situa\[CCedilla]\[ATilde]o dif\[IAcute]cil, com a mesma fun\ \[CCedilla]\[ATilde]o do ajuste acima\ \>", "Section", CellChangeTimes->{{3.594063136156959*^9, 3.5940631651897235`*^9}}], Cell[CellGroupData[{ Cell["simula\[CCedilla]\[ATilde]o", "Subsubsection", CellChangeTimes->{{3.594100818699308*^9, 3.5941008208399363`*^9}}], Cell[BoxData[ RowBox[{"dados0", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"i", " ", RowBox[{"Pi", "/", "3"}]}], ",", RowBox[{"f", "[", RowBox[{ RowBox[{"i", " ", RowBox[{"Pi", "/", "3"}]}], ",", "100", ",", " ", "180.", ",", "0.055", ",", "0.035"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "100", ",", "19"}], "}"}]}], "]"}], " "}]], "Input", CellChangeTimes->{{3.5940631995352764`*^9, 3.59406320162913*^9}, { 3.594063370639524*^9, 3.594063371764579*^9}, {3.594063730425725*^9, 3.594063730831996*^9}}], Cell[BoxData[ RowBox[{"dp", "=", RowBox[{"Round", "[", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"Sqrt", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"0.20", " ", RowBox[{"dados0", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "^", "2"}], " ", "+", " ", "200"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "dados0", "]"}]}], "}"}]}], "]"}], " ", "]"}]}]], "Input", CellChangeTimes->{{3.5940633479039593`*^9, 3.5940633541074085`*^9}, { 3.5940638929981804`*^9, 3.5940638931856995`*^9}}], Cell[BoxData[ RowBox[{"simulacao", "=", RowBox[{"Round", "[", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"dados0", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", RowBox[{"RandomVariate", "[", RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{"dados0", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], ",", RowBox[{"dp", "[", RowBox[{"[", "i", "]"}], "]"}]}], " ", "]"}], " ", "]"}], ",", RowBox[{"dp", "[", RowBox[{"[", "i", "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "dados0", "]"}]}], "}"}]}], "]"}], " ", "]"}]}]], "Input", CellChangeTimes->{{3.594063507288384*^9, 3.5940635188827343`*^9}}], Cell[BoxData[ RowBox[{"ErrorListPlot", "[", RowBox[{"simulacao", ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]], "Input", CellChangeTimes->{{3.5940635577128887`*^9, 3.5940635600567336`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["ajuste e resultados", "Subsubsection", CellChangeTimes->{{3.5941008298555746`*^9, 3.5941008321212034`*^9}}], Cell[BoxData[ RowBox[{"fitSimulacao", "=", RowBox[{"NonlinearModelFit", "[", RowBox[{ RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"f", "[", RowBox[{"t", ",", "a1", ",", "a2", ",", "w1", ",", "w2"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"a1", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"a2", ",", "180"}], "}"}], ",", RowBox[{"{", RowBox[{"w1", ",", "0.05"}], "}"}], ",", RowBox[{"{", RowBox[{"w2", ",", "0.03"}], "}"}]}], "}"}], ",", "t", ",", RowBox[{"Weights", "\[Rule]", RowBox[{"1", "/", RowBox[{ RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], ",", RowBox[{"VarianceEstimatorFunction", "\[Rule]", RowBox[{"(", RowBox[{"1", "&"}], ")"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5940635832610693`*^9, 3.5940636384990544`*^9}, { 3.5940636794699144`*^9, 3.594063679751178*^9}}], Cell[BoxData[ RowBox[{"fitSimulacao", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.5940636514059563`*^9, 3.594063663187813*^9}}], Cell[BoxData[ RowBox[{"chiSimul", "=", RowBox[{"Total", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"fitSimulacao", "[", "\"\\"", "]"}], "/", RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}]}], ")"}], "^", "2"}], " ", "]"}]}]], "Input", CellChangeTimes->{{3.5940648424999847`*^9, 3.5940648453750744`*^9}, { 3.5940649685541525`*^9, 3.5940649729293804`*^9}}], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{"{", RowBox[{ RowBox[{"ErrorListPlot", "[", RowBox[{"simulacao", ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}], ",", RowBox[{"Plot", "[", RowBox[{ RowBox[{"fitSimulacao", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "120"}], "}"}]}], "]"}]}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.5940638602777295`*^9, 3.594063882575765*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Um procedimento mais informativo", "Section", CellChangeTimes->{{3.5940639339065676`*^9, 3.5940639391568413`*^9}}], Cell[CellGroupData[{ Cell["fixando w1 e w2, o ajuste \[EAcute] linear:", "Subsubsection", CellChangeTimes->{{3.5941008562462397`*^9, 3.5941008758400187`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"w1", "=", "0.05"}], ";", RowBox[{"w2", "=", "0.03"}]}]], "Input", CellChangeTimes->{{3.5940640950406017`*^9, 3.594064105744286*^9}, { 3.6252219290296707`*^9, 3.6252219314829345`*^9}}], Cell[BoxData[ RowBox[{"fitA", "=", RowBox[{"LinearModelFit", "[", RowBox[{ RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Sin", "[", RowBox[{"w1", " ", "t"}], "]"}], ",", RowBox[{"Cos", "[", RowBox[{"w2", " ", "t"}], "]"}]}], "}"}], ",", "t", ",", RowBox[{"IncludeConstantBasis", "\[Rule]", "False"}], ",", RowBox[{"Weights", "\[Rule]", RowBox[{"1", "/", RowBox[{ RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], ",", RowBox[{"VarianceEstimatorFunction", "\[Rule]", RowBox[{"(", RowBox[{"1", "&"}], ")"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5940639847223167`*^9, 3.594063996019784*^9}, { 3.594064027896449*^9, 3.594064148122096*^9}}], Cell[BoxData[ RowBox[{"Total", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"fitA", "[", "\"\\"", "]"}], "/", RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}]}], ")"}], "^", "2"}], " ", "]"}]], "Input", CellChangeTimes->{{3.594064161529052*^9, 3.5940641744672513`*^9}, { 3.5940643883181095`*^9, 3.594064416647704*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["\<\ soma dos quadrados dos res\[IAcute]duos em fun\[CCedilla]\[ATilde]o do par de \ valores w1 e w2 e os gr\[AAcute]ficos relacionados\ \>", "Subsubsection", CellChangeTimes->{{3.5941008853087826`*^9, 3.5941009831058044`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"q", "[", RowBox[{"simulacao_", ",", "w1_", ",", "w2_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "fitA", "}"}], ",", RowBox[{ RowBox[{"fitA", "=", RowBox[{"LinearModelFit", "[", RowBox[{ RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Sin", "[", RowBox[{"w1", " ", "t"}], "]"}], ",", RowBox[{"Cos", "[", RowBox[{"w2", " ", "t"}], "]"}]}], "}"}], ",", "t", ",", RowBox[{"IncludeConstantBasis", "\[Rule]", "False"}], ",", RowBox[{"Weights", "\[Rule]", RowBox[{"1", "/", RowBox[{ RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}], "^", "2"}]}]}], ",", RowBox[{"VarianceEstimatorFunction", "\[Rule]", RowBox[{"(", RowBox[{"1", "&"}], ")"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Total", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"fitA", "[", "\"\\"", "]"}], "/", RowBox[{"simulacao", "[", RowBox[{"[", RowBox[{"All", ",", "3"}], "]"}], "]"}]}], ")"}], "^", "2"}], " ", "]"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input", CellChangeTimes->{{3.5940644262419343`*^9, 3.5940645302168703`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["simulacao da medi\[CCedilla]\[ATilde]o com poucos dados", \ "Subsubsection", CellChangeTimes->{{3.5941009925276937`*^9, 3.594101002090208*^9}}], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"q", "[", RowBox[{"simulacao", ",", "w1", ",", "w2"}], "]"}], ",", RowBox[{"{", RowBox[{"w1", ",", "0.01", ",", "0.08"}], "}"}], ",", RowBox[{"{", RowBox[{"w2", ",", "0.01", ",", "0.08"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.594064541326807*^9, 3.5940646301595817`*^9}}], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"q", "[", RowBox[{"simulacao", ",", "w1", ",", "w2"}], "]"}], ",", RowBox[{"{", RowBox[{"w1", ",", "0.01", ",", "0.08"}], "}"}], ",", RowBox[{"{", RowBox[{"w2", ",", "0.01", ",", "0.06"}], "}"}], ",", RowBox[{"Contours", "\[Rule]", RowBox[{"Table", "[", RowBox[{ RowBox[{"chiSimul", "+", RowBox[{"n", "^", "2"}]}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "5"}], "}"}]}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.5940649381463156`*^9, 3.594064956475399*^9}, { 3.5940650013370953`*^9, 3.5940650298706675`*^9}, {3.594065060981666*^9, 3.594065062591107*^9}}], Cell[BoxData[ RowBox[{"fitSimulacao", "[", "\"\\"", "]"}]], "Input"] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{1350, 782}, WindowMargins->{{178, Automatic}, {50, Automatic}}, PrintingCopies->1, PrintingPageRange->{32000, 32000}, PrintingOptions->{"Magnification"->1., "PaperOrientation"->"Portrait", "PaperSize"->{595.1999999999999, 841.68}}, Magnification->1.4000000953674316`, FrontEndVersion->"10.4 for Microsoft Windows (64-bit) (April 11, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 338, 6, 77, "Subtitle"], Cell[920, 30, 96, 1, 42, "Text"], Cell[1019, 33, 147, 2, 42, "Input"], Cell[CellGroupData[{ Cell[1191, 39, 111, 1, 54, "Subsubsection"], Cell[1305, 42, 551, 15, 42, "Input"], Cell[1859, 59, 339, 7, 42, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[2235, 71, 158, 2, 55, "Subsubsection"], Cell[2396, 75, 728, 18, 42, "Input"], Cell[3127, 95, 411, 11, 42, "Input"], Cell[3541, 108, 795, 22, 42, "Input"], Cell[4339, 132, 155, 2, 42, "Input"], Cell[4497, 136, 402, 11, 42, "Input"], Cell[4902, 149, 1102, 31, 70, "Input"], Cell[6007, 182, 207, 4, 42, "Text"], Cell[6217, 188, 203, 3, 42, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6457, 196, 153, 2, 67, "Subsection"], Cell[6613, 200, 1539, 40, 97, "Input"], Cell[8155, 242, 278, 5, 42, "Input"], Cell[8436, 249, 1048, 28, 70, "Input"], Cell[9487, 279, 145, 2, 42, "Input"], Cell[9635, 283, 188, 4, 42, "Text"], Cell[9826, 289, 150, 2, 42, "Input"], Cell[9979, 293, 227, 5, 42, "Input"], Cell[10209, 300, 332, 6, 42, "Text"], Cell[10544, 308, 1429, 36, 97, "Input"], Cell[11976, 346, 233, 4, 42, "Input"], Cell[12212, 352, 855, 13, 124, "Text"], Cell[13070, 367, 352, 8, 42, "Input"], Cell[13425, 377, 574, 15, 42, "Input"], Cell[14002, 394, 240, 4, 42, "Input"], Cell[14245, 400, 275, 6, 42, "Input"], Cell[14523, 408, 427, 12, 42, "Input"], Cell[14953, 422, 410, 7, 70, "Text"], Cell[15366, 431, 225, 3, 42, "Input"], Cell[15594, 436, 82, 1, 42, "Input"], Cell[15679, 439, 139, 1, 42, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[15855, 445, 295, 5, 67, "Subsection"], Cell[CellGroupData[{ Cell[16175, 454, 188, 4, 54, "Subsubsection"], Cell[16366, 460, 1761, 52, 124, "Input"], Cell[18130, 514, 482, 12, 42, "Input"], Cell[18615, 528, 434, 11, 42, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[19098, 545, 218, 4, 67, "Subsection"], Cell[19319, 551, 1620, 42, 124, "Input"], Cell[20942, 595, 320, 7, 42, "Input"], Cell[21265, 604, 508, 14, 42, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[21810, 623, 227, 4, 67, "Subsection"], Cell[22040, 629, 643, 17, 70, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[22732, 652, 135, 1, 77, "Subtitle"], Cell[CellGroupData[{ Cell[22892, 657, 110, 1, 54, "Subsubsection"], Cell[23005, 660, 398, 11, 42, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[23440, 676, 147, 1, 96, "Section"], Cell[CellGroupData[{ Cell[23612, 681, 112, 1, 54, "Subsubsection"], Cell[23727, 684, 2415, 70, 124, "Input"], Cell[26145, 756, 249, 5, 42, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[26431, 766, 112, 1, 54, "Subsubsection"], Cell[26546, 769, 1201, 32, 70, "Input"], Cell[27750, 803, 194, 3, 42, "Input"], Cell[27947, 808, 478, 13, 42, "Input"], Cell[28428, 823, 150, 3, 42, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[28615, 831, 128, 1, 54, "Subsubsection"], Cell[28746, 834, 1153, 31, 70, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[29936, 870, 167, 2, 54, "Subsubsection"], Cell[30106, 874, 500, 14, 42, "Input"], Cell[30609, 890, 478, 8, 97, "Text"], Cell[31090, 900, 531, 15, 42, "Input"], Cell[31624, 917, 425, 11, 42, "Input"], Cell[32052, 930, 379, 9, 42, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[32480, 945, 207, 4, 96, "Section"], Cell[CellGroupData[{ Cell[32712, 953, 120, 1, 54, "Subsubsection"], Cell[32835, 956, 647, 18, 42, "Input"], Cell[33485, 976, 650, 19, 42, "Input"], Cell[34138, 997, 859, 24, 97, "Input"], Cell[35000, 1023, 207, 4, 42, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[35244, 1032, 114, 1, 54, "Subsubsection"], Cell[35361, 1035, 1129, 31, 97, "Input"], Cell[36493, 1068, 154, 2, 42, "Input"], Cell[36650, 1072, 456, 12, 42, "Input"], Cell[37109, 1086, 463, 13, 42, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[37621, 1105, 121, 1, 96, "Section"], Cell[CellGroupData[{ Cell[37767, 1110, 138, 1, 54, "Subsubsection"], Cell[37908, 1113, 224, 5, 42, "Input"], Cell[38135, 1120, 950, 26, 70, "Input"], Cell[39088, 1148, 406, 11, 42, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[39531, 1164, 234, 4, 54, "Subsubsection"], Cell[39768, 1170, 1549, 41, 178, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[41354, 1216, 150, 2, 54, "Subsubsection"], Cell[41507, 1220, 371, 9, 42, "Input"], Cell[41881, 1231, 707, 18, 70, "Input"], Cell[42591, 1251, 86, 1, 42, "Input"] }, Open ]] }, Open ]] }, Open ]] } ] *)