comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Pass variables into Newton or BROYDEN for solving non-linear equations
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Pass variables into Newton or BROYDEN for solving non-linear equations [message #77928 is a reply to message #77926] Mon, 17 October 2011 18:10 Go to previous messageGo to previous message
Zhang Bo is currently offline  Zhang Bo
Messages: 22
Registered: October 2011
Junior Member
On Oct 17, 7:13 pm, Beaker <mattjamesfran...@gmail.com> wrote:
> On Oct 18, 6:24 am, Zhang Bo <bzhang20071...@gmail.com> wrote:
>
>> I have a non-linear equations system to solve in every loop step. I
>> have 4 equations with 8 variables. 4 of the variables are known and
>> calculated in each loop. I cannot find a way to pass the known
>> variables(which are different in each loop) into a BROYDEN or NEWTON
>> function to solve the system. If I put all 8 variables as input guess,
>> it won't calculate for me because there are 8 variables and 4
>> equations. I kind of stuck here.
>
> When I encountered a similiar issue using AMOEBA, the only solution I
> could see was to cover myself with garlic and use a COMMON block. I
> set the extra variables I want to send to each call before making that
> call and have the COMMON block visible from within the user defined
> function you send to NEWTON or whatever.
>
> Does that make sense?

Like this?

common lclinput, A, B, C, D
A = ****
B = ****
C = ****
D = ****
X = [250, 20, 6.2, 750]
Result = broyden(X,'lcl')

FUNCTION LCL, X
COMMON lclinput, A, B, C, D

return, [X[0]-T_s*(X[1]/P_s)^(287/cp_s),$
X[2] - X[3]*Mmr_s/(0.622+Mmr_s),$
X[1]-26.66082+alog(X[1]),$
X[0] - (X[1]-sqrt(X[1]^2-223.1986))/0.0182758048]
END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: fitting many linear eqs simultaneously with outliers
Next Topic: Re: compute quartiles of a distribution

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 02:15:22 PDT 2025

Total time taken to generate the page: 1.43835 seconds