MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Problems with Module

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112052] Problems with Module
  • From: Docente Sergio Miguel Terrazas Porras <sterraza at uacj.mx>
  • Date: Fri, 27 Aug 2010 04:07:29 -0400 (EDT)

 Hi!

 The following is a slight modification of a code that works fine. But this
 one does not work.
 However, if I empty the list of local variables in Module, Then it works!
 Could some of you enlighten me?

 f[t_]:=4 Sin[t];g[t_]:=2 Cos[t];a=0;b=2\[Pi];
 DerVectConst[f,g,a,b]

 DerVectConst[f_,g_,a_,b_]:=Module[{r,vel,acel,unitario,derivadadeu,du},
 $Assumptions=t\[Element]Reals;

 r[t_]={f[t],g[t]};
 vel[t_]=(r^\[Prime])[t];
 acel[t_]=(r^\[DoublePrime])[t];
 unitario[t_]=acel[t]/Norm[acel[t]];
 derivadadeu[t_]=(unitario^\[Prime])[t];
 du[t_]=derivadadeu[t]//FullSimplify;

 Manipulate[

 f1=Graphics[{Thick,Blue,Arrow[{r[t],r[t]+du[t]}]}];
 f2=Graphics[{Thick,Green,Arrow[{r[t],r[t]+unitario[t]}]}];
 g1=ParametricPlot[r[t],{t,a,b},AspectRatio->Automatic,PlotStyle->{Thick, Red}];
 txt=Graphics[{Text[Style["\!\(\*OverscriptBox[\"u\",
 \"^\"]\)",18,Bold],(r[t]+1.1unitario[t])],Text[Style["\!\(\*OverscriptBox[\"u\",
 \"^\"]\)^\[Prime]",18,Bold],(r[t]+1.1du[t])]}];
 punto=Graphics[{PointSize[.02],Point[r[t]]}];
 Show[g1,f1,f2,txt,punto,PlotRange->All]
 ,{t,a,b}]
 ]


  • Prev by Date: Re: List of multiple elements
  • Next by Date: Re: List of multiple elements
  • Previous by thread: Re: How to expert a matrix in matrix market format
  • Next by thread: Re: Problems with Module