Iteration of Initial Conditions for required Boundary Value with NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg52744] Iteration of Initial Conditions for required Boundary Value with NDSolve
- From: "Narasimham" <mathma18 at hotmail.com>
- Date: Sat, 11 Dec 2004 05:22:14 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Attempting some simulation in Mathematica, there being no Help on the
topic.
To define a robot position between two end points ((sz,0),(3,2)), (one
variable,one fixed) a Cornu Spiral was chosen. For a non-linear
Boundary Value problem Mathematica does not accept a last value y[smax]
= 2 imposed as NDSolve boundary condition.
So how can then one initial parameter ,say kgi be varied in a to&fro
twoway feedback/ automated interactive simulation cycle to stop at a
pre-defined end point (3,2)?. There's no joy in manual trial and error
procedures.
sz = .02 ; kgi = 3 10^-3; smax = 4.75;
Clear[s, x, y, ph, x2, y2, ph2];
NDSolve[{ph''[s] == ph'[s]/s, ph[sz] == 10^-7, ph'[sz] == kgi,
x'[s] == Cos[ph[s]], x[sz] == 0, y'[s] == Sin[ph[s]], y[sz] == 0},
{ph,x, y}, {s, sz, smax}];
{ph2[u_], x2[u_], y2[u_]} = {ph[u], x[u], y[u]} /. First[%];
Plot[{x2[s], y2[s], ph2[s]}, {s, sz, smax}];
ParametricPlot[{x2[s], y2[s]}, {s, sz, smax}];
Regards
Narasimham