Posts

Golden Section Search Method: Fortran f90

Consider the nonlinear equation f(x)=4x 2 –exp(x). Write a Fortran program that uses the Golden Section Search Method to find the solution accurate to within 10 -6 for the nonlinear equation on [4,8].  Sauce Code: Program  Assignmentq2 implicit none real:: f real::x, r, q1, q2,a, b, tol=1.0e-6 !Define Interval and Function f(x) = 4*x**2-exp(x) a=4 b=8 print*, "a", a, "b", b !Evaluation of the function at the end point r=(sqrt(5.0)-1)/2 q1=b-r*(b-a) q2=a+r*(b-a)  print*, "q1",q1, "q2", q2  ! Creating Loop !if ((b-a)<=tol) stop do while ((b-a)>tol)      !if(f(a)*f(b)<=0) then      if(f(a)*f(q2)<=0) then          b=q2          q2=q1          q1=b-r*(b-a)      else          a=q1          q1=q2          q2=a+r*(b-a) ...

Gaussian Elimination Method: Fortran f90

 Question: Solve the following system of linear equations using Gaussian Elimination using Fortran. x 1 + x 2 - x 3 + x 4 - x 5 = 2 2x 1 + 2 x 2 + x 3 - x 4 + x 5 = 4 3x 1 + x 2 -3 x 3 -2x 4 + 3 x 5 = 8 4x 1 + x 2 - x 3 +4 x 4 -5x 5 =16 16x 1 -x 2 + x 3 - x 4 - x 5 =32   Solution: program main implicit none integer, parameter :: n=5 double precision:: a(n,n), b(n), x(n) integer:: i,j ! matrix A   data (a(1,i), i=1,5) /  1.0,  1.0,  -1.0, 1.0, -1.0 /   data (a(2,i), i=1,5) /  2.0,  2.0,  1.0, -1.0, 1.0 /   data (a(3,i), i=1,5) /  3.0,  1.0,  -3.0, -2.0, 3.0 /   data (a(4,i), i=1,5) /  4.0,  1.0,  -1.0, 4.0, -5.0 /   data (a(5,i), i=1,5) /  16.0, -1.0, 1.0, -1.0, -1.0 / ! matrix b   data (b(i),   i=1,5) /  2.0, 4.0, 8.0, 16.0, 32.0 / ! print a header and the original equations   write (*,200)   do i=1,n      write ...

A "Lost Decade" in Nepalese Economy

Image
I was looking for the dynamics of fiscal and monetary policy in the Nepalese economy.   Both have a specific economic and political explanation, though monetary policy stands more economic connotation than the fiscal one. Although the central bank has a specialized department and relatively competent human resources, even their document seems are unable to get the real picture of the economy. Since 2004/05 to 20015/16 inflation remains higher than the GDP growth in Nepal. It happened not just like it to be.  In reality, it was committed because of the political, structural, and market-based phenomenon that are not even looked for a reason. I have gone through another aspect to analyze the Nepalese economy whether it is 'paradigm shift '. Reviewing the documents and consulting with then officer bearer, I am almost convinced with the situation of 'paradigm lost' rather in Nepalese economy. Simply this conclusion is driven due to the failure of understanding the...

Provision of Grants (Fiscal Equalization, Conditional, Complementary and Special) in Nepal

Generally in federal countries, Sub-national governments (SNGs) receives intergovernmental grants to finance their assigned activities and implement national policies. Grants are used to subsidies of services and equalization of the grants. However, the allocation of grants is found to be complex in its governance (OECD, 2006).   According to the world bank , the government introduces intergovernmental transfers for four reasons. First one is to maintain the vertical balance. Vertical imbalances arise between the SNGs due to the imbalance between the expenditure responsibilities and revenue raising power, this may cause to a deficiency in service delivery made by SNGs. The second reason is to equalize the capacities of the resources while in SNGs, their revenue raising capacity varies. Third one is the externalities . Due to the low revenue capacity SNGs under-spend where substantial external benefits ensure-like spending on health and education by their own resources. An...

अर्थतन्त्र के हो ? आर्थिक वृद्धि कसरी ?

पृष्टभूमि नेपालको आर्थिक बृद्धिदर विगत दुई वर्षमा औसत ६ प्रतिशतभन्दा माथि रहृयो । आर्थिक वृद्धिले प्रत्यक्ष र अप्रत्यक्ष गरी दुई पक्षलाई समेट्छ । आर्थिक वृद्धि हुँदा देशमा उत्पादन बढेको , रोजगारीका अवसरहरु फराकिलो हुँदै गएको , व्यक्तिको क्रयशक्ति वढेको जस्ता विषयहरु प्रत्यक्षतर्फ रहन्छन् । अप्रत्यक्षको पाटोमा चाहिँ देशभित्र आर्थिक रुपमा नै सक्रिय व्यक्ति , व्यावसायिक समूह/वर्ग (स्वदेशी , विदेशी) मा भविश्यप्रति सकारात्मक अपेक्षाको सञ्चार हुन्छ । यसको कारण अर्थतन्त्र पुनः चक्रीय आर्थिक वृद्धिको क्षेत्रभित्र प्रवेश गर्दछ । देशले जति धेरै आर्थिक वृद्धि हासिल गर्‍यो , त्यसले प्रत्यक्ष र अप्रत्यक्ष दुवै पक्षलाई वृहत बनाउँछ । परिणामस्वरुप बेरोजगारीको समस्या समाधान हुने , स्रोत र साधनको उच्चतम प्रयोग हुने , निर्यात गर्न सक्ने क्षमताको वृद्धि हुने , वैदेशिक मुद्राको आर्जन बढ्न सक्ने , सोधान्तर अवस्था सकारात्मक हुने जस्ता सूचकहरु देखिन्छन् । यसर्थ कुनै पनि अर्थतन्त्रमा आर्थिक वृद्धि सधैँ अपेक्षित रहन्छ । आर्थिक वृद्धिको यत्ति धेरै सकारात्मक आयाम हुँदाहुँदै पनि कुनै पनि देशले चाहेजस्तो वृ...