Re: FindMinimum on Interpolating Function?
- To: mathgroup at smc.vnet.net
- Subject: [mg41735] Re: [mg41711] FindMinimum on Interpolating Function?
- From: Bobby Treat <drmajorbob+MathGroup3528 at mailblocks.com>
- Date: Tue, 3 Jun 2003 07:13:17 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
You must have defined a, b, p, q elsewhere and forgot to tell us.
Otherwise NDSolve would fail.
Bobby
-----Original Message-----
From: Minas Theodorakis <minas at edu.physics.uoc.gr>
To: mathgroup at smc.vnet.net
Subject: [mg41735] [mg41711] FindMinimum on Interpolating Function?
I have defined these equations:
f[t_] = (a - p*y[t])x[t]
g[t_]=-(b-q*x[t])y[t]
Solving this system, I get two Interpolating functions:
solution[xo_,yo_,T_]:=NDSolve[{x'[t]=f[t],y'[t]=g[t],
x[0]=xo, y[0]=yo},
{x,y}, {t,0,T}]
I can plot these functions without a problem:
solution1=solution[8.5, 1.5, 10]
Plot[y[t] /. solution1, {t, 0, 2}]
But I can't use FindMinimum on them!
FindMinimum[y[t]/.solution1, {t, 0, 2}]
I even tried to do a ListPlot with some of their values:
Table[{t, y[t]/.solution1}, {t, 0, 5}]
and they were of the form:
{{t1, {y[t1]}}, {t2, {y[t2]}}, ...}
meaning that the values of the function are enclosed in {}, which I
think
creates the problem. Needless to say that ListPlot returned an error.
My main concern is the calculation of the minimum values for the
functions.
However any info that points me in the right direction about the nature
of
the problem would be grately appreciated.
Minas Theodorakis