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:
m non-linear equations and two unkowns

Subject: m non-linear equations and two unkowns

From: Daniel Duarte

Date: 20 Mar, 2010 15:06:04

Message: 1 of 7

Nice day for everybody....

I'm no expert in MAthLab, I'm working in the Software World, specifically in software Project estimation field. In our investigation we get an equation system like next:

120 = A*342^B
130 = A*143^B
.
.
.
145 = A* 214^B

In this system we have m equations and two unkowns, we need a technique that let us know the A and B value for convergence or an aprox. value.

We can do something with MathLab for solve this issue?

We apreciate any ideas and support...thanks

Daniel Duarte

Subject: m non-linear equations and two unkowns

From: Matt J

Date: 20 Mar, 2010 15:38:03

Message: 2 of 7

"Daniel Duarte" <danieldarioduarte@hotmail.com> wrote in message <ho2o8s$5mq$1@fred.mathworks.com>...
> Nice day for everybody....
>
> I'm no expert in MAthLab, I'm working in the Software World, specifically in software Project estimation field. In our investigation we get an equation system like next:
>
> 120 = A*342^B
> 130 = A*143^B
> .
> .
> .
> 145 = A* 214^B
>
===========

If you're just lokoing for an approximation, you can log() both sides of these equations, so that they become linear

log(120) = C+342*B
log(130) = C+143*B
etc...

where C=log(A). You can use any linear equation solver to solve this. Although, if the data 120, 130, etc... are noisy, the log operation may induce a sub-optimal transformation of the noise.

Subject: m non-linear equations and two unkowns

From: Daniel Duarte

Date: 22 Mar, 2010 23:34:24

Message: 3 of 7

Hi Matt,
Thanks a lot for your response and your considearations about the system. Yes, We can to do this aproximation to linear system. In Mathlab How We solve this new system.

Thanks again..

"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <ho2q4r$2i7$1@fred.mathworks.com>...
> "Daniel Duarte" <danieldarioduarte@hotmail.com> wrote in message <ho2o8s$5mq$1@fred.mathworks.com>...
> > Nice day for everybody....
> >
> > I'm no expert in MAthLab, I'm working in the Software World, specifically in software Project estimation field. In our investigation we get an equation system like next:
> >
> > 120 = A*342^B
> > 130 = A*143^B
> > .
> > .
> > .
> > 145 = A* 214^B
> >
> ===========
>
> If you're just lokoing for an approximation, you can log() both sides of these equations, so that they become linear
>
> log(120) = C+342*B
> log(130) = C+143*B
> etc...
>
> where C=log(A). You can use any linear equation solver to solve this. Although, if the data 120, 130, etc... are noisy, the log operation may induce a sub-optimal transformation of the noise.

Subject: m non-linear equations and two unkowns

From: Torsten Hennig

Date: 23 Mar, 2010 07:34:13

Message: 4 of 7

> Hi Matt,
> Thanks a lot for your response and your
> considearations about the system. Yes, We can to do
> this aproximation to linear system. In Mathlab How We
> solve this new system.
>
> Thanks again..
>
> "Matt J " <mattjacREMOVE@THISieee.spam> wrote in
> message <ho2q4r$2i7$1@fred.mathworks.com>...
> > "Daniel Duarte" <danieldarioduarte@hotmail.com>
> wrote in message <ho2o8s$5mq$1@fred.mathworks.com>...
> > > Nice day for everybody....
> > >
> > > I'm no expert in MAthLab, I'm working in the
> Software World, specifically in software Project
> estimation field. In our investigation we get an
> equation system like next:
> > >
> > > 120 = A*342^B
> > > 130 = A*143^B
> > > .
> > > .
> > > .
> > > 145 = A* 214^B
> > >
> > ===========
> >
> > If you're just lokoing for an approximation, you
> can log() both sides of these equations, so that they
> become linear
> >
> > log(120) = C+342*B
> > log(130) = C+143*B
> > etc...
> >
> > where C=log(A). You can use any linear equation
> solver to solve this. Although, if the data 120, 130,
> etc... are noisy, the log operation may induce a
> sub-optimal transformation of the noise.

Create a matrix A with n rows and 2 colums
where the rows are given by [1 342], [1 143] etc.
Create an n-vector b given by [log(120) log(130) ...].
Calculate p = A\b.
Then p(1) = C and p(2) = B.

Best wishes
Torsten.

Subject: m non-linear equations and two unkowns

From: Torsten Hennig

Date: 23 Mar, 2010 07:53:16

Message: 5 of 7

> > Hi Matt,
> > Thanks a lot for your response and your
> > considearations about the system. Yes, We can to
> do
> > this aproximation to linear system. In Mathlab How
> We
> > solve this new system.
> >
> > Thanks again..
> >
> > "Matt J " <mattjacREMOVE@THISieee.spam> wrote in
> > message <ho2q4r$2i7$1@fred.mathworks.com>...
> > > "Daniel Duarte" <danieldarioduarte@hotmail.com>
> > wrote in message
> <ho2o8s$5mq$1@fred.mathworks.com>...
> > > > Nice day for everybody....
> > > >
> > > > I'm no expert in MAthLab, I'm working in the
> > Software World, specifically in software Project
> > estimation field. In our investigation we get an
> > equation system like next:
> > > >
> > > > 120 = A*342^B
> > > > 130 = A*143^B
> > > > .
> > > > .
> > > > .
> > > > 145 = A* 214^B
> > > >
> > > ===========
> > >
> > > If you're just lokoing for an approximation, you
> > can log() both sides of these equations, so that
> they
> > become linear
> > >
> > > log(120) = C+342*B
> > > log(130) = C+143*B
> > > etc...
> > >
> > > where C=log(A). You can use any linear equation
> > solver to solve this. Although, if the data 120,
> 130,
> > etc... are noisy, the log operation may induce a
> > sub-optimal transformation of the noise.
>
> Create a matrix A with n rows and 2 colums
> where the rows are given by [1 342], [1 143] etc.
> Create an n-vector b given by [log(120) log(130)
> ...].
> Calculate p = A\b.
> Then p(1) = C and p(2) = B.
>
> Best wishes
> Torsten.

Sorry, I took the wrong transformed system of
equations as a starting point.

Your system reads
120 = A*342^B
130 = A*143^B
.
.
.
145 = A* 214^B

Taking log on both sides you get
log(120) = log(A) + b*log(342)
log(130) = log(A) + b*log(143)
.
.
.
log(145) = log(A) + B*log(214)

So create a matrix A with n rows and 2 colums
where the rows are given by [1 log(342)],
[1 log(143)],...,[1 log(214)].
Create an n-vector b given by
b = [log(120) log(130) ... log(145)].
Calculate p = A\b.
Then A = exp(p(1)) and B = p(2).

Best wishes
Torsten.

Subject: m non-linear equations and two unkowns

From: Daniel Duarte

Date: 14 Apr, 2010 14:49:05

Message: 6 of 7

Hi Tosten,

Thanks a lot for your response...your response was very usefull for me. Best regards and thanks a lot again...

Daniel

Torsten Hennig <Torsten.Hennig@umsicht.fhg.de> wrote in message <207264003.423886.1269330826238.JavaMail.root@gallium.mathforum.org>...
> > > Hi Matt,
> > > Thanks a lot for your response and your
> > > considearations about the system. Yes, We can to
> > do
> > > this aproximation to linear system. In Mathlab How
> > We
> > > solve this new system.
> > >
> > > Thanks again..
> > >
> > > "Matt J " <mattjacREMOVE@THISieee.spam> wrote in
> > > message <ho2q4r$2i7$1@fred.mathworks.com>...
> > > > "Daniel Duarte" <danieldarioduarte@hotmail.com>
> > > wrote in message
> > <ho2o8s$5mq$1@fred.mathworks.com>...
> > > > > Nice day for everybody....
> > > > >
> > > > > I'm no expert in MAthLab, I'm working in the
> > > Software World, specifically in software Project
> > > estimation field. In our investigation we get an
> > > equation system like next:
> > > > >
> > > > > 120 = A*342^B
> > > > > 130 = A*143^B
> > > > > .
> > > > > .
> > > > > .
> > > > > 145 = A* 214^B
> > > > >
> > > > ===========
> > > >
> > > > If you're just lokoing for an approximation, you
> > > can log() both sides of these equations, so that
> > they
> > > become linear
> > > >
> > > > log(120) = C+342*B
> > > > log(130) = C+143*B
> > > > etc...
> > > >
> > > > where C=log(A). You can use any linear equation
> > > solver to solve this. Although, if the data 120,
> > 130,
> > > etc... are noisy, the log operation may induce a
> > > sub-optimal transformation of the noise.
> >
> > Create a matrix A with n rows and 2 colums
> > where the rows are given by [1 342], [1 143] etc.
> > Create an n-vector b given by [log(120) log(130)
> > ...].
> > Calculate p = A\b.
> > Then p(1) = C and p(2) = B.
> >
> > Best wishes
> > Torsten.
>
> Sorry, I took the wrong transformed system of
> equations as a starting point.
>
> Your system reads
> 120 = A*342^B
> 130 = A*143^B
> .
> .
> .
> 145 = A* 214^B
>
> Taking log on both sides you get
> log(120) = log(A) + b*log(342)
> log(130) = log(A) + b*log(143)
> .
> .
> .
> log(145) = log(A) + B*log(214)
>
> So create a matrix A with n rows and 2 colums
> where the rows are given by [1 log(342)],
> [1 log(143)],...,[1 log(214)].
> Create an n-vector b given by
> b = [log(120) log(130) ... log(145)].
> Calculate p = A\b.
> Then A = exp(p(1)) and B = p(2).
>
> Best wishes
> Torsten.

Subject: m non-linear equations and two unkowns

From: Roger Stafford

Date: 14 Apr, 2010 23:55:21

Message: 7 of 7

"Daniel Duarte" <danieldarioduarte@hotmail.com> wrote in message <ho2o8s$5mq$1@fred.mathworks.com>...
> Nice day for everybody....
>
> I'm no expert in MAthLab, I'm working in the Software World, specifically in software Project estimation field. In our investigation we get an equation system like next:
>
> 120 = A*342^B
> 130 = A*143^B
> .
> .
> .
> 145 = A* 214^B
>
> In this system we have m equations and two unkowns, we need a technique that let us know the A and B value for convergence or an aprox. value.
>
> We can do something with MathLab for solve this issue?
>
> We apreciate any ideas and support...thanks
>
> Daniel Duarte
----------------
  If you don't like the optimum attained by minimizing least squares of the differences between logarithms, there is another way to proceed. For any given value of B, it is easy to find the value of A which gives a least squares minimum. It would be just:

 A = (120*342^B+130*143^B+...+145*214^B)/(342^B+143^B+...+214^B)

  This allows you to prepare an objective function in terms of only the single variable B to be minimized using this formula for A. Then you could call on one of the minimization functions, perhaps 'fminbnd', which is in the basic matlab package, provided you have some rough idea where the best B is.

Roger Stafford

Tags for this Thread

No tags are associated with 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