Off[General::"spell"
Transcrição
Off[General::"spell"
4_animacao_media_1.nb 1 Movimento Harmônico Simples ( MHS ) Limpando todas as variáveis Off@Remove::"rmnsm"D; Off@General::"spell1"D; Off@General::"spell"D; Remove@"`∗"D; $Line = 0; Verificando se há alguma variável definida Names@"`∗"D 8< Abrindo pacotes gráficos << Graphics`Colors` << Utilities`FilterOptions` Selecionando o diretório onde será carregado o "template" deste notebook diretorio = DirectoryName@ ToFileName@ "FileName" ê. NotebookInformation@ EvaluationNotebook@DDDD; $Path = Append@$Path, diretorioD; 4_animacao_media_1.nb 2 Pacote para plotar a curva correspondente as MHS Options@SpringMassD = 8Mass → 1, SpringConstant → 1, DampingCoefficient → 0, Color → Cobalt<; SpringMass@8u0_, u1_<, 8t_, tmin_, tmax_<, opts___D := Module@8sol, solutiont, theta<, m = Mass ê. 8opts< ê. Options@SpringMassD; r = DampingCoefficient ê. 8opts< ê. Options@SpringMassD; k = SpringConstant ê. 8opts< ê. Options@SpringMassD; clr = Color ê. 8opts< ê. Options@SpringMassD; sol = NDSolve@ 8m theta ''@tD + r theta '@tD + k theta@tD 0, theta@0D u0, theta '@0D u1<, theta, 8t, tmin, tmax<D; solutiont = First@Evaluate@theta@tD ê. solDD; Plot@solutiont, 8t, tmin, tmax<, GridLines → 88Automatic, [email protected], White<<, 8Automatic, [email protected], White<<<, AxesStyle → [email protected], White<, [email protected], White<<, Background −> Black, PlotStyle → [email protected], Red<, AspectRatio → 1 ê GoldenRatio, Frame → True, ImageSize → 8650, 400<, TextStyle → 8FontFamily −> "Helvetica", 4_animacao_media_1.nb 3 FontSize → 18, FontWeight −> "Bold"<, Evaluate@FilterOptions@Plot, optsDDDD Pacote para gerar uma animação ao MHS Options@SpringMassMovieD = 8Mass → 1, SpringConstant → 1, DampingCoefficient → 0, Steps → 30, Color → Cobalt<; SpringMassMovie@ 8u0_, u1_<, 8t_, tmin_, tmax_<, opts___D := Module@8sol, solutions, solutiont, tb, uplot, prange, height, ymin, ymax, plot1, plot2, tstep, time<, m = Mass ê. 8opts< ê. Options@SpringMassMovieD; r = DampingCoefficient ê. 8opts< ê. Options@SpringMassMovieD; k = SpringConstant ê. 8opts< ê. Options@SpringMassMovieD; stepnum = Steps ê. 8opts< ê. Options@SpringMassMovieD; clr = Color ê. 8opts< ê. Options@SpringMassMovieD; tstep = If@stepnum ≠ 0, Htmax − tminL ê Abs@stepnumD, 2 Htmax − tminLD; sol = NDSolve@ 8m theta ''@timeD + r theta '@timeD + k theta@timeD 0, theta@0D u0, theta '@0D u1<, theta, 8time, tmin, tmax<D; solutiont = First@Evaluate@theta@timeD ê. solDD; 4_animacao_media_1.nb uplot = Plot@solutiont, 8time, tmin, tmax<, Evaluate@FilterOptions@Plot, optsDD, DisplayFunction → IdentityD; prange = FullOptions@uplot, PlotRangeD; height = Ceiling@Max@Abs@prange@@2DDDDD + 3.; ymin = prange@@2, 1DD; ymax = prange@@2, 2DD; tb = Table@ 8.25 H−1L ^ k, k Hheight − solutiontL ê 10 + solutiont<, 8k, 1, 8<D; tb = Prepend@tb, 80, solutiont<D; tb = Append@tb, 80, height − 1<D; solutions = solutiont ê. time → s; Do@plot1 = Plot@0, 8x, −1, 1<, PlotStyle → [email protected], Red<, Axes → 8False, True<, PlotRange → 88−3, 3<, 8−height, height<<, TextStyle → 8FontFamily −> "Helvetica", FontSize → 12, FontWeight −> "Bold"<, Epilog → 8Line@tbD, 8Blue, Rectangle@8−2, height − 1<, 82, height<D<, 8Black, Text@ "Movimento Harmônico Simples", 80, 13<, TextStyle → 8FontFamily → "Helvetica", FontSize → 16, FontWeight → "Bold"<D<, 8Black, 4 4_animacao_media_1.nb Rectangle@8−.5, solutiont − .3<, 8.5, solutiont + .3<D<<, DisplayFunction → Identity, Ticks → 8None, Automatic<D; plot2 = Plot@solutions, 8s, tmin, time<, PlotRange → 88tmin, tmax<, 8ymin, ymax<<, PlotStyle → [email protected], Blue<, FrameLabel → 8t, y<, TextStyle → 8FontFamily −> "Helvetica", FontSize → 15, FontWeight −> "Bold"<, GridLines → 88Automatic, [email protected], Black<<, 8Automatic, [email protected], Black<<<, AxesStyle → [email protected], Red<, [email protected], Red<<, Frame → True, DisplayFunction → IdentityD; Show@GraphicsArray@8plot1, plot2<D, Background → Banana, ImageSize → 8650, 300<, DisplayFunction → $DisplayFunctionD, 8time, tmin + .0000001, tmax + .0000001, tstep<DD SpringMass@83, 0<, 8t, 0, 10<D; 5 4_animacao_media_1.nb 6 3 2 1 0 -1 -2 -3 0 2 4 6 8 10 SpringMassMovie@85, 0<, 8t, 0, 15<, Steps → 100D SelectionMove@EvaluationNotebook@D, After, EvaluationCellD; SelectionMove@EvaluationNotebook@D, Next, CellGroupD; FrontEndTokenExecute@"OpenCloseGroup"D; 4 5 2 2.5 0 y 7.5 0 -2 -2.5 -4 -5 -7.5 2 4 6 8 10 12 14 t Final do notebook
Documentos relacionados
Exija sua Nota Fiscal (NF)
Honda Civic DX 2dr Coupe 140HP 1.8L 16V SOHC 5M, ABS4, Airbags, Espelh. Remotos, etc FULL HUMMER 2010 H2 4dr SUV 4WD 393HP 6.2L V8 6A HUMMER 2010 H3 4dr SUV 4WD 239HP 3.7L 5cyl 5M Infiniti FX37 SUV...
Leia mais"LA CLIMATISATION NATURELLE - Proarq
La recherche en Thermique du Bâtiment manifeste une nouvelle attitude face à l'architecture. Elle cherche à définir une approche de la construction qui dépend étroitement du site, du paysage, du cl...
Leia maisModelo de Relatório Automático - Meastech
U: 10.2kV I: 249nA C: 1.95uF R(2000V): 185Gȍ R(4000V): 107Gȍ R(6000V): 66.8Gȍ R(8000V): 61.4Gȍ R(10kV): 41.0Gȍ Un: 10000kV tm: 10min 00s
Leia mais