NDSolve and vector variables
- To: mathgroup at smc.vnet.net
- Subject: [mg63895] NDSolve and vector variables
- From: "Borut Levart" <BoLe79 at gmail.com>
- Date: Sat, 21 Jan 2006 01:50:42 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Dear Mathematica users, They say that NDSolve now supports vector variables. What does that mean? (I have found an old thread, http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_frm/thread/d0c58a1fb0cfc8a7/8ba36139dc6a2b88#8ba36139dc6a2b88, but no one really answered the one who asked.) I couldn't've found any examples in the Help Browser either, so I would like to ask you if the below example (of throwing a stone under the gravitaion and drag) shows this "vector-variables support", or could it be rewritten more elegantly (in a vector-variables sense)? r[t_]:={x[t],y[t]} sol= Map[Function[{b2m}, NDSolve[ With[{g=9.8,v0=10,fi=.2 Pi}, Thread[Equal[ Join[r''[t],r[0],r'[0]],{-b2m Sqrt[r'[t].r'[t]],-g,0,0,v0 Cos[fi],v0 Sin[fi]}] ]],r[t],{t,0,10}, StoppingTest->(y[t]<0)][[1]]], {0,1,2}]; <<Graphics` With[{t2=sol[[1,2,-1,0,1,1,-1]]}, DisplayTogether[ ParametricPlot[ Evaluate[{x[t],y[t]}/.#],{t,0,t2}, PlotRange->{{0,10},{0,2}}]&/@sol ]] Thank you for your considering, Borut, Slovenia