Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.3K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

DSolve on Vector Equations?

Posted 12 years ago
POSTED BY: Florian Rist
2 Replies
Posted 7 years ago

Is there a way to keep input variables as vectors, instead of specifying components?

POSTED BY: ion sme

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[0]]] == #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 BY: Ivan Morozov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard