Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I've been trying to solve a system of differential equations on Mathematica, and I wanted to know why this implementation does not work:

f[t_]:= {x[t],y[t],z[t]}
v[t_]:= f'[t]
A = {a,b,c}
DSolve[{f''[t]==k Cross[v[t],A],f[0]=={0,0,0},f,t]

If I write the system explicitly, on the other hand, it works; why is that? By explicitly I mean:

DSolve[{x''[t] == k(c y'[t]-b z'[t]), y''[t]==k( -c x'[t] + a z'[t]), z''[t]==k( b x'[t]- a y'[t])},{x,y,z},t]

And in this case I'm not able to input an initial value, thus ending up with a whole lot of costants which I don't really care about right now.

What's the problem?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Comparison (==) does not Thread over lists; otherwise it would be impossible to compare lists. You want to use the function Thread:

In[8]:= Thread[{x, y, z} == {1, 2, 3}]
Out[8]= {x == 1, y == 2, z == 3}

In your case you will need

Join[Thread[f''[t]==k Cross[v[t],A]],Thread[f[0]=={0,0,0}]]

Finally, let me recommend the group comp.soft-sys.math.mathematica for Mathematica related questions.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.