Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: sum in nonlinear equations


From   "Andreas Aschbacher" <[email protected]>
To   [email protected]
Subject   st: sum in nonlinear equations
Date   Tue, 30 Mar 2004 10:36:37 +0200 (MEST)

Dear fellows !
is there apossibility to write line *9* in Stata-code - 
I have written it in pseudocode,please look at line 9
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. capture program drop nlfaq

. program nlfaq
  1.    if "`1'" == "?" {
  2.       global S_1 " A B C"
  3.       global A=1
  4.       global B=1
  5.       global C=1
  6.       exit
  7.    }
  8.    tempvar yh  
  9.    gen `yh'= exp($A) + sum(from n =1 to 34)[n*cos($B)+ (n-1)*tan($B)] -
2 in 1
 10.    replace `yh'= $A/$B +$C^2-log($B) in 2
 11.    replace `yh'= $A/($A+$B+$C)- sin($C) in 3
 12.    replace `1' = `yh'
 13.    
. end

. nl faq y
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this would be very necessary for me because I could deconvolute with Stata
using modified Simpsonrule for computing integrals.
using LevenbergMarquardt with Stata is possible in physics,convolution-
computing
is very easy too,the way back namely deconvolution would be possible too if
I could
compute this sum

any help would be appreciated very much
andreas aschbacher,greetings to all fanatic Stata users in the world

-- 
+++ NEU bei GMX und erstmalig in Deutschland: T�V-gepr�fter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index