Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
plz c this fortran code
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ahmed45" data-source="post: 1119453" data-attributes="member: 174306"><p>hello..this is a general newton forward difference ccode..where and what will change for newtons forward DIVIDED difference?.</p><p>.program Divided_Differences_Iterpolation dimension x(20),y(20),d(20,20) </p><p>n=7</p><p> xx=.7</p><p> data (x(i), i=1,7) /0,.5,1,1.4,2,3.2,5.5/ </p><p>data (y(i), i=1,7)/-1.25,-3.5,6,2.32,1.5,1.27,5.6/ </p><p> s=y(1) </p><p>do i=1,n-1</p><p> do j=1,n-i </p><p>y(j)=(y(j+1)-y(j))/(x(j+i)-x(j))</p><p> d(i,j)=y(j) print*,d(i,j) </p><p> enddo </p><p>enddo </p><p> do i=1,n-1 </p><p>p=1 </p><p>do j=1,i p=p*(xx-x(j))</p><p> enddo </p><p>s=s+d(i,1)*p enddo print*,'Inte</p><p>rpolation of(',xx,')=',s</p><p> end </p><p></p><p>please ..a quick reply is needed..thank u</p></blockquote><p></p>
[QUOTE="ahmed45, post: 1119453, member: 174306"] hello..this is a general newton forward difference ccode..where and what will change for newtons forward DIVIDED difference?. .program Divided_Differences_Iterpolation dimension x(20),y(20),d(20,20) n=7 xx=.7 data (x(i), i=1,7) /0,.5,1,1.4,2,3.2,5.5/ data (y(i), i=1,7)/-1.25,-3.5,6,2.32,1.5,1.27,5.6/ s=y(1) do i=1,n-1 do j=1,n-i y(j)=(y(j+1)-y(j))/(x(j+i)-x(j)) d(i,j)=y(j) print*,d(i,j) enddo enddo do i=1,n-1 p=1 do j=1,i p=p*(xx-x(j)) enddo s=s+d(i,1)*p enddo print*,'Inte rpolation of(',xx,')=',s end please ..a quick reply is needed..thank u [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
plz c this fortran code
Top