Re: Can DSolve handle normalized vectors?
- To: mathgroup at smc.vnet.net
- Subject: [mg83556] Re: Can DSolve handle normalized vectors?
- From: dh <dh at metrohm.ch>
- Date: Thu, 22 Nov 2007 06:38:52 -0500 (EST)
- References: <fi0otp$65a$1@smc.vnet.net>
Hi, I wrote your system of equations in a more approbriate form and DSolve has no problem: {xx1,xx2}={100000000000,0}; f1[t_]=(6.673`*^31 (-x1[t]+xx1))/((-x1[t]+xx1)^2+(-x2[t]+xx2)^2); f2[t_]=(6.673`*^31 (-x2[t]+xx2))/((-x1[t]+xx1)^2+(-x2[t]+xx2)^2); eqs={x1[0]==0,x2[0]==0, x1'[0]==0,x2'[0]==100000000000000000, x1''[t]==f1[t]/1000000000000000000,x2''[t]==f2[t]/1000000000000000000} NDSolve[eqs,{x1[t],x2[t]},{t,0,1}] It is a good idea to choose units so that you have numerical factors of the order of unity. Otherwise you may have numerical problems. hope this helps, Daniel ram.rachum at gmail.com wrote: > Hello hello, it's me again. So I figured out how to use vectors in > DSolve. Now I tried to input a simple physical system into DSolve. The > only physical force I allowed was gravity. It didn't work. I tried > various systems, but none of them worked. I gradually simplified them, > making one of the objects stationary, playing with the force > equations, etc. I think I narrowed down the problem: DSolve won't work > if there I use a unit vector in one of the functions. > I defined a function unitvector[x] that gives you a vector in the > direction of x with a length of one. It's quite straightforward, but > when I use this function in one of the equations, DSolve goes > Solve::svars. I tried calculating a unit vector in other ways, without > calling the function, but they all produced the same svars. > Here's the code: > > \!\(\(x[t_] = {x1[t], x2[t]};\)\[IndentingNewLine] > \(xx[t_] = {xx1[t], xx2[t]};\)\[IndentingNewLine] > \(f[t_] = {f1[t], f2[t]};\)\[IndentingNewLine] > \(ff[t_] = {ff1[t], ff2[t]};\)\[IndentingNewLine] > \(g = 6.673*10\^\(-11\);\)\[IndentingNewLine] > \(vnorm[x_] := \@\((x . x)\);\)\[IndentingNewLine] > unitvector[x_] := x/vnorm[x]\) > > \!\(eqn = {x[0] == { > 0, 0}, \(x'\)[0] == {0, 10\^17}, > xx[t] == {10\^11, 0}, \(x''\)[t] == f[t]/\((\ 1*10\^18)\), > f[t] == \(g*\((1*10\^18)\)*\((1*10\^24)\)\)\/vnorm[xx[t] - > x[t]]* > unitvector[xx[t] - x[t]]}\) > > DSolve[Thread /@ eqn // Flatten, Flatten[{x[t], xx[t], f[t]}], {t}] > > So is Mathematica simply unable to solve something that uses a unit > vector? >