COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### getting a vector from an integral

• Email
• Follow

```Hello all,
This is my question:
let "y" and "d" two vectors with five elements each one.
I need the area of their product so I have used the sentence:
>>area=trapz(y.*d)

Now I would like to get "y", which is supposed to be unknow, having
vector "d" and number "area" as data.
Is it possible to do with matlab?

My idea was like:(let "s" the symbol for "integral" and
"a=0","b=10",the extremes of the definite integral):

aSb(y.*d)=area

now, using the fourier transform propriety:

fft(aSb(y.*d))=(1/jw)*fft(y.*d)

I should have:

(1/jw)*fft(y.*d)=fft(area); ==> fft(y.*d)= jw*fft(area)

And finally:

y=ifft(jw*fft(area))./d

it doesn't works, but i don't know why.(actually I have some ideas
but I don't know how to go on)
Any suggest would be very appreciated.
```
 0
Reply eureka_ (27) 9/15/2006 7:34:50 AM

See related articles to this posting

```In article <ef40d42.-1@webcrossing.raydaftYaTP>, andrea
<eureka_@libero.it> wrote:

> Hello all,
> This is my question:
> let "y" and "d" two vectors with five elements each one.
> I need the area of their product so I have used the sentence:
> >>area=trapz(y.*d)
>
> Now I would like to get "y", which is supposed to be unknow, having
> vector "d" and number "area" as data.
> Is it possible to do with matlab?
>
> My idea was like:(let "s" the symbol for "integral" and
> "a=0","b=10",the extremes of the definite integral):
>
> aSb(y.*d)=area
>
> now, using the fourier transform propriety:
>
> fft(aSb(y.*d))=(1/jw)*fft(y.*d)
>
> I should have:
>
> (1/jw)*fft(y.*d)=fft(area); ==> fft(y.*d)= jw*fft(area)
>
> And finally:
>
> y=ifft(jw*fft(area))./d
>
> it doesn't works, but i don't know why.(actually I have some ideas
> but I don't know how to go on)
> Any suggest would be very appreciated.
----------------------
I'm afraid you have set yourself up to do an impossible task.  Knowing
only the value of the integral (area) and the vector d, there is no way to
uniquely determine y.  Infinitely many y vectors would give the same
integral.  What you have is five unknowns and only one linear equation,
which is not enough to solve the problem.  You need to place four more
conditions on y to achieve that.

Roger Stafford
```
 0
Reply ellieandrogerxyzzy (4805) 9/15/2006 8:37:22 AM

```"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in
message
news:ellieandrogerxyzzy-1509060137220001@dialup-4.232.228.54.dial1.losangeles1.level3.net...
> In article <ef40d42.-1@webcrossing.raydaftYaTP>, andrea
> <eureka_@libero.it> wrote:
>
>> Hello all,
>> This is my question:
>> let "y" and "d" two vectors with five elements each one.
>> I need the area of their product so I have used the sentence:
>> >>area=trapz(y.*d)
>>
>> Now I would like to get "y", which is supposed to be unknow, having
>> vector "d" and number "area" as data.
>> Is it possible to do with matlab?
>>
>> My idea was like:(let "s" the symbol for "integral" and
>> "a=0","b=10",the extremes of the definite integral):
>>
>> aSb(y.*d)=area
>>
>> now, using the fourier transform propriety:
>>
>> fft(aSb(y.*d))=(1/jw)*fft(y.*d)
>>
>> I should have:
>>
>> (1/jw)*fft(y.*d)=fft(area); ==> fft(y.*d)= jw*fft(area)
>>
>> And finally:
>>
>> y=ifft(jw*fft(area))./d
>>
>> it doesn't works, but i don't know why.(actually I have some ideas
>> but I don't know how to go on)
>> Any suggest would be very appreciated.
> ----------------------
>  I'm afraid you have set yourself up to do an impossible task.  Knowing
> only the value of the integral (area) and the vector d, there is no way to
> uniquely determine y.  Infinitely many y vectors would give the same
> integral.  What you have is five unknowns and only one linear equation,
> which is not enough to solve the problem.  You need to place four more
> conditions on y to achieve that.
>
> Roger Stafford

Or if you are willing to find only some best approximation based on certain

norms. For example, a least-squares approximation based on 2-norm.

Regards,
by Cheng Cosine
Sep/16/2k6 NC

```
 0
Reply acosine1 (103) 9/16/2006 6:06:28 PM

```Thank you Roger and Cheng.
I knew my problem was unsolvable, or better, it's an ill-posed
problem.
I'm now searching on deconvolution and blind deconvolution
topics.Maybe there's something helpful to my problem.
Does anyone know if there is a matlab program that makes a
least-squares approximation?
Or maybe a matab program for the Lucy-Richardson deconvolution?
Maybe someone has already written this kind of programs.
Andrea
>
>
>
> "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
wrote
> in
> message
>
news:ellieandrogerxyzzy-1509060137220001@dialup-4.232.228.54.dial1.l
> osangeles1.level3.net...
>> In article <ef40d42.-1@webcrossing.raydaftYaTP>, andrea
>> <eureka_@libero.it> wrote:
>>
>>> Hello all,
>>> This is my question:
>>> let "y" and "d" two vectors with five elements each one.
>>> I need the area of their product so I have used the
sentence:
>>> >>area=trapz(y.*d)
>>>
>>> Now I would like to get "y", which is supposed to be
unknow,
> having
>>> vector "d" and number "area" as data.
>>> Is it possible to do with matlab?
>>>
>>> My idea was like:(let "s" the symbol for "integral" and
>>> "a=0","b=10",the extremes of the definite integral):
>>>
>>> aSb(y.*d)=area
>>>
>>> now, using the fourier transform propriety:
>>>
>>> fft(aSb(y.*d))=(1/jw)*fft(y.*d)
>>>
>>> I should have:
>>>
>>> (1/jw)*fft(y.*d)=fft(area); ==> fft(y.*d)= jw*fft(area)
>>>
>>> And finally:
>>>
>>> y=ifft(jw*fft(area))./d
>>>
>>> it doesn't works, but i don't know why.(actually I have
some
> ideas
>>> but I don't know how to go on)
>>> Any suggest would be very appreciated.
>> ----------------------
>> I'm afraid you have set yourself up to do an impossible task.
> Knowing
>> only the value of the integral (area) and the vector d, there
is
> no way to
>> uniquely determine y. Infinitely many y vectors would give the
> same
>> integral. What you have is five unknowns and only one linear
> equation,
>> which is not enough to solve the problem. You need to place
four
> more
>> conditions on y to achieve that.
>>
>> Roger Stafford
>
> Or if you are willing to find only some best approximation based
> on certain
>
> norms. For example, a least-squares approximation based on 2-norm.
>
> Regards,
> by Cheng Cosine
> Sep/16/2k6 NC
>
>
>
```
 0
Reply eureka_ (27) 9/18/2006 8:59:28 AM

```andrea schrieb:

> Does anyone know if there is a matlab program that makes a
> least-squares approximation?

well...i'm used to Matlab Optimization Toolbox, fully operational!

Otherwise i found code and papers of Per C. Hansen a source of delight!

Ciao

neurino

```
 0
Reply lelli.luca (8) 9/18/2006 9:05:38 AM

4 Replies
44 Views

Similar Articles

12/13/2013 9:15:18 AM
[PageSpeed]

Similar Artilces:

After sorting a vector, how to get max in this vector?
Dear all, After sorting a vector, how to get max in this vector? I got a strange result of my test code. ------------------------------------------------- #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> vec; vec.push_back(5); vec.push_back(-5); vec.push_back(10); sort(vec.begin(),vec.end()); for (int i=0;i<vec.size();++i) { cout << vec[i] << '\t'; } cout << endl; cout << "Max=" << *vec.end() << endl; cout << "Min=" << vec[...

Looking for vectorized (vector-valued) numerical integrators...
Let's say my integrand function is indeed vector-valued, I have to break that function down and repetitively call it multiple times in order to compute the integral of the vector-valued function? That's very time consuming considering the fact that there are a lot of commonalities in these separate function evaluations... I saw neither IMSL nor NAG have the vector-valued numerical integrator. Suppose my I want to evaluate a batch of numerical integrations where the integrands are similar. Could you please elaborate a bit more about how to leverage the fact that the integrals are s...

how to get a vector composant
for example if one considers the matrix a = [3 5 6 7 5 7 9 2 5 7 8 9] if one does sum(a,2), we'll get a 3,1 vector, my question is: is it feasible to do sum(a,2)(1) to select the first composant of the vector sum(a,2) I am sorry for my poor english best regards fabien wrote: > for example if one considers the matrix a = [3 5 6 7 > 5 7 9 2 > 5 7 8 9] > if one does sum(a,2), we'll get a 3,1 vector, my quest...

get rid of for loops/vectorization
Hello all, I would like get rid of loop in code below. I am not sure is it possible because x changes each time and it is multiplying each time . InputU=4*rand(2,15); W=sparse(2*ones(4,4));% sparse matrix Win=3*ones(4,2);% matrix sizeinputU=size(InputU,2); temp=zeros(15,4); x=zeros(4,1);% vector for t=1:sizeinputU x=Win*InputU(:,t)+W*x; temp(t,:)=x'; end Thanks in advance. BRSU "Elizaveta " <elizashpieva@gmail.com> wrote in message <jng2oe\$9d1\$1@newscl01ah.mathworks.com>... > Hello all, > I would like get rid of loop in code below. I am not sure is it possi...

Adding Vectors to get a Matrix
Hi, I would like to add two vectors to get a matrix. For example, if I have a vectors [1 2 3 4 5 6 7] and [1 4 8] I would like to get a result [2 3 4 5 6 7 8 5 6 7 8 9 10 11 9 10 11 12 13 14 15] I do not want to use a technique which duplicates the data such as repmat since that will triple the amount of memory require for the operation, nor do I want to use a FOR loop since that will be slow. Is there any alternative way to do this? Thanks "Scott " <sparker6@uiuc.edu> wrote in message <gpcr6d\$92u\$1@fred.mathworks.com>... > Hi, > > I w...

How to get the real part of an integral?
I am trying to get the real part of an integral (see below). << Algebra`ReIm` Integrate[1/(1 + x^2 + x^4), x] Re[%] I am getting the error: "\$IterationLimit::itlim: Iteration limit of 4096 exceeded." Any advice? AK In article <c9ebrg\$g72\$1@smc.vnet.net>, ankowar@yahoo.com (Andy Kowar) wrote: > I am trying to get the real part of an integral (see below). > > > << Algebra`ReIm` > Integrate[1/(1 + x^2 + x^4), x] > Re[%] > > I am getting the error: > "\$IterationLimit::itlim: Iteration limit of 4096 e...

Integrator taking vectors as input?
Hi, I was wondering if an IDL integrator exists where it can accept vectors instead of scalars as inputs for upper and lower limits of the integral. I want to apply it to big datasets and I want to avoid using loops, which tend to be much slower. Thanks a lot, Elias > I was wondering if an IDL integrator exists where it can accept > vectors instead of scalars as inputs for upper and lower limits of the > integral. I want to apply it to big datasets and I want to avoid using > loops, which tend to be much slower. The IDL routines like QROMB accept vector inputs a...

How can i get data out of vector to process?
I know how to create a vector and put data in. I don't know how to get the info out to add, multiply, subtract or multiplly. Here is the code: #include<iostream> using std::cout; using std::cin; #include<vector> using std::vector; #include <string> using std::string; using std::getline; int main() { string name; int ounce; double cost; int i = 0; vector<string>Item[10]; vector<int>Ounces[10]; vector<double>Price[10]; while(i < 4) { cout << "Name of Product "; getline(cin, name); // name is for all strin...

I get to different results with same Definite Integral.....
Using the HP49G+, for the Definite Integral of "Ln(x)/x" for X from -1 to 1, using the PREVAL(Ln(x)/x,-1,1) I get i*Pi.... However using the "Integral icon...(red Shift TAN key), for the same integral i get Pi^2/2. Which is correct???? In both cases I overide a singularity alert, and allow complex mode after the complex mode alert. Hi. > Using the HP49G+, for the Definite Integral of "Ln(x)/x" for X from -1 > to 1, using the PREVAL(Ln(x)/x,-1,1) I get i*Pi.... > > However using the "Integral icon...(red Shift TAN key), for the same > integral i...

using std::vector operator[] vs. get()
{ poster requested to note that he meant 'at', not 'get'. -mod } Hello Group, I am wondering about the differnet behaviuor of std::vector::get(int index) and std::vector::operator[](int index) To me they seem pretty the same. But get is throwing an exception in case of violating the index bounds while the result of operator[] is undefined in that case. At least that's what the MSVC documentation says. So in any case i have to check the bounds of the index first or if i use get() i have to surround it with a try/catch. I think it would be more logical and comprehensible i...

dde23: getting the actual step-size at each integration point
Hi, I am having a problem with dde23. I wanted to use the actual step-size used by the solver at each integration time-step, to calculate a new variable dependent on it. I noticed though that it happens sometimes that this step-size is negative, meaning that time instead of only increasing during integration, decreases at specific instances... like 0 0.004, 0.012, 0.340, 0.190, 0.403,.... Is this possible in the way dde23 works? I use an events function and I use the actual dt inside it, to determine whether an event happens or not. Is that a possible cause of the problem? My way of achievi...

how to get all indices of one arrary vectors in another array?
Say I have two arrays, t=[1,1,1;... 1,1,2;... 1,1,3;... 1,2,1;... 1,2,2;... 1,2,3;... 1,3,1;... 1,3,2;... 1,3,3;... 1,1,1;... 1,2,2;... 1,3,2]; b=[1,1,1;... 1,2,2;... 1,3,2]; 'ismember' can only return the highest index in array t, like ind=[10,11,12]'. how to get all indices of the arrary b vectors in array t without loop? like ind = [1,10,5,11,8,12]'. Thank you. [I,I] = ismember(t,b,'rows'); find(I) "Matt Fig" <spamanon@yahoo.com> wrote in message <gdbnod\$aha\$1@fred.mathworks.com>... > [I,I] = ismember(...

I'm getting a Segmentation fault after I clear a vector list
Hello Everybody. I have a Segmentation fault problem. The code section at the bottom keeps throwing a Segmentation fault when it enters the IF block for the second time. const int WORDS_PER_LINE = 4; when counter == 7 is when the string Concatenation fails within the IF block. BUT, the strange part is if the don't CLEAR the list ( // list.clear()) it works... but i'm afraid that I'm not freeing up memory when i reassign different strings to the vector. Code Snippet --------------------------------------------------------------------------------------- while(str != NU...

how to get double integral when inner limit is function of outer variable
Many thanks in advance I use dblquad for double numerical integral when knowing all 4 limits, but when the inner limit is function of outer variable, I get into trouble I have two functions, standard normal density function f(x), x is Normal(0,1) and normal density function f(y), y is Normal (a, b) x is from -4 to 1.96-3.16y y is from 0.7 to 1.36 I need ∫ ∫ f(x)f(y)dx dy Can anyone give me some suggestions on how to get this double numerical integral? Thank you! Maybe I didn't ask the question clearly. The question is integrating on f(x)f(y) where the limit of x is a func...

RE: Getting Management attention for operations integrity (was ;32767) #2
> -----Original Message----- > From: david20@alpha2.mdx.ac.uk [mailto:david20@alpha2.mdx.ac.uk]=20 > Sent: October 3, 2005 11:33 AM > To: Info-VAX@Mvb.Saic.Com > Subject: Re: Getting Management attention for operations=20 > integrity (was ;32767) >=20 > In article <8g1UG9TIfWJS@eisner.encompasserve.org>,=20 > Kilgallen@SpamCop.net (Larry Kilgallen) writes: > >In article=20 > <7dd80f60510020855vd59bfcfr27b5dee47aa38964@mail.gmail.com>,=20 > Ken Robinson <kenrbnsn@gmail.com> writes: > >> On 10/2/05, Paul Sture <paul.sture@dec...

How can I get rid of "Warning C4307: integral constant overflow"
Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) How do I get rid of "Warning C4307: '-' : integral constant overflow" from the following macro? #define d_ReturnMax(I_iTypeSize)\ ( (int64(1)<<((I_iTypeSize*8)-1))-1) There NO warnings when done as a function: int64 d_ReturnMax(int64 I_iTypeSize) { return (1<<((I_iTypeSize*8)-1))-1;} Test code: int64 L_iMaxIntSize=d_ReturnMax(sizeof(int32)); // L_iMaxIntSize=0x000000007fffffff int64 L_iMaxIntSize=d_ReturnMax(sizeof(char)); // L_iMaxIntSize=0x000000000000007f...

Re: OVMS Integrity BASIC LTU Getting only 1 user at cost of \$2400.00???
This is a multipart message in MIME format. --=_alternative 00769CF1852574FA_= Content-Type: text/plain; charset="US-ASCII" VAXman-@SendSpamHere.ORG wrote on 11/07/2008 04:32:31 PM: > In article <0003e74f\$0\$26284\$c3e8da3@news.astraweb.com>, JF Mezei > <jfmezei.spamnot@vaxination.ca> writes: > >John Reagan wrote: > > > >> I've been staying out of the discussion since I don't even > understand them. > >> That part of the productizing of the compilers is above my pay > grade as they > >> say. > > > &g...

Don't get left in the dark. A guide to integrating lighting and home control systems for increased security.
Thought some of you might like to read this article on lighting i wrote last fall for Home Technology Products Magazine. http://www.architechtronics.com/hmo_lighting_dontgetleft.html -- Brett Griffin, Technology Consultant Architechtronics, Inc. get to know home technologyT p. (610) 825.7018 f (215) 827.5484 *top 10 reasons to use Architechtronics for your next project http://www.architechtronics.com/top10.html **keep up on cutting-edge technology... join "the EDGE" for free at http://www.architectronics.com/edge.html ------------------------------------------- On Wed, 2...

I get a warning: This Create Table statement recursively references the target table. A consequence of this is a possible data integrity problem #2
PROC SQL; CREATE TABLE Factors As SELECT a.date, (b.RM-a.RF) as excess_mark, a.RF, b.RM, c.SMB, d.HML From temp.tbill as a, marketret as b, smbret as c, hmlret as d where a.date=MDY(b.month,1,b.year) & MDY(b.month,1,b.year)= MDY (c.month,1,c.year) & MDY(c.month,1,c.year)=MDY(d.month,1,d.year); quit; %macro bygroupexport(dsname,byvarname,charnum); data byvals; set &dsname; run; %if &charnum=character %then %do; data byvals; set byvals; length byvar2 \$ 32; byvar2=left(trim(&byvarname)); byvar2=tranwrd(TRIM(byvar2),' ','_1_'); byvar2=tranwrd(byvar2,'&am...

vector within a vector
It's late. Why is the compiler saying that this is the wrong syntax: vector<vector<cIndicatorValue>> ranks; One other question: If I want to access one of cIndicatorValue's functions, I have to declare a vector iter, right? Can I add an integer to an a vector iter to move it through the array? Angela wrote: > It's late. Why is the compiler saying that this is the wrong syntax: > > vector<vector<cIndicatorValue>> ranks; Because the '>>' immediately after the cIndicatorValue is being interpretted as an operator. Try using whites...