0
|
4206 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# DSolve on Vector Equations?

Posted 9 years ago
 Hi, I'm playing with DSolve and would like to solve a vector equation with boundary conditions. Say I have a simple equation like this: deq = m r''[t] == m a  Now I want r and a to be vectors and solve deg for some boundary conditions r={0,1} and r'={1,1}. This should be easy but I don't know how to tell Matematica (v10). I tried this, but it's not working: DSolve[{deq, r == {0, 1}, r' == {1, 1}}, {r[t]}, {t}] DSolve::bvnul: For some branches of the general solution, the given boundary conditions lead to an empty solution. >>  So, whats the right way to do it? Flo Edit: 'Manually' writing down the two equations works, but it's not exactly elegant: In:= deq = {m rx''[t] == m ax, m ry''[t] == m ay}; DSolve[{deq, rx == 0, ry == h, rx' == vx, ry' == vy}, {rx[t], ry[t]}, {t}] Out= {{rx[t] -> 1/2 (ax t^2 + 2 t vx), ry[t] -> 1/2 (2 h + ay t^2 + 2 t vy)}} 
2 Replies
Sort By:
Posted 9 years ago
 Hi,You can define a function that generates equations and initial conditions for DSolve[] more or less routinely. Here is an example: equations = Join[ Thread[D[Through[#1[t]],{t, 2}] == #2] , Thread[Join[D[Through[#1[t]],t] /. t -> 0 ,Through[#1]] == #3] ] & ; Now your original system can be solved as follows: lhs = {rx, ry}; rhs = {ax , ay}; ini = {0, h, vx, vy} ; DSolve[equations[lhs, rhs, ini], Through[lhs[t]], t] For 3D vectors: lhs = {rx, ry, rz}; rhs = {ax, ay, az}; ini = {0, h, 0, vx, vy, vz} ; DSolve[equations[lhs, rhs, ini], Through[lhs[t]], t] Or you can generate all DSolve[] input with one function: system = Sequence @@ {equations[#1, #2, #3], Through[#1[t]], t} & ; DSolve[system[lhs, rhs, ini]] 
Posted 4 years ago
 Is there a way to keep input variables as vectors, instead of specifying components?