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:
solve complex multi-variant non-linear equations

Subject: solve complex multi-variant non-linear equations

From: grace

Date: 12 Jan, 2012 06:17:38

Message: 1 of 8

How to compose codes in matlab to solve multi-variant non-linear equations when the number of variants exceeds the number of equations?

I have tried fsolve and fminunc but got the same warning. It seems that the existing functions are not suitable for the problem.

The least-square regression is useful, but very time-consuming, or the precision of calculation is not satisfying.

Thanks for every response that might help.

Subject: solve complex multi-variant non-linear equations

From: Torsten

Date: 12 Jan, 2012 07:30:22

Message: 2 of 8

On 12 Jan., 07:17, grace <xchen...@gmail.com> wrote:
> How to compose codes in matlab to solve multi-variant non-linear equations when the number of variants exceeds the number of equations?
>
> I have tried fsolve and fminunc but got the same warning. It seems that the existing functions are not suitable for the problem.
>
> The least-square regression is useful, but very time-consuming, or the precision of calculation is not satisfying.
>
> Thanks for every response that might help.

What are multi-variant non-linear equations ?
Which warning do you get when you try to use fsolve or fminunc ?
Did you choose 'levenberg-marquardt' as algorithm with fsolve ?
Did you already try lsqnonlin from the optimization toolbox ?

Best wishes
Torsten.

Subject: solve complex multi-variant non-linear equations

From: Roger Stafford

Date: 12 Jan, 2012 21:17:09

Message: 3 of 8

grace <xchenhuo@gmail.com> wrote in message <22601524.114.1326349058392.JavaMail.geo-discussion-forums@yqcb25>...
> How to compose codes in matlab to solve multi-variant non-linear equations when the number of variants exceeds the number of equations?
> I have tried fsolve and fminunc but got the same warning. It seems that the existing functions are not suitable for the problem.
> The least-square regression is useful, but very time-consuming, or the precision of calculation is not satisfying.
- - - - - - - - - -
  When a problem has more (continuum-valued) unknowns than equations, it generally indicates that infinitely many solutions exist. This usually implies a problem that has not as yet been sufficiently well-defined and shows that perhaps more conditions need be placed on the unknowns. Your reference to "least squares" methods would hint that you do have other conditions in mind.

Roger Stafford

Subject: solve complex multi-variant non-linear equations

From: grace

Date: 13 Jan, 2012 02:54:03

Message: 4 of 8

Dear Torsten,

Thanks for your reply.
I use the arbitrarily assembled describing words to refer to several equations that have more than one unknown and are not linear.
I got the warning “Warning: Default trust-region dogleg method of FSOLVE cannot
 handle non-square systems; switching to Gauss-Newton method".
I guessed that Fsolve is not proper for conditions where there are many answers. So I switched to least square.
Your suggestion to choose other algorithms is very valuable. As I am a beginner of Matlab, would you please tell me how to change the algorithm with fsolve? Thanks a lot.

Subject: solve complex multi-variant non-linear equations

From: grace

Date: 13 Jan, 2012 03:01:15

Message: 5 of 8

Dear Roger,

Thanks for your reply. Your understanding of my problem is very precise.
I cannot add more restrictions to the unknowns. I solved the problem by least square method, with preset values from which the one that could minimized the objective function was chosen. By manually changing the range and the precision of calculation, the solution got more and more close to the real answer. It is a little laborous, and ... stupid.
I am a beginner of Matlab, and I would appreciate if you could tell me other clever methods. Thanks.

Subject: solve complex multi-variant non-linear equations

From: grace

Date: 13 Jan, 2012 03:03:23

Message: 6 of 8

Dear Roger,

Thanks for your reply. Your understanding of my problem is very precise.
I cannot add more restrictions to the unknowns. I solved the problem by least square method, with preset values from which the one that could minimized the objective function was chosen. By manually changing the range and the precision of calculation, the solution got more and more close to the real answer. It is a little laborous, and ... stupid.
I am a beginner of Matlab, and I would appreciate if you could tell me other clever methods. Thanks.

Subject: solve complex multi-variant non-linear equations

From: grace

Date: 13 Jan, 2012 03:00:03

Message: 7 of 8

Dear Roger,

Thanks for your reply. Your understanding of my problem is very precise.
I cannot add more restrictions to the unknowns. I solved the problem by least square method, with preset values from which the one that could minimized the objective function was chosen. By manually changing the range and the precision of calculation, the solution got more and more close to the real answer. It is a little laborous, and ... stupid.
I am a beginner of Matlab, and I would appreciate if you could tell me other clever methods. Thanks.

Subject: solve complex multi-variant non-linear equations

From: Torsten

Date: 13 Jan, 2012 08:26:23

Message: 8 of 8

On 13 Jan., 03:54, grace <xchen...@gmail.com> wrote:
> Dear Torsten,
>
> Thanks for your reply.
> I use the arbitrarily assembled describing words to refer to several equations that have more than one unknown and are not linear.
> I got the warning “Warning: Default trust-region dogleg method of FSOLVE cannot
>  handle non-square systems; switching to Gauss-Newton method".
> I guessed that Fsolve is not proper for conditions where there are many answers. So I switched to least square.
> Your suggestion to choose other algorithms is very valuable. As I am a beginner of Matlab, would you please tell me how to change the algorithm with fsolve? Thanks a lot.

According to your problem description in the reply to Roger, your
problem
does not seem so much a problem in the choice of the numerical solver,
but in the mathematical formulation of the problem itself.
When you say that you are changing the range of the variables in a
trial-and-error way,
maybe restricting variables to a certain range might help to get
better solutions more easily.
The appropriate solvers to do this are lsqnonlin or fmincon.

Best wishes
Torsten.

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