Prev: IMSL
Next: pointer and allocatable array problem
From: nakisa on 22 Jan 2007 11:49 hi every body i use IMSL library , it works nice for simple functions . i have 2 problem now . 1) i use this subroutine to solve three equation with three variables . i know this set must have 2 sets of answers , but program give only one of them . ( these valuse are right ) but i don't konw why it doens't give the second answer !! i vary guess values ,but it only gives one of answers . 2) i have two equations with two variables , i want to use this sobrtine in do loop , each time in loop new value produce and use as constant in equations . so i can't give guess value for each loop . can anybody commet ? best,nakisa
From: jwm on 22 Jan 2007 15:06 nakisa wrote: > hi every body > i use IMSL library , it works nice for simple functions . i have 2 > problem now . > 1) i use this subroutine to solve three equation with three variables . > i know this set must have 2 sets of answers , but program give only one > of them . ( these valuse are right ) but i don't konw why it doens't > give the second answer !! i vary guess values ,but it only gives one of > answers . Are you sure you understand what "iterative method" means? The solution given by the routine depends on both the initial guess you provide and the number of iterations allowed for the method to converge. Since you only provided one initial guess, it can only converge to ONE solution (and you're going to need initial guesses to the remaining sets of answers if you want those as well). > > 2) i have two equations with two variables , i want to use this > sobrtine in do loop , each time in loop new value produce and use as > constant in equations . so i can't give guess value for each loop . > can anybody commet ? > best,nakisa You mean that after every loop, the solution is used to compute the new coefficients of your system of equations? If that's the case, your usersupplied function can access your solution through modules (or you can make it a CONTAINed function as well). Also, for every loop you're going to need an initial guess for the NEQNF no matter what. Although it depends on the characteristics of your problem, I think you can use your previous solution as the new initial guess, can't you? It is better to use DNEQNF instead of the singleprecision version, and if you're using a loop, it's a good idea if you consider providing the workspace explicitly (by using DN2QNF instead). I hope that helps.
From: nakisa on 23 Jan 2007 03:43 hi jwm you help me alot . by the way , i am new in fortran and i never use library before that . about my second question , your comment is very good .but there is another problem . in each loop , program must computes the number which this number is constant in equations ,not coefficient . but in each loop , there is at least two answers !! i don't know what should i do with this one ! best,nakisa
From: Beliavsky on 23 Jan 2007 09:39 nakisa wrote: > hi every body > i use IMSL library , it works nice for simple functions . i have 2 > problem now . NEQNF solves sets of nonlinear equations. A public domain Fortran library that is often used for this is Minpack, with the classic Fortran 77 version at http://www.netlib.org/minpack/ and a Fortran 90 version is at http://www.csit.fsu.edu/~burkardt/f_src/minpack/minpack.html . When possible, I prefer to use libraries with source code available.
From: nakisa on 24 Jan 2007 04:14 hi thanks of the link . but my problem is how to use this libaray subroutines in loop , i know there is more than one answer for system of equations . i should keep all of them . can you help me ?? best,nakisa

Pages: 1 Prev: IMSL Next: pointer and allocatable array problem 