FindRoot with NDSolve inside of it doesn't work
- To: mathgroup at smc.vnet.net
- Subject: [mg111343] FindRoot with NDSolve inside of it doesn't work
- From: Sam Takoy <sam.takoy at yahoo.com>
- Date: Wed, 28 Jul 2010 02:54:30 -0400 (EDT)
Hi,
I think it's completely self-explanatory what I'm trying to do in this
model example:
f[x0_, y0_] := (
sol = NDSolve[{x'[t] == x[t], y'[t] == y[t], x[0] == x0,
y[0] == y0}, {x, y}, {t, 0, 1}];
{x[1], y[1]} /. sol[[1]]
)
(*f[x0_, y0_]:={x0 Exp[1], y0 Exp[1]}; (* Works for this f *) *)
FindRoot[f[x0, y0] == {2.7, 5.4}, {{x0, 1}, {y0, 2}}]
Can someone please help me fix this and explain why it's not currently
working?
Many thanks in advance!
Sam