• ベストアンサー

数値解析の教科書の内容。

こんいちは。  補間の洋書に、 「Solution If we take ten points, including the ends of the interval, then we create nine subintervals, each of lenght h=0.1875. The points are then X(i)=i×h for i = 0,1,...,9. After obtaining the polynomial, we evaluate sin(x)-p(x) at 37 points (called t in the pseudocode). These are t(j)=(j×h)/4 for j=0,1,...,36. Here is a suitable main program in pseudocode that calls the procedures Coef and Eval previously given.」 とあったのですが、意味が読み取れません。この文章の後に、コンピュータのプログラムみたいなのがあります。アドバイスお願いします(泣)

質問者が選んだベストアンサー

  • ベストアンサー
  • imopro
  • ベストアンサー率35% (58/163)
回答No.2

> for i=n to j step -1 do 前後を読んでないので,ほぼあてずっぽーですが, 単純に,「iをnからjまで-1ずつ加算する」という意味では. つまり,iをn-1,n-2,…j+1,jと1ずつ減じていくわけだと思います. 英語は(も?)辞書引けばある程度理解できると思うので,自力で頑張るべきです.

その他の回答 (1)

noname#29127
noname#29127
回答No.1

丸投げでなく、どの部分がどういう風に分からないのかを聞いてみれば。 前に質問されたプログラムのことのようですが、そちらの回答はご覧に なったのでしょうか?  http://oshiete1.goo.ne.jp/qa2970292.html?ans_count_asc=20

Lovechild0
質問者

補足

すいません。 Coefというのプログラムの中に、for i=n to j step -1 do と会ったのですが、stepとはどのように捉えればよいのでしょうか?? これがわかれば解決できそうです。

関連するQ&A

  • プログラムに内容と計算の質問です。

    こんにちは。 補間多項式についての、コンピュータのプログラムの解読に困っています。内容は、 「For the numerical experiments suggested in the computer problems, the following two procedures should be satisfactory. The first is called Coef. It requires as input the number n and tabular values in the array {Xi} and {Yi}. Remember that the number of points in the table is n+1. The procedure then computes the coefficients required in the Newton interpolating polynomial, storing them in the array{Ai}. -------------------------------------------------------- procedure; Coef(n,{Xi},{Yi},{Ai}) real array; {Xi}0:n, {Yi}0:n, {Ai}0:n integer; i,j,n for i=0 to n do {Ai}←{Yi} end for for j=1 to n do for i=n to j step -1 do Ai←({Ai}-{Ai-1})/({Xi}-{Xi-j}) end for end for end procedure Coef --------------------------------------------------------- このプログラムのn=3の時を考えるとき、  (1)j=1のとき、i=3,2,1 <j=1,i=1> {A1}=({A1}-{A0})/({X1}-{X0}) =({Y1}-{Y0})/({X1}-{X0}) <i=1,i=2> {A2}=({A2}-{A1})/({X2}-{X1}) =({Y2}-{Y1})/({X2}-{X1}) <i=1,i=3> {A3}=({A3}-{A2})/({X3}-{X2}) =({Y3}-{Y2})/({X3}-{X2}) (2)j=2のとき、i=3,2 <j=2,i=1> A1=({A2}-{A1})/({X2}-{X0})          ={[({Y2}-{Y1})/({X2}-{X1})]-[({Y1}-{Y0})/({X1}-{X0})]}/({X2}-{X0}) =この式変形をしたいのですが、どのように         すれば良いのかわかりません。ラグランジェ         型になりそうでなりません(泣)         (1)で求めた{A1},{A2},{A3}を使って求めな         いといけないみたいです。 見にくい表し方で申し訳ありません。 アドバイスお願いします!!

  • 逆数補間の計算方法について

    こんにちは。前にも書かせてもらいましたが、どうしても計算ができないので、もう一度質問させてもらいました。 以下のような、洋書を読んで、最後にあるP(y)を出したいのですが、計算方法がわかりません。 ---------------------------------------------------------------- [Inverse Interpolation] A process called inverse interpolation is often used to approximate an inverse function. Suppose that values {Yi}=f({Xi}) have been computed at X0,X1,...,Xn. Using table Y ; Y0 Y1 Y2 ......Yn X ; X0 X1 X2 ......Xn we form the interpolation polynomial p(y)=Σ(i=1→n)CiΠ(j=0→i-1){Y-Yj} The orijinal relationship, y=f(x), has an inverse, under certain conditions. This inverse is being approximated by x=p(y). Procedures Coef and Eval can be used to carry out the inverse interpolation by reversing the arguments x and y in the calling sequence for Coef. Inverse interpolation can be used to find where a given functuin f has a root or zero. This means inverting the equation f(x)=0. We propose to do this by creating a table of values (f(Xi),Xi) and interpolating with a polynomial,p. Thus, p(Yi)=Xi. The points Xi should be chosen near the unknown root,r. The approximate root is then given by r ~p(0). For a concrete case, let the table of known values be Y;-0.5789200,-0.3626370,-0.1849160,-0.0340642,0.0969858 X; 1.0 , 2.0 , 3.0 , 4.0 , 5.0 The nodes in this problem are the points in the row of the table headed y, and the function values being interpolated are in the x row. The resulting polynomial is p(Y)=0.25Y^4+1.2Y^3+3.69Y^2+7.39Y+4.247470086 and p(0)=4.247470086. Only the last coefficient is shown with all the digits carried in the calculation, for it is the only one needed for the problem at hand. ---------------------------------------------------------------- <補足>CoefとEvalについて 「 procedure; Coef(n,{Xi},{Yi},{Ai}) real array; {Xi}0:n, {Yi}0:n, {Ai}0:n integer; i,j,n for i=0 to n do {Ai}←{Yi} end for for j=1 to n do for i=n to j step -1 do Ai←({Ai}-{Ai-1})/({Xi}-{Xi-j}) end for end for end procedure Coef 」 「 real function; Eval(n,{Xi},{Yi},{Ai}) real array; {Xi}0:n, {Ai}0:n integer; i,n real;t,temp temp←An for i=n-1 to 0 step -1 do temp←(temp)(t-{Xi})+{Ai} end for Eval←temp end function Eval」 ------------------------------------------------------------- XとYを扱い方がよくわかっていないので、計算できないのかなあと思います。分かる方、アドバイスお願いします(泣)

  • 逆関数の補間について

    こんにちは。前に質問させてもらい、計算については 理解できました。しかし、以下の文章のある部分の意味がわかりません。まず、文章は、 [Inverse Interpolation] A process called inverse interpolation is often used to approximate an inverse function. Suppose that values {Yi}=f({Xi}) have been computed at X0,X1,...,Xn. Using table Y ; Y0 Y1 Y2 ......Yn X ; X0 X1 X2 ......Xn we form the interpolation polynomial p(y)=Σ(i=1→n)CiΠ(j=0→i-1){Y-Yj} The orijinal relationship, y=f(x), has an inverse, under certain conditions. This inverse is being approximated by x=p(y). Procedures Coef and Eval can be used to carry out the inverse interpolation by reversing the arguments x and y in the calling sequence for Coef. Inverse interpolation can be used to find where a given functuin f has a root or zero. This means inverting the equation f(x)=0. We propose to do this by creating a table of values (f(Xi),Xi) and interpolating with a polynomial,p. Thus, p(Yi)=Xi. The points Xi should be chosen near the unknown root,r. The approximate root is then given by r ~p(0). For a concrete case, let the table of known values be Y;-0.5789200,-0.3626370,-0.1849160,-0.0340642,0.0969858 X; 1.0 , 2.0 , 3.0 , 4.0 , 5.0 The nodes in this problem are the points in the row of the table headed y, and the function values being interpolated are in the x row. The resulting polynomial is p(Y)=0.25Y^4+1.2Y^3+3.69Y^2+7.39Y+4.247470086 and p(0)=4.247470086. Only the last coefficient is shown with all the digits carried in the calculation, for it is the only one needed for the problem at hand. ---------------------------------------------------------------- <補足>CoefとEvalについて 「 procedure; Coef(n,{Xi},{Yi},{Ai}) real array; {Xi}0:n, {Yi}0:n, {Ai}0:n integer; i,j,n for i=0 to n do {Ai}←{Yi} end for for j=1 to n do for i=n to j step -1 do Ai←({Ai}-{Ai-1})/({Xi}-{Xi-j}) end for end for end procedure Coef 」 「 real function; Eval(n,{Xi},{Yi},{Ai}) real array; {Xi}0:n, {Ai}0:n integer; i,n real;t,temp temp←An for i=n-1 to 0 step -1 do temp←(temp)(t-{Xi})+{Ai} end for Eval←temp end function Eval」 ------------------------------------------------------------- です。この文章の 「The orijinal relationship, y=f(x), has an inverse, under certain conditions. This inverse is being approximated by x=p(y). Procedures Coef and Eval can be used to carry out the inverse interpolation by reversing the arguments x and y in the calling sequence for Coef. Inverse interpolation can be used to find where a given functuin f has a root or zero. This means inverting the equation f(x)=0. We propose to do this by creating a table of values (f(Xi),Xi) and interpolating with a polynomial,p. Thus, p(Yi)=Xi. The points Xi should be chosen near the unknown root,r. The approximate root is then given by r ~p(0).」 という部分が理解できません。わかる方アドバイスお願いします(泣)

  • 補間についての質問です。

    こんにちは。 大学4年で、数値解析の研究をしているものです。 早速ですが、英語の教科書を読んでて、補間で、コンピュータのプログラムの説明が書かれていて、そこに「Coef」や「Eval」とかいてあったのですがこれは、どういったプログラムなのでしょうか?? あと「Write puseudocode that determines that Newton form of the interpolating polynomial p for sin(x) at ten equidistant points in the interval [0,1.6875]. The code should print the value of sin(x)-p(x) at 37 equally spaced points in the same interval.」の意味がよくわわからないのでアドバイスお願いします(泣)

  • 逆数補間についての内容です。

    こんにちは。 私は、大学生で、補間についての勉強をしているものです。今回、始めて、洋書を読むことになり苦戦しております。以下の内容はどういったものなのでしょうか?アドバイスをいただきたいと思い、書かせてもらいました。 _______________________________________________________________ [Inverse Interpolation] A process called inverse interpolation is often used to approximate an inverse function. Suppose that values {Yi}=f({Xi}) have been computed at X0,X1,...,Xn. Using table Y ; Y0 Y1 Y2 ......Yn X ; X0 X1 X2 ......Xn we form the interpolation polynomial p(y)=Σ(i=1→n)CiΠ(j=0→i-1){Y-Yj} The orijinal relationship, y=f(x), has an inverse, under certain conditions. This inverse is being approximated by x=p(y). Procedures Coef and Eval can be used to carry out the inverse interpolation by reversing the arguments x and y in the calling sequence for Coef. Inverse interpolation can be used to find where a given functuin f has a root or zero. This means inverting the equation f(x)=0. We propose to do this by creating a table of values (f(Xi),Xi) and interpolating with a polynomial,p. Thus, p(Yi)=Xi. The points Xi should be chosen near the unknown root,r. The approximate root is then given by r ~p(0). For a concrete case, let the table of known values be Y;-0.5789200,-0.3626370,-0.1849160,-0.0340642,0.0969858 X; 1.0 , 2.0 , 3.0 , 4.0 , 5.0 The nodes in this problem are the points in the row of the table headed y, and the function values being interpolated are in the x row. The resulting polynomial is p(Y)=0.25Y^4+1.2Y^3+3.69Y^2+7.39Y+4.247470086 and p(0)=4.247470086. Only the last coefficient is shown with all the digits carried in the calculation, for it is the only one needed for the problem at hand. ________________________________________________________________ 自分で計算しても、p(Y)=0.25Y^4+1.2Y^3+3.69Y^2+7.39Y+4.247470086 となりません(泣) 

  • 数値解析について

    数値解析について //配列d[0]からd[5]まですきな整数を //代入し、内容を小さい順に並べ替えよ // #include<stdio.h> #include<stdlib.h> int main(void) { ///配列の定義 int d[5]; int i; int j; int c; ///配列への数字の代入 d[0] = 3; d[1] = 20; d[2] = 5; d[3] = 9; d[4] = 2; d[5] = 40; ///ソート for(i=0;i<6;++i) { for(j=i;j<6;++j) { ///比較 if( d[i]>d[j] ) { c = d[i]; d[i] = d[j]; d[j] = c; } } } ///結果の表示 for(i=0;i<6;++i) { printf("no %d = %d \n", i+1, d[i]); } } をコンパイルして実効したんですが、なんか配列がちゃんとなりません。どこが間違っているでしょうか? また、 ///ソート for(i=0;i<6;++i) { for(j=i;j<6;++j) { ///比較 if( d[i]>d[j] ) { c = d[i]; d[i] = d[j]; d[j] = c; } } } の部分がどのようにコンピュータで処理されているのか分りません。どのような順番でiとかjが変っていきc = d[i]; d[i] = d[j]; d[j] = c;がどうやって代入を繰り返していっているのか教えてください。すごく長くなりそうですが、できればどうやってループして代入などを繰り返していっているのかコンピュータがやっている全部の過程(ソートと比較の部分です)を教えてください。自分は頭悪いんでどうやっていいか分らなくて混乱しています。 また、コンパイルして実効した時に printf("no %d = %d \n", i+1, d[i]); の部分はどのように表示されるんでしょうか? あと、なんでd[0]~d[4]までは定義しないんでしょうか? お願いします。

  • 光物性教科書(英語)の境界条件が理解できません

    電磁波が媒質1から媒質2に入射するときの境界条件について書かれていると思うのですが, どのようなことが起こっているのかがイメージできません. 教科書には以下のように書かれているのですが,この性質は日本語ではなんと呼ばれるものなのでしょうか? When waves are incident from one medium upon another then one would expect some quantities to be continuous across the boundary. These are the tangential components of the electric and magnetic fields and the normal components of the electric and magnetic flux densities. If H1,E1 are the fields in medium1 of material constants μ1,ε1, and H2,E2,μ2,ε2 are the corresponding quantities in medium2 then the conditions in mathematical form are H1t = H2t E1t = E2t ε1E1n = ε2E2n μ1H1n = μ2H2n t and n stand for the tangential and normal components. 何故,電場と磁場は接線成分で,電束密度と磁束密度は法線成分となっているのかも分からないので教えてください. そもそも接線成分と法線成分というのは何に対して考えられている量なのかも出来ればお願いします.

  • コンピュータのプログラムに内容。

    こんにちは。 数学で数値解析を研究していて、Coefというのプログラムの中に、「for i=n to j step -1 do 」とあったのですが、stepとはどのように捉えればよいのでしょうか??

  • 数値解析に関する質問です。

    /*kadai8 Euler’s Method for Ordinary Differential Equation */ #include <stdio.h> void euler(double *, double *); main () { int i; double v,t,tt,dt[5]; dt[0] = 2; dt[1] = 1; dt[2] = 0.1; dt[3] = 0.01; dt[4] = 0.001; printf("Program of Euler`s Method 1\n"); printf("-----------------------------------------\n"); tt = 50.0/9.80665; printf("Theoretical Solution : %lfs\n",tt); for(i=0;i<=4;i++){ printf("--------------------------------\n"); printf("Step Size : %lf s\n",dt[i]); v=50.0; t=0.0; while(v>0) { euler(&v,&dt[i]); t=t+dt[i]; } printf("Numerical Solution : %lf s\n",t); printf("Error : %lf s\n",t-tt); } return(0); } /*--------------*/ void euler(double *v,double *dt) { *v=*v + (*dt )*(-9.80665); } 以上のプログラムで関数eulerの引数にポインタがついているのはなぜか,またポインタを使用しない方法はないか?また、オイラー法より精度の高い解法はありますか? よろしくお願いします。

  • 代数学・群の英文での問題!!

    Let G be a group, and H a subset of G. We shall say that H is a subgroup if it contains the unit element, and if, whenever x,y∈H, then xy and x^(-1) are also elements of H. (Additively, we write x+y∈H and -x∈H.) Then H is itself a group in its own right, the law of composition in H being the same as that in G. The unit element of G constitutes a subgroup, and G is a subgroup of itself. ※ x^(-1)はxの逆元 という問題があります。 G:群,H:Gの部分群 部分群は x,y∈H ⇒ xy∈H かつx^(-1)∈H が成り立つ。 加法の時はx+y∈H, -x∈Hである。 までは自分で訳せました。でも、Thenからよく分かりません。 合成の方法が同じ?それ自身の部分群?とか変な訳になってしまいます。 ここまでの訳があっているか、Then以下はどう訳すか 分かる方教えてください!!お願いします!!