Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29040 Discussions

FORTRAN 77 NEQNF IMSL Solver, 2 variables, 6 equations.

Mustafa_U_
Beginner
1,427 Views

Hello!

I am trying to use NEQNF to solve a system of 6 non linear equations. I need to determine 2 variables to solve my system. According to description i need to define "N" which is the length of "X"(variables) AND "F"(equations).

Does this mean that i can use this solver only if X=F? Because N is defindes as an integer in the example given below in the description.

Or can i define N as a vector? How does declaration of N supposed to look like in this case?


And i have some general questions about the solver:
What happens if there is more than one solution for my system?

I can define XGUESS. Will this guess only be taken for the first step?

 

 

Fortran 77, Visual Studio 2008 Pro

Thanks in advance,

ikkebins!
 

0 Kudos
1 Solution
mecej4
Honored Contributor III
1,427 Views

The number of equations must equal the number of unknowns, if you wish to use NEQNF. To solve over-determined nonlinear equations, consider routines such as UNLSF (IMSL) and ?TRNLSP (MKL).

Does this mean that i can use this solver only if X=F?

"X = F" makes no sense. For example, X could be coordinates expressed in meters, and F could be made up of force components. However, it would be correct to say that size(X) = size(F).

View solution in original post

0 Kudos
3 Replies
mecej4
Honored Contributor III
1,428 Views

The number of equations must equal the number of unknowns, if you wish to use NEQNF. To solve over-determined nonlinear equations, consider routines such as UNLSF (IMSL) and ?TRNLSP (MKL).

Does this mean that i can use this solver only if X=F?

"X = F" makes no sense. For example, X could be coordinates expressed in meters, and F could be made up of force components. However, it would be correct to say that size(X) = size(F).

0 Kudos
Mustafa_U_
Beginner
1,427 Views

Thank you very much for your reply!!!

I was looking for a solver like this, but somehow couldn´t find it.

size(X) = size(F): Yes that was what i meant, but guess i was very imprecise there :)

 

0 Kudos
DavidWhite
Valued Contributor II
1,427 Views

Mustafa,

Elaborating on the comment that the number of equations must equal the number of variables to use NEQNF - this requirement is required mathematically.  If the number of equations is not equal to the number of variables, then you can only solve several of the equations at a time to get a solution.  Solving any other pair of equations may give you a different solution.  It is unlikely that the solution of all the equations at the same time will give the same unique solution.

NEQN = NVARS is a mathematical requirement, not for any particular solver.

David

0 Kudos
Reply