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:
nonlinear system of equations

Subject: nonlinear system of equations

From: Dmitry Dmitry

Date: 8 Mar, 2008 15:40:22

Message: 1 of 8

Hello!!!

My problem is connected with solving the NONLINEAR SYSTEM
OF EQUATIONS in Matlab, which has the following
peculiarities:

1) The number of equations is very big (>30)
2) The accuracy required is very high

FSOLVE function doesn't provide the accuracy I need (the
relative error between the known and found solutions is
>10%).

What methods and functions in Matlab would you recommend?
If necessary, I can download the system of equations.

Thanks in advance

Dmitry

Subject: nonlinear system of equations

From: tommo97@gmail.com

Date: 8 Mar, 2008 15:52:31

Message: 2 of 8

On Mar 8, 3:40=A0pm, "Dmitry Dmitry" <klio2...@list.ru> wrote:
> Hello!!!
>
> My problem is connected with solving the NONLINEAR SYSTEM
> OF EQUATIONS in Matlab, which has the following
> peculiarities:
>
> 1) The number of equations is very big (>30)
> 2) The accuracy required is very high
>
> FSOLVE function doesn't provide the accuracy I need (the
> relative error between the known and found solutions is
>
> >10%).
>
> What methods and functions in Matlab would you recommend?
> If necessary, I can download the system of equations.
>
> Thanks in advance
>
> Dmitry

Hi Dmitry,
Is it possible that fsolve is returning a local minima? What happens
if you use something very close to the exact solution as the starting
value?

Tom

Subject: nonlinear system of equations

From: Dmitry Dmitry

Date: 8 Mar, 2008 19:07:02

Message: 3 of 8

Tom, thanks for your reply!!!

In fact, I don't know the exact solution, therefore I
pointed ZERO values as the starting ones. In fact, the
solution, as I've written, is very close, but still it
doesn't satisfy the accuracy requirements. Concerning
Jacobian, I tried both: calculating it myself and making
FSOLVE do it. The difference doesn't seem much.

At the end of iteration process I saw the warning:

"Optimizer appears to be converging to a minimum that is
not a root:
Sum of squares of the function values is > sqrt
(options.TolFun).
Try again with a new starting point."

So the optimizer has found a minimum but not a zero,
however the criterion (of FSOLVE function) is satisfied!!!

How can I guess the starting point? How can I improve
FSOLVE work?

Thanks in advance,

Dmitry

Subject: nonlinear system of equations

From: carlos lopez

Date: 9 Mar, 2008 21:32:03

Message: 4 of 8

What about the condition number of the Jacobian?
Regards
Carlos

Subject: nonlinear system of equations

From: carlos lopez

Date: 9 Mar, 2008 21:41:04

Message: 5 of 8

"Dmitry Dmitry" <klio2003@list.ru> wrote in message
...
> 2) The accuracy required is very high
>
> FSOLVE function doesn't provide the accuracy I need (the
> relative error between the known and found solutions is
> >10%).

Hello Dmitry:
There are two standard metrics for measuring "suitability"
for an approximate solution:
a) check how close to zero is the current solution
b) check how close to the exact one is the current solution

In order to have an estimate for b) you need to expand the
nonlinear vector function and truncate. Thus, you will need
the Jacobian, and indirectly its condition number will play
a role.

The other option does not provide any cue about how close
are you to the exact solution. In some cases (I have
suffered from that) requiring the "relative change" to be
below a prescribed, low level, is not a wise idea.
The reason arises when (at least in my case) there exist
severe cancellation and shift out, thus precluding to
improve the results using double precision. To make things
worse, such pathology IS NOT related with the condition
number of anything, but with the deep limitations of the
number system.
In my case (which might serve for others) I managed to
recalculate the residual (i.e. option a)) using
higher-than-double precision. Despite tiny, the changes
close to the solution were significant enough to make again
valid all the math behind the algorithms.
Hope this helps
Regards
Carlos
PD: as a higher-than-double precision I can mention the
Multiple Precision Toolbox by Ben barrowes, available on the FEX


 

Subject: nonlinear system of equations

From: Yi Cao

Date: 9 Mar, 2008 22:10:19

Message: 6 of 8

"Dmitry Dmitry" <klio2003@list.ru> wrote in message <fquc16
$r4u$1@fred.mathworks.com>...
>
> What methods and functions in Matlab would you recommend?
> If necessary, I can download the system of equations.
>

You may wish to try lsqnonlin. Normally, the Levenberg-
Marquardt approach provides better convergence.

Good luck
Yi

Subject: nonlinear system of equations

From: Ralph Schleicher

Date: 10 Mar, 2008 21:36:01

Message: 7 of 8

"Dmitry Dmitry" <klio2003@list.ru> writes:

> My problem is connected with solving the NONLINEAR SYSTEM
> OF EQUATIONS in Matlab, which has the following
> peculiarities:

From my experience with Matlab I have to say "forget it". Neither
'fsolve' nor 'lsqnonlin' can solve any serious problem.

Last year I attended a student whose task was to check out the
capabilities of 'fsolve' and 'lsqnonlin'. The problem statement was
to find the steady-state solution for a mixing process of compressible
gases. Although the initial value was equal to the exact solution in
5 digits after the decimal point and the Jacobi matrix was provided
analytically, neither of the two commands could find a solution. After
weeks of fiddling with options and tolerances we forwarded the problem
to The Mathworks. The response was disillusioning -- in summary "no
chance" to solve it in any reasonable computing time. Our target was
less than 2 minutes, The Mathworks support estimated that it may be
possible to solve it over night with the help of a global optimizer.

Nota bene: The exact solution was calculated with Dymola/Modelica in
less than a second with initial values set to zero! The current
Modelica model has approx. 300 linear equations and approx. 100
non-linear equations. I don't even think about feeding that into
Matlab.

<flame>The Mathworks definitely should invest more money in algorithms
than in GUI gimmicks.</flame>

--
Ralph Schleicher, Freelance Engineer http://ralph-schleicher.de

Development * Consulting * Training
Mathematical Modeling and Simulation
Software Tools

Subject: PID CONTROLLER IN MATLAB (7.0) :Please help me out

From: shree

Date: 18 Mar, 2008 11:09:06

Message: 8 of 8

Respected Sir,
I am student of Master in .Eng. (Process Intrumentation&Control)
Currently working on Design of PID controler for Two in put two out
put system.
I have concentrated my work on your research paper .In present paper
PID controller response final plot is there I am not able to
reproduce it thorugh matlab programming.
 I will send you my research paper and my .m file. please tell me
any changes to be made.
my e mail id is shri.shripad@gmail.com
Thanking you in Advance
Eagerly waiting for your reply
Regards
Shripad

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