Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
solving equation for two unknowns

Subject: solving equation for two unknowns

From: achenyo at

Date: 13 Aug, 2010 18:36:04

Message: 1 of 8

Hi,

I have the following two sets of equations:

integral of ((1/(lamda1+(lamda2*g0)))-(KNB/g1))*dF0(go)dF1(g1) = 1.................(1)

and

integral of ((g0/(lamda1+(lamda2*g0)))-(KNB*(g0/g1)))*dF0(go)dF1(g1) = GQ.......(2)

every other variable here is known except for amda1 and lamda2, how can I solve for lamda1 and lamda2.

Any suggestion will help.

Subject: solving equation for two unknowns

From: Walter Roberson

Date: 13 Aug, 2010 19:08:11

Message: 2 of 8

achenyo at wrote:
> Hi,
> I have the following two sets of equations:
>
> integral of ((1/(lamda1+(lamda2*g0)))-(KNB/g1))*dF0(go)dF1(g1) =
> 1.................(1)
>
> and
>
> integral of ((g0/(lamda1+(lamda2*g0)))-(KNB*(g0/g1)))*dF0(go)dF1(g1) =
> GQ.......(2)
>
> every other variable here is known except for amda1 and lamda2, how can
> I solve for lamda1 and lamda2.

Your equations are probably not valid. The indefinite integral of any equation
does not equal an exact value: it equals a value plus an arbitrary constant.
You are thus trying to solve two equations in four unknowns.

Does your dF0(go) represent the differentiation of a known function F0, with
respect to unspecified variable, and then evaluating the differential at the
point g0 ? (note go vs g0 for one thing)

Does dF0(go)dF1(g1) represent the multiplication of dF0(go) with dF1(g1) ? You
were careful to use * to indicate multiplication everywhere else, so we are
left to wonder whether you wished to denote something different.

Which variables are the equations being integrated with respect to? If the
answer is either go or g1 then the integral cannot be treated as if dF0(go) or
dF1(g1) are just constants with known values and funny names.


*If* dF0(g0) and dF1(g1) are constants for the purpose of integration
(implying integration over lamda1, lamda2 or KNB) and if multiplication was
intended, and if the arbitrary constants are added in, and if the integration
just _happens_ to be over lamda1 in both cases, then the solution is:

lamda1 = g1 * (g0 - dF0(go) * dF1(g1) * Gq - dF0(go) * dF1(g1) * C2 + g0 * C1)
/ KNB / g0 / dF0(go) / dF1(g1) / (dF0(go) * dF1(g1) - 1)

lamda2 = -
(-dF0(g0)^2 * dF1(g1)^2 * KNB * g0 * exp((-Gq - C2 + g0 + g0 * C1) / g0 /
(dF0(g0) * dF1(g1) - 1)) - dF0(g0) * dF1(g1) * Gq * g1 - dF0(g0) * dF1(g1) *
C2 * g1 + KNB * g0 * dF0(g0) * dF1(g1) * exp((-Gq - C2 + g0 + g0 * C1) / g0 /
(dF0(g0) * dF1(g1) - 1)) + g0 * g1 + g0 * C1 * g1) / KNB / g0^2 / dF0(g0) /
dF1(g1) / (dF0(g0) * dF1(g1) - 1)

Notice the leading "-" on the value for lamda2 .

Subject: solving equation for two unknowns

From: achenyo at

Date: 16 Aug, 2010 01:24:04

Message: 3 of 8

Walter Roberson <roberson@hushmail.com> wrote in message <i4457o$k8r$1@canopus.cc.umanitoba.ca>...
> achenyo at wrote:
> > Hi,
> > I have the following two sets of equations:
> >
> > integral of ((1/(lamda1+(lamda2*g0)))-(KNB/g1))*dF0(go)dF1(g1) =
> > 1.................(1)
> >
> > and
> >
> > integral of ((g0/(lamda1+(lamda2*g0)))-(KNB*(g0/g1)))*dF0(go)dF1(g1) =
> > GQ.......(2)
> >
> > every other variable here is known except for amda1 and lamda2, how can
> > I solve for lamda1 and lamda2.
>
> Your equations are probably not valid. The indefinite integral of any equation
> does not equal an exact value: it equals a value plus an arbitrary constant.
> You are thus trying to solve two equations in four unknowns.
>
> Does your dF0(go) represent the differentiation of a known function F0, with
> respect to unspecified variable, and then evaluating the differential at the
> point g0 ? (note go vs g0 for one thing)
>
> Does dF0(go)dF1(g1) represent the multiplication of dF0(go) with dF1(g1) ? You
> were careful to use * to indicate multiplication everywhere else, so we are
> left to wonder whether you wished to denote something different.
>
> Which variables are the equations being integrated with respect to? If the
> answer is either go or g1 then the integral cannot be treated as if dF0(go) or
> dF1(g1) are just constants with known values and funny names.
>
>
> *If* dF0(g0) and dF1(g1) are constants for the purpose of integration
> (implying integration over lamda1, lamda2 or KNB) and if multiplication was
> intended, and if the arbitrary constants are added in, and if the integration
> just _happens_ to be over lamda1 in both cases, then the solution is:
>
> lamda1 = g1 * (g0 - dF0(go) * dF1(g1) * Gq - dF0(go) * dF1(g1) * C2 + g0 * C1)
> / KNB / g0 / dF0(go) / dF1(g1) / (dF0(go) * dF1(g1) - 1)
>
> lamda2 = -
> (-dF0(g0)^2 * dF1(g1)^2 * KNB * g0 * exp((-Gq - C2 + g0 + g0 * C1) / g0 /
> (dF0(g0) * dF1(g1) - 1)) - dF0(g0) * dF1(g1) * Gq * g1 - dF0(g0) * dF1(g1) *
> C2 * g1 + KNB * g0 * dF0(g0) * dF1(g1) * exp((-Gq - C2 + g0 + g0 * C1) / g0 /
> (dF0(g0) * dF1(g1) - 1)) + g0 * g1 + g0 * C1 * g1) / KNB / g0^2 / dF0(g0) /
> dF1(g1) / (dF0(g0) * dF1(g1) - 1)
>
> Notice the leading "-" on the value for lamda2 .


Thanks Walter,
Yes dF0(go)dF1(g1) represent the multiplication of dF0(go) with dF1(g1) and dF0(g0) and dF1(g1) are not constants, they are functions (CDF of Rayleigh distribution) and the integration is w.r.t. to g0 and g1.

Thanks for your help.
Cheers

Subject: solving equation for two unknowns

From: Walter Roberson

Date: 16 Aug, 2010 01:49:44

Message: 4 of 8

achenyo at wrote:
> Walter Roberson <roberson@hushmail.com> wrote in message
> <i4457o$k8r$1@canopus.cc.umanitoba.ca>...
>> achenyo at wrote:

>> > I have the following two sets of equations:
>> > > integral of ((1/(lamda1+(lamda2*g0)))-(KNB/g1))*dF0(go)dF1(g1) = >
>> 1.................(1)
>> > > and
>> > > integral of
>> ((g0/(lamda1+(lamda2*g0)))-(KNB*(g0/g1)))*dF0(go)dF1(g1) = > GQ.......(2)
>> > > every other variable here is known except for amda1 and lamda2,
>> how can > I solve for lamda1 and lamda2.

> Yes dF0(go)dF1(g1) represent the multiplication of
> dF0(go) with dF1(g1) and dF0(g0) and dF1(g1) are not constants, they are
> functions (CDF of Rayleigh distribution) and the integration is w.r.t.
> to g0 and g1.

You did not happen to respond to the point about definite versus
indefinite integral, but even without knowing that, we can be certain
that there is no way to solve that system of equations without knowing
dF0(g0) and dF1(g1). You also have to be specific about which expression
is being integrated with respect to which variable -- or is it an
unstated double integration instead of a single integration that your
original post implies?

Subject: solving equation for two unknowns

From: Roger Stafford

Date: 16 Aug, 2010 02:17:04

Message: 5 of 8

"achenyo at" <achenyo2001@yahoo.com> wrote in message <i4a3vk$irq$1@fred.mathworks.com>...
> Walter Roberson <roberson@hushmail.com> wrote in message <i4457o$k8r$1@canopus.cc.umanitoba.ca>...
> > achenyo at wrote:
> > > Hi,
> > > I have the following two sets of equations:
> > >
> > > integral of ((1/(lamda1+(lamda2*g0)))-(KNB/g1))*dF0(go)dF1(g1) =
> > > 1.................(1)
> > >
> > > and
> > >
> > > integral of ((g0/(lamda1+(lamda2*g0)))-(KNB*(g0/g1)))*dF0(go)dF1(g1) =
> > > GQ.......(2)
> > >
> > > every other variable here is known except for amda1 and lamda2, how can
> > > I solve for lamda1 and lamda2.
> >
> > Your equations are probably not valid. The indefinite integral of any equation
> > does not equal an exact value: it equals a value plus an arbitrary constant.
> > You are thus trying to solve two equations in four unknowns.
> >
> > Does your dF0(go) represent the differentiation of a known function F0, with
> > respect to unspecified variable, and then evaluating the differential at the
> > point g0 ? (note go vs g0 for one thing)
> >
> > Does dF0(go)dF1(g1) represent the multiplication of dF0(go) with dF1(g1) ? You
> > were careful to use * to indicate multiplication everywhere else, so we are
> > left to wonder whether you wished to denote something different.
> >
> > Which variables are the equations being integrated with respect to? If the
> > answer is either go or g1 then the integral cannot be treated as if dF0(go) or
> > dF1(g1) are just constants with known values and funny names.
> >
> >
> > *If* dF0(g0) and dF1(g1) are constants for the purpose of integration
> > (implying integration over lamda1, lamda2 or KNB) and if multiplication was
> > intended, and if the arbitrary constants are added in, and if the integration
> > just _happens_ to be over lamda1 in both cases, then the solution is:
> >
> > lamda1 = g1 * (g0 - dF0(go) * dF1(g1) * Gq - dF0(go) * dF1(g1) * C2 + g0 * C1)
> > / KNB / g0 / dF0(go) / dF1(g1) / (dF0(go) * dF1(g1) - 1)
> >
> > lamda2 = -
> > (-dF0(g0)^2 * dF1(g1)^2 * KNB * g0 * exp((-Gq - C2 + g0 + g0 * C1) / g0 /
> > (dF0(g0) * dF1(g1) - 1)) - dF0(g0) * dF1(g1) * Gq * g1 - dF0(g0) * dF1(g1) *
> > C2 * g1 + KNB * g0 * dF0(g0) * dF1(g1) * exp((-Gq - C2 + g0 + g0 * C1) / g0 /
> > (dF0(g0) * dF1(g1) - 1)) + g0 * g1 + g0 * C1 * g1) / KNB / g0^2 / dF0(g0) /
> > dF1(g1) / (dF0(g0) * dF1(g1) - 1)
> >
> > Notice the leading "-" on the value for lamda2 .
>
>
> Thanks Walter,
> Yes dF0(go)dF1(g1) represent the multiplication of dF0(go) with dF1(g1) and dF0(g0) and dF1(g1) are not constants, they are functions (CDF of Rayleigh distribution) and the integration is w.r.t. to g0 and g1.
>
> Thanks for your help.
> Cheers
- - - - - - - -
  As a first step on your problem I believe you will need to use the pdf functions of the Rayleigh distribution to get

 dF0(g0) = g0/sigma0^2*exp(-g0^2/(2*sigma^2))*dg0

and likewise with dF1(g1). The integrands in each double integral can be separated into the difference between two terms, each of which can be factored with only g0 in one factor and g1 in the other factor. Therefore each double integral can be written as the difference between products of single integrals, one involving only g0 and the other g1. Then you can attempt to find analytic expressions for each of these single integrals.

Roger Stafford

Subject: solving equation for two unknowns

From: achenyo at

Date: 16 Aug, 2010 12:09:07

Message: 6 of 8

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i4a730$7ev$1@fred.mathworks.com>...
> "achenyo at" <achenyo2001@yahoo.com> wrote in message <i4a3vk$irq$1@fred.mathworks.com>...
> > Walter Roberson <roberson@hushmail.com> wrote in message <i4457o$k8r$1@canopus.cc.umanitoba.ca>...
> > > achenyo at wrote:
> > > > Hi,
> > > > I have the following two sets of equations:
> > > >
> > > > integral of ((1/(lamda1+(lamda2*g0)))-(KNB/g1))*dF0(go)dF1(g1) =
> > > > 1.................(1)
> > > >
> > > > and
> > > >
> > > > integral of ((g0/(lamda1+(lamda2*g0)))-(KNB*(g0/g1)))*dF0(go)dF1(g1) =
> > > > GQ.......(2)
> > > >
> > > > every other variable here is known except for amda1 and lamda2, how can
> > > > I solve for lamda1 and lamda2.
> > >
> > > Your equations are probably not valid. The indefinite integral of any equation
> > > does not equal an exact value: it equals a value plus an arbitrary constant.
> > > You are thus trying to solve two equations in four unknowns.
> > >
> > > Does your dF0(go) represent the differentiation of a known function F0, with
> > > respect to unspecified variable, and then evaluating the differential at the
> > > point g0 ? (note go vs g0 for one thing)
> > >
> > > Does dF0(go)dF1(g1) represent the multiplication of dF0(go) with dF1(g1) ? You
> > > were careful to use * to indicate multiplication everywhere else, so we are
> > > left to wonder whether you wished to denote something different.
> > >
> > > Which variables are the equations being integrated with respect to? If the
> > > answer is either go or g1 then the integral cannot be treated as if dF0(go) or
> > > dF1(g1) are just constants with known values and funny names.
> > >
> > >
> > > *If* dF0(g0) and dF1(g1) are constants for the purpose of integration
> > > (implying integration over lamda1, lamda2 or KNB) and if multiplication was
> > > intended, and if the arbitrary constants are added in, and if the integration
> > > just _happens_ to be over lamda1 in both cases, then the solution is:
> > >
> > > lamda1 = g1 * (g0 - dF0(go) * dF1(g1) * Gq - dF0(go) * dF1(g1) * C2 + g0 * C1)
> > > / KNB / g0 / dF0(go) / dF1(g1) / (dF0(go) * dF1(g1) - 1)
> > >
> > > lamda2 = -
> > > (-dF0(g0)^2 * dF1(g1)^2 * KNB * g0 * exp((-Gq - C2 + g0 + g0 * C1) / g0 /
> > > (dF0(g0) * dF1(g1) - 1)) - dF0(g0) * dF1(g1) * Gq * g1 - dF0(g0) * dF1(g1) *
> > > C2 * g1 + KNB * g0 * dF0(g0) * dF1(g1) * exp((-Gq - C2 + g0 + g0 * C1) / g0 /
> > > (dF0(g0) * dF1(g1) - 1)) + g0 * g1 + g0 * C1 * g1) / KNB / g0^2 / dF0(g0) /
> > > dF1(g1) / (dF0(g0) * dF1(g1) - 1)
> > >
> > > Notice the leading "-" on the value for lamda2 .
> >
> >
> > Thanks Walter,
> > Yes dF0(go)dF1(g1) represent the multiplication of dF0(go) with dF1(g1) and dF0(g0) and dF1(g1) are not constants, they are functions (CDF of Rayleigh distribution) and the integration is w.r.t. to g0 and g1.
> >
> > Thanks for your help.
> > Cheers
> - - - - - - - -
> As a first step on your problem I believe you will need to use the pdf functions of the Rayleigh distribution to get
>
> dF0(g0) = g0/sigma0^2*exp(-g0^2/(2*sigma^2))*dg0
>
> and likewise with dF1(g1). The integrands in each double integral can be separated into the difference between two terms, each of which can be factored with only g0 in one factor and g1 in the other factor. Therefore each double integral can be written as the difference between products of single integrals, one involving only g0 and the other g1. Then you can attempt to find analytic expressions for each of these single integrals.
>
> Roger Stafford

---------------
Thanks Roger, I have the CDF functions already and I have been able to separate the integrands as you suggested but I am now having problem solving for lambda 1 and lamda2 analytically? I've tried using the function "solve" but it's not working. Please how can I do this in matlab?

Cheers.

Subject: solving equation for two unknowns

From: Torsten Hennig

Date: 16 Aug, 2010 12:43:52

Message: 7 of 8

> "Roger Stafford"
> <ellieandrogerxyzzy@mindspring.com.invalid> wrote in
> message <i4a730$7ev$1@fred.mathworks.com>...
> > "achenyo at" <achenyo2001@yahoo.com> wrote in
> message <i4a3vk$irq$1@fred.mathworks.com>...
> > > Walter Roberson <roberson@hushmail.com> wrote in
> message <i4457o$k8r$1@canopus.cc.umanitoba.ca>...
> > > > achenyo at wrote:
> > > > > Hi,
> > > > > I have the following two sets of equations:
> > > > >
> > > > > integral of
> ((1/(lamda1+(lamda2*g0)))-(KNB/g1))*dF0(go)dF1(g1) =
> > > > > 1.................(1)
> > > > >
> > > > > and
> > > > >
> > > > > integral of
> ((g0/(lamda1+(lamda2*g0)))-(KNB*(g0/g1)))*dF0(go)dF1(g
> 1) =
> > > > > GQ.......(2)
> > > > >
> > > > > every other variable here is known except for
> amda1 and lamda2, how can
> > > > > I solve for lamda1 and lamda2.
> > > >
> > > > Your equations are probably not valid. The
> indefinite integral of any equation
> > > > does not equal an exact value: it equals a
> value plus an arbitrary constant.
> > > > You are thus trying to solve two equations in
> four unknowns.
> > > >
> > > > Does your dF0(go) represent the differentiation
> of a known function F0, with
> > > > respect to unspecified variable, and then
> evaluating the differential at the
> > > > point g0 ? (note go vs g0 for one thing)
> > > >
> > > > Does dF0(go)dF1(g1) represent the
> multiplication of dF0(go) with dF1(g1) ? You
> > > > were careful to use * to indicate
> multiplication everywhere else, so we are
> > > > left to wonder whether you wished to denote
> something different.
> > > >
> > > > Which variables are the equations being
> integrated with respect to? If the
> > > > answer is either go or g1 then the integral
> cannot be treated as if dF0(go) or
> > > > dF1(g1) are just constants with known values
> and funny names.
> > > >
> > > >
> > > > *If* dF0(g0) and dF1(g1) are constants for the
> purpose of integration
> > > > (implying integration over lamda1, lamda2 or
> KNB) and if multiplication was
> > > > intended, and if the arbitrary constants are
> added in, and if the integration
> > > > just _happens_ to be over lamda1 in both cases,
> then the solution is:
> > > >
> > > > lamda1 = g1 * (g0 - dF0(go) * dF1(g1) * Gq -
> dF0(go) * dF1(g1) * C2 + g0 * C1)
> > > > / KNB / g0 / dF0(go) / dF1(g1) / (dF0(go) *
> dF1(g1) - 1)
> > > >
> > > > lamda2 = -
> > > > (-dF0(g0)^2 * dF1(g1)^2 * KNB * g0 * exp((-Gq -
> C2 + g0 + g0 * C1) / g0 /
> > > > (dF0(g0) * dF1(g1) - 1)) - dF0(g0) * dF1(g1) *
> Gq * g1 - dF0(g0) * dF1(g1) *
> > > > C2 * g1 + KNB * g0 * dF0(g0) * dF1(g1) *
> exp((-Gq - C2 + g0 + g0 * C1) / g0 /
> > > > (dF0(g0) * dF1(g1) - 1)) + g0 * g1 + g0 * C1 *
> g1) / KNB / g0^2 / dF0(g0) /
> > > > dF1(g1) / (dF0(g0) * dF1(g1) - 1)
> > > >
> > > > Notice the leading "-" on the value for lamda2
> .
> > >
> > >
> > > Thanks Walter,
> > > Yes dF0(go)dF1(g1) represent the multiplication
> of dF0(go) with dF1(g1) and dF0(g0) and dF1(g1) are
> not constants, they are functions (CDF of Rayleigh
> distribution) and the integration is w.r.t. to g0 and
> g1.
> > >
> > > Thanks for your help.
> > > Cheers
> > - - - - - - - -
> > As a first step on your problem I believe you
> will need to use the pdf functions of the Rayleigh
> distribution to get
> >
> > dF0(g0) = g0/sigma0^2*exp(-g0^2/(2*sigma^2))*dg0
> >
> > and likewise with dF1(g1). The integrands in each
> double integral can be separated into the difference
> between two terms, each of which can be factored with
> only g0 in one factor and g1 in the other factor.
> Therefore each double integral can be written as the
> e difference between products of single integrals,
> one involving only g0 and the other g1. Then you can
> attempt to find analytic expressions for each of
> these single integrals.
> >
> > Roger Stafford
>
> ---------------
> Thanks Roger, I have the CDF functions already and I
> have been able to separate the integrands as you
> suggested but I am now having problem solving for
> lambda 1 and lamda2 analytically? I've tried using
> the function "solve" but it's not working. Please how
> can I do this in matlab?
>
> Cheers.

You have two nonlinear equations in two unknowns
(lambda1, lambda2). So you will have to use _fsolve_
to solve for lambda1 and lambda2.
Now, the two nonlinear equations contain
improper integrals - so in the routine where you have to
return the residuals of the two equations to fsolve,
you will have to call _quadgk_ to evaluate the integrals.

Best wishes
Torsten.

Subject: solving equation for two unknowns

From: achenyo at

Date: 17 Aug, 2010 12:35:31

Message: 8 of 8

Torsten Hennig <Torsten.Hennig@umsicht.fhg.de> wrote in message <2112777448.12038.1281962662245.JavaMail.root@gallium.mathforum.org>...
> > "Roger Stafford"
> > <ellieandrogerxyzzy@mindspring.com.invalid> wrote in
> > message <i4a730$7ev$1@fred.mathworks.com>...
> > > "achenyo at" <achenyo2001@yahoo.com> wrote in
> > message <i4a3vk$irq$1@fred.mathworks.com>...
> > > > Walter Roberson <roberson@hushmail.com> wrote in
> > message <i4457o$k8r$1@canopus.cc.umanitoba.ca>...
> > > > > achenyo at wrote:
> > > > > > Hi,
> > > > > > I have the following two sets of equations:
> > > > > >
> > > > > > integral of
> > ((1/(lamda1+(lamda2*g0)))-(KNB/g1))*dF0(go)dF1(g1) =
> > > > > > 1.................(1)
> > > > > >
> > > > > > and
> > > > > >
> > > > > > integral of
> > ((g0/(lamda1+(lamda2*g0)))-(KNB*(g0/g1)))*dF0(go)dF1(g
> > 1) =
> > > > > > GQ.......(2)
> > > > > >
> > > > > > every other variable here is known except for
> > amda1 and lamda2, how can
> > > > > > I solve for lamda1 and lamda2.
> > > > >
> > > > > Your equations are probably not valid. The
> > indefinite integral of any equation
> > > > > does not equal an exact value: it equals a
> > value plus an arbitrary constant.
> > > > > You are thus trying to solve two equations in
> > four unknowns.
> > > > >
> > > > > Does your dF0(go) represent the differentiation
> > of a known function F0, with
> > > > > respect to unspecified variable, and then
> > evaluating the differential at the
> > > > > point g0 ? (note go vs g0 for one thing)
> > > > >
> > > > > Does dF0(go)dF1(g1) represent the
> > multiplication of dF0(go) with dF1(g1) ? You
> > > > > were careful to use * to indicate
> > multiplication everywhere else, so we are
> > > > > left to wonder whether you wished to denote
> > something different.
> > > > >
> > > > > Which variables are the equations being
> > integrated with respect to? If the
> > > > > answer is either go or g1 then the integral
> > cannot be treated as if dF0(go) or
> > > > > dF1(g1) are just constants with known values
> > and funny names.
> > > > >
> > > > >
> > > > > *If* dF0(g0) and dF1(g1) are constants for the
> > purpose of integration
> > > > > (implying integration over lamda1, lamda2 or
> > KNB) and if multiplication was
> > > > > intended, and if the arbitrary constants are
> > added in, and if the integration
> > > > > just _happens_ to be over lamda1 in both cases,
> > then the solution is:
> > > > >
> > > > > lamda1 = g1 * (g0 - dF0(go) * dF1(g1) * Gq -
> > dF0(go) * dF1(g1) * C2 + g0 * C1)
> > > > > / KNB / g0 / dF0(go) / dF1(g1) / (dF0(go) *
> > dF1(g1) - 1)
> > > > >
> > > > > lamda2 = -
> > > > > (-dF0(g0)^2 * dF1(g1)^2 * KNB * g0 * exp((-Gq -
> > C2 + g0 + g0 * C1) / g0 /
> > > > > (dF0(g0) * dF1(g1) - 1)) - dF0(g0) * dF1(g1) *
> > Gq * g1 - dF0(g0) * dF1(g1) *
> > > > > C2 * g1 + KNB * g0 * dF0(g0) * dF1(g1) *
> > exp((-Gq - C2 + g0 + g0 * C1) / g0 /
> > > > > (dF0(g0) * dF1(g1) - 1)) + g0 * g1 + g0 * C1 *
> > g1) / KNB / g0^2 / dF0(g0) /
> > > > > dF1(g1) / (dF0(g0) * dF1(g1) - 1)
> > > > >
> > > > > Notice the leading "-" on the value for lamda2
> > .
> > > >
> > > >
> > > > Thanks Walter,
> > > > Yes dF0(go)dF1(g1) represent the multiplication
> > of dF0(go) with dF1(g1) and dF0(g0) and dF1(g1) are
> > not constants, they are functions (CDF of Rayleigh
> > distribution) and the integration is w.r.t. to g0 and
> > g1.
> > > >
> > > > Thanks for your help.
> > > > Cheers
> > > - - - - - - - -
> > > As a first step on your problem I believe you
> > will need to use the pdf functions of the Rayleigh
> > distribution to get
> > >
> > > dF0(g0) = g0/sigma0^2*exp(-g0^2/(2*sigma^2))*dg0
> > >
> > > and likewise with dF1(g1). The integrands in each
> > double integral can be separated into the difference
> > between two terms, each of which can be factored with
> > only g0 in one factor and g1 in the other factor.
> > Therefore each double integral can be written as the
> > e difference between products of single integrals,
> > one involving only g0 and the other g1. Then you can
> > attempt to find analytic expressions for each of
> > these single integrals.
> > >
> > > Roger Stafford
> >
> > ---------------
> > Thanks Roger, I have the CDF functions already and I
> > have been able to separate the integrands as you
> > suggested but I am now having problem solving for
> > lambda 1 and lamda2 analytically? I've tried using
> > the function "solve" but it's not working. Please how
> > can I do this in matlab?
> >
> > Cheers.
>
> You have two nonlinear equations in two unknowns
> (lambda1, lambda2). So you will have to use _fsolve_
> to solve for lambda1 and lambda2.
> Now, the two nonlinear equations contain
> improper integrals - so in the routine where you have to
> return the residuals of the two equations to fsolve,
> you will have to call _quadgk_ to evaluate the integrals.
>
> Best wishes
> Torsten.

----------------------------
Hi Torsten,

I have tried using the fsolve function following the examples given in Mathworks homepage but I keep getting this error:

"CAT arguments dimensions are not consistent".

Here is the fuction I have written:

function c= myfunct(lambda)
Bc = 60000;
No_dBm = -174; % background noise psd (dBm/Hz)
No_dB = -204; % background noise psd (dBW/Hz)
No = 10.^(No_dB./10); % psd linear value
Ps = 1;
G = 125;
B = 3.84e6;% Processing gain
Q = (No* B);
K = 0.08941;
% lambda0 = [-5; -5];
m = 1;


            h_0 = random('rayleigh',64); %the distribution of g
            g_0 = h_0^2; % channel gain
            f = @(x)(((m/ g_0)^m).*((x.^(m-1))./gamma(m)).*exp((-m.*x)./g_0));
            ff = (quad(f,g_0,10e12*g_0));
            
            h_1 = random('rayleigh',64); %the distribution of g
            g_1 = h_1^2;
            v = @(x)((((m/g_1)^m).*((x.^(m-1))./gamma(m)).*exp((-m.*x)./g_1))
            vv = (quad(f,g_1,10e12*g_1));
           
            c = [(1/(lambda(1)+(lambda(2)*g_0)))*ff -((K*No*Bc*(1/g_1))*vv)-Ps;((1/(lambda(1)+(lambda(2)*g_0))*ff)-((1/g_1)*vv)-((G*Q)/g_0))];
           
end

the error is at this last part (i.e. at 'c')

and this is the way I have used the function in my main program:

[lambda,cval,exitflag] = fsolve(@myfunct,lambda0,options);
            
Please what am I doing wrong?

Cheers.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us