Path: news.mathworks.com!not-for-mail
From: "Per Sundqvist" <per.sundqvist@uam.es>
Newsgroups: comp.soft-sys.matlab
Subject: Re: solving for the upper limit in an integral !
Date: Sat, 13 Oct 2007 19:23:48 +0000 (UTC)
Organization: Chalmers Tekniska H&#246;gskola
Lines: 28
Message-ID: <fer604$ksn$1@fred.mathworks.com>
References: <feq31p$ot4$1@fred.mathworks.com>
Reply-To: "Per Sundqvist" <per.sundqvist@uam.es>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1192303428 21399 172.30.248.35 (13 Oct 2007 19:23:48 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 13 Oct 2007 19:23:48 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 266682
Xref: news.mathworks.com comp.soft-sys.matlab:432788


"aravind bhimarasetty" <baravi.no.spam@mathworks.com> wrote
in message <feq31p$ot4$1@fred.mathworks.com>...
> Hi,
> 
> Given that,
> y = k1*x*sin(k2*x - w*t)
> and
>  integral(x=0 to x0){sqrt(1+ (dy/dx)^2)} dx     = L
> 
> Now, I already have the numerical values of k1, k2, w, L. I
> want to find out x0 that satisfies the above integral
equation.
> I dont need a closed form solution; a plot of x0 vs t(time)
> is sufficient.
> 
> Please help me crack this problem...thank you

Regardless the integrand you could use cumtrapz and interp1

xmax=10; %some large value
x=linspace(0,xmax,1000);
f=sin(x);%change here

x0=interp1(cumtrapz(x,f),x,L,'linear')

Hope it helps,
Per