Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'getting values out of interpolating functions' topicStudent Support Forum > General > Archives > "getting values out of interpolating functions"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Henry Lamb
09/24/03 7:26pm

You should draw your y vs. t plot after calling NDSolve, instead of preparing the table. That way it's easier to identify the maxima, and choose the one you want. With your set of equations, there are three peaks, with the largest near t=18.

Assuming that's the one you want, you can find the y and t values with

FindMinimum[-interp,{t,18}]

(or FindMaximum[interp,{t,18} if you're using version 5)

then

maxYoft=-%[[1]];tformaxY=t/.%[[2]];

There are two locations for halfmaxY, one on each side of the peak. You can get them both in one step.

FindRoot[interp==halfmaxY,{t,#}]&/@{18,19}

or, in more general form,

FindRoot[interp==halfmaxY,{t,#}]&/@Through[{Floor,Ceiling}[tformaxY]]


URL: ,

Subject (listing for 'getting values out of interpolating functions')
Author Date Posted
getting values out of interpolating functions sean kim 09/14/03 6:22pm
Re: getting values out of interpolating functions Henry Lamb 09/24/03 7:26pm
< Previous CommentHelp | Reply To Comment | Reply To Topic