bimbo36 Posted November 6, 2015 Posted November 6, 2015 i have lot of doubts regarding polynomials and numerical method .. can someone help me understand some basics of it ... ? how do i dissassemble this sofa of polynomial properly ? and how does numerical method help ? can i have an example of a simple problem where i can utilize numerical method ???
studiot Posted November 6, 2015 Posted November 6, 2015 (edited) I don't know what you don't understand about numerical methods, you will need to explain further. Which methods? Here is a spreadsheet showing the effect of a recursive numerical method using the formula [math]{X_{n + 1}} = \frac{1}{{12}}\left( {X_n^2 - 28} \right)[/math] seeding the Xn from -5 to +15. As can be seen this rapidly converges on the -2 solution, but not on the +14 one. Edited November 6, 2015 by studiot
bimbo36 Posted November 6, 2015 Author Posted November 6, 2015 Numerical Methods and errors Interpolation Numerical Differentiation Numerical Integration Solution of Algebraic and Transcendental Equations Numerical Solution of a system of Linear Equations Numerical Solution of Ordinary differential equations Curve fitting Numerical Solution of problems associated with Partial Differential Equations we had that much amount of stuffs to study .. there are many stuffs i dont understand about all those ... i am trying to find the simplest from it to work with examples ... i think ... Solution of Algebraic and Transcendental Equations Numerical Solution of a system of Linear Equations i have no idea , which one is simplest among those two to look for an example ... does those two only deal with polynomials of degree one ?? even if it is only dealing with polynomials of degree one , how does an example look like .. ?? and what am i trying to solve ? what is this interval they all speak of ... and what increments or dicrements in these problems ? the co eficients ? the degree of the polynomial ?
studiot Posted November 6, 2015 Posted November 6, 2015 I am guessing you have just started a course in numerical methods and have found it all very different from anything you have seen before? You are right to try to find examples where you can compare results with what you can find by other methods. Other methods usually mean what are known as closed form solution that you can extract a formula which will give you the 'absolutely' correct answer. But even then working this out may take more effort than finding the answer by a numerical proceedure.Y You have provided an example, how about we work through my solution, picking out the essential points of numerical methods, as I suggested above?H Have you found the two solutions to your quadratic by formula?
bimbo36 Posted November 6, 2015 Author Posted November 6, 2015 let me start with the very basics itself ... "Solving" means finding the "roots" ...... a "root" (or "zero") is where the function is equal to zero:How do we solve polynomials? That depends on the Degree!The first step in solving a polynomial is to find its degree.The Degree of a Polynomial with one variable is ...... the largest exponent of that variable.polynomialWhen we know the degree we can also give the polynomial a name:Degree Name Example0 Constant 71 Linear 4x+32 Quadratic x2−3x+23 Cubic 2x3−5x24 Quartic x4+3x−2 this is therefore a quadratic equation ... i actually took this example from youtube , to make sure ... this problem has a proper solution ... anyway , this is how you usually solve a polynomial .. right ? https://www.youtube.com/watch?v=g7_llQnLepA x = 14 and x= -2 is the answer ... how else would i solve this ?? where would i apply the numerical methods on this one ??
studiot Posted November 6, 2015 Posted November 6, 2015 (edited) x = 14 and x= -2 is the answer ... how else would i solve this ?? First, and I cannot stress the importance of this enough. You have exact solutions in this case. Numerical methods are all about the real world. In the real world your equation is likely to be presented something like 1.0057X2 - 11.993725689X - 28.000000007 = 0 and you are not sure about the last few digits of any of the coefficients. This is where you will use numerical methods to get not an exact answer but an answer that is good enough. Back to the example, please note that this forum allows the use of superscript and subscript (you will find them on the second row of the toolbar) to better present mathematics. Your equation is 1X2 - 12X- 28 = 0 rearrange 12X = X2 -28 X = (X2 -28) / 12 Now look back at the formula I presented in post 2 We have a formula for X, but it is in terms of X. If we take a 'guess' for X and insert it into this formula we can calculate another value of X. If we take this new value of X and insert it into the formula we can calculate yet another value for X and so on. The hope is that each 'iteration' (=approximation) will get better than the last and the calculations will converge on the correct answer. That is why this is called the recursiv.e or iterative method. I have shown the results of doing this in the spreadsheet. Have you any experience with spreadsheets? Edited November 6, 2015 by studiot
fiveworlds Posted November 6, 2015 Posted November 6, 2015 (edited) how else would i solve this ?? Using the generalized quadratic formula for polynomials of degree 2. [latex]ax+bx+c[/latex] [latex]x^2-12x-28[/latex] Sub the values for the variables into the generalized quadratic formula [latex]\frac{12\pm \sqrt{-12^{2}-4(1)(-28)}}{2(1)}[/latex] [latex]\frac{12\pm 16}{2}[/latex] Finding the roots. [latex]\frac{28}{2}=14[/latex] [latex]\frac{-4}{2}=-2[/latex] anyway , this is how you usually solve a polynomial .. right ? No it is useless if the quadratic has complex roots like this one X^2-5x+25. Edited November 6, 2015 by fiveworlds
bimbo36 Posted November 7, 2015 Author Posted November 7, 2015 First, and I cannot stress the importance of this enough. You have exact solutions in this case. Numerical methods are all about the real world. In the real world your equation is likely to be presented something like 1.0057X2 - 11.993725689X - 28.000000007 = 0 and you are not sure about the last few digits of any of the coefficients. This is where you will use numerical methods to get not an exact answer but an answer that is good enough. Back to the example, please note that this forum allows the use of superscript and subscript (you will find them on the second row of the toolbar) to better present mathematics. Your equation is 1X2 - 12X- 28 = 0 rearrange 12X = X2 -28 X = (X2 -28) / 12 Now look back at the formula I presented in post 2 We have a formula for X, but it is in terms of X. If we take a 'guess' for X and insert it into this formula we can calculate another value of X. If we take this new value of X and insert it into the formula we can calculate yet another value for X and so on. The hope is that each 'iteration' (=approximation) will get better than the last and the calculations will converge on the correct answer. That is why this is called the recursiv.e or iterative method. I have shown the results of doing this in the spreadsheet. Have you any experience with spreadsheets? thanks a lot ... this has to be the best explanation i have ever read so far ... all of this makes a bit more sense right now ... even the books i read were very confusing , so was some websites i went through ... none of them had proper simple examples ... my text book was called computer oriented numerical method ... it had computer programs dealing with polynomial numerical methods ... but it was lacking good example questions ... so i had a very hard time understanding all those.... i have little experience using excel sheet ... i can do table , autosum and little things like that in it .. at this point i dont know if it is capable of doing advanced maths on its tables .... anyway i have to re read everything when i get more free time ... Using the generalized quadratic formula for polynomials of degree 2. [latex]ax+bx+c[/latex] [latex]x^2-12x-28[/latex] Sub the values for the variables into the generalized quadratic formula [latex]\frac{12\pm \sqrt{-12^{2}-4(1)(-28)}}{2(1)}[/latex] [latex]\frac{12\pm 16}{2}[/latex] Finding the roots. [latex]\frac{28}{2}=14[/latex] [latex]\frac{-4}{2}=-2[/latex] No it is useless if the quadratic has complex roots like this one X^2-5x+25. you mean numerical method is useless if the quadratic has complex roots ???
studiot Posted November 7, 2015 Posted November 7, 2015 (edited) I'm glad you found this helpful. It seems to be the season for starting numerical methods courses. See here for information about some of the other numerical topics you listed. http://mathhelpforum.com/higher-math/252777-approximation-function-vs-interpolation-function.html and here http://mymathforum.com/math/252860-square-root.html The point about the spreadsheet is that it provides a quick and easy way to play with formulae. Another (teaching) webiste for this is https://www.geogebra.org/ This allows graphics, formulae and spreadsheets very simply and is open source which means it is freeware. I cannot tell you everything in one single post but I do ask a few questions designed to lead to the next one so please answer them if you can. Your example can demonstrate considerably more about the important points in numerical methods, if you wish to continue. The standard quadratic equation formula (which we are not supposed to be discussing here) works perfectly well for complex solutions. It's just that the solutions are well, complex numbers. Edited November 7, 2015 by studiot
fiveworlds Posted November 7, 2015 Posted November 7, 2015 (edited) you mean numerical method is useless if the quadratic has complex roots ??? Not always sometimes you can reason through it for instance find the roots of x^3+16x where y=0 Other times you'll wreck your head trying to figure them out. Edited November 7, 2015 by fiveworlds
bimbo36 Posted November 8, 2015 Author Posted November 8, 2015 (edited) i found this book online ... a graduate introduction to numerical methods ... let me see if i can focus on simple polynomials , to try to and solve a few questions .. or atleast try to understand them properly ... in it ... Polynomials and Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.1 Polynomials, Their Bases, and Their Roots . . . . . . . . . . . . . . . . . . . . 442.1.1 Change of Polynomial Bases . . . . . . . . . . . . . . . . . . . . . . . . . 462.1.2 Operations on Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . 472.2 Examples of Polynomial Bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.2.1 Shifted Monomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.2.2 The Newton Basis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522.2.3 Chebyshev Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532.2.4 Other Orthogonal Polynomials . . . . . . . . . . . . . . . . . . . . . . . . 552.2.5 The Clenshaw Algorithm for Evaluating PolynomialsExpressed in Orthogonal Bases . . . . . . . . . . . . . . . . . . . . . . . 562.2.6 Lagrange Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582.2.7 Bernstein–B´ezier Polynomials . . . . . . . . . . . . . . . . . . . . . . . . 622.3 Condition Number for the Evaluation of Polynomials . . . . . . . . . . . 63 currently i am only familiar with .. polynomials , their degrees and their coefficients ... i have not come across a lot of books like these ones ... let me try to read its simple parts ... and see if it makes any sense to me ... changes of polynomial bases ... ?? i have to understand that change a bit ... i will spend my free time in understanding the polynomials ... so that sometime in the future i can try one or two examples like that mentioned above ..... thanks ... Edited November 8, 2015 by bimbo36
studiot Posted November 8, 2015 Posted November 8, 2015 A graduate introduction..... ???? Have you studied linear algebra and in particular do you know what a basis is ?
bimbo36 Posted November 8, 2015 Author Posted November 8, 2015 (edited) "Solving" means finding the "roots" ... ... a "root" (or "zero") is where the function is equal to zero: How do we solve polynomials? That depends on the Degree! The first step in solving a polynomial is to find its degree. The Degree of a Polynomial with one variable is ... ... the largest exponent of that variable. polynomial When we know the degree we can also give the polynomial a name: Degree Name Example 0 Constant 7 1 Linear 4x+3 2 Quadratic x2−3x+2 3 Cubic 2x3−5x2 4 Quartic x4+3x−2 a polynomial with degree one ? isnt that what is called by linear algebra ??? i am only familiar with the degree and coefficients in a polynomial ... no , i am not familiar with the term base ... Edited November 8, 2015 by bimbo36
studiot Posted November 8, 2015 Posted November 8, 2015 a polynomial with degree one ? isnt that what is called by linear algebra ??? No it is a much much much wider subject than that. Most mathematics is linear, and the first approach to any non linear maths is to try to linearise it (=find a linear approximation). You really need to find out and understand what linear maths is. I do not mean study all its ins and outs, that would take years, just find out enough to recognise what is linear and what is not and to appreciate the principle consequences of that distinction. The following polynomical falls into the ambit of linear maths y = ax6 + bx5 + cx4 + dx3 + ex2 + fx because it is a linear combination of basis polynomials x6, x5, x4, x3, x2 x. this polynomial does not (is non linear) y = x + xy Note the word is basis not base. Detail is important in mathematics.
bimbo36 Posted November 8, 2015 Author Posted November 8, 2015 (edited) linear maths ?? ok .. i never thought something which had a linear polynomial would end up so complicated ... in my understanding ... i was classyfying all these to .. linear polynomial ... a polynomial of degree one .. non linear polynomials ... polynomials greater than degree one .. quadratic ... cubic ... and quartic .... ( and being able to solve them through factoring and indetities ) in my mind , the advanced maths meant ... functions .. differentiation ...intergrations ... isnt all this .. related to graphs ??? the linear ... the non linear plolynomials??? the complex numbers ?? the differentiation ?? integration ??? sorry for going off topic too much ... but these are all the things running through my head right now .... Edited November 8, 2015 by bimbo36
bimbo36 Posted November 9, 2015 Author Posted November 9, 2015 No it is a much much much wider subject than that. Most mathematics is linear, and the first approach to any non linear maths is to try to linearise it (=find a linear approximation). You really need to find out and understand what linear maths is. I do not mean study all its ins and outs, that would take years, just find out enough to recognise what is linear and what is not and to appreciate the principle consequences of that distinction. The following polynomical falls into the ambit of linear maths y = ax6 + bx5 + cx4 + dx3 + ex2 + fx because it is a linear combination of basis polynomials x6, x5, x4, x3, x2 x. this polynomial does not (is non linear) y = x + xy Note the word is basis not base. Detail is important in mathematics. does this one have a graph like this ?? does the word basis has something to do with the propogation with an interval ??
bimbo36 Posted November 13, 2015 Author Posted November 13, 2015 i found a book online ... which explains a lot about what i was looking for ... http://www.statsci.org/webguide/smyth/pubs/EoB/bap064-.pdf this is something i found when i searched Polynomial Approximation , in google Polynomials are just about the simplest mathematical functions that exist, requiring only multiplications and additions for their evaluation. Yet they also have the flexibility to represent very general nonlinear relationships. Approximation of more complicated functions by poly- nomials is a basic building block for a great many numerical techniques A polynomial is a function that can be written in the form p(x) = c 0 + c 1 x +···+ c n x n , for some coefficients c 0 ,...,c n .If c n = 0, then the polynomial is said to be of order n . A first-order (linear) polynomial is just the equation of a straight line, while a second-order (quadratic) polynomial describes a parabola can somebody tell me , where to from here ??
studiot Posted November 13, 2015 Posted November 13, 2015 can somebody tell me , where to from here ?? Beware of jumping ahead too quickly or you will find yourself increasingly tangled up. I identified that you misunderstand the word linear ( a very common misunderstanding, shared with the author of your last reference). A function, f(x), (including polynomials) is linear if and only if 1) For any x1 and x2 f(x1 + x2) = f(x1) + f(x2) 2) For any x and any coefficient a af(x) = f(ax) Try this with f(x) = 1+x and see if it works. You will find it does not. f(x) = 1 + x is called affine not linear. If you add the constant to a polynomial it changes things. I did suggest you need to look at linear mathematics and also offered some links about basic terms in numerical mathematics. Did you look at them?
bimbo36 Posted November 14, 2015 Author Posted November 14, 2015 (edited) its the amount of terms , that is currently confusing me ... it does not seem to end ... sorry i feel very new to numerical methods .. even though we had this subject in college , along with computer programs in c ... let me change a few things , in your reply ... so that it makes a little bit more sense to me ... for my understanding .... Beware of jumping ahead too quickly or you will find yourself increasingly tangled up. I identified that you misunderstand the word linear ( a very common misunderstanding, shared with the author of your last reference). A function, p(x), (including polynomials) is linear if and only if 1) For any x1 and x2 p(x1 + x2) = p(x1) + f(x2) 2) For any x and any coefficient a ap(x) = p(ax) Try this with p(x) = 1+x and see if it works. You will find it does not. p(x) = 1 + x is called affine not linear. If you add the constant to a polynomial it changes things. I did suggest you need to look at linear mathematics and also offered some links about basic terms in numerical mathematics. Did you look at them? i had to refresh a lot of terms ... to understand this one ... including terms like ... monomial binomial trinomial polynomial degree coeficients linear quadratic cubic quartic ... base , now more stuffs ... is this learning of terms ever going to end ? sorry i am a noob .. how does a simple question look like ? i have seen polynomial coefficients arranged into matrix equations for solving purposes ... i dont remember what it was called now ... because i dont have that book with me right now ... i might have to collect it from someone else .... Consider height as a function of age for 318 girls who were seen in a disease study [6] in East Boston in 1980 (Figure 2). Height might be described roughly by a straight line over a short range of ages – say, ages 5 – 10 – but over wider age ranges a more general function is needed. We initially fit a sixth-order polynomial with the intention of decreasing the order later if a simpler polynomial is found to fit just as well. This leads to a multiple linear regression problem for the coefficients β 0 ,...,β 6 , in which the design matrix is y i ≈ β 0 + β 1 x i + β 2 x 2 i + β 3 x 3 i + β 4 x 4 i + β 5 x 5 i + β 6 x 6 i + ε i , this conversation is helping by the way ... even though i keep getting lost .... Edited November 14, 2015 by bimbo36
studiot Posted November 14, 2015 Posted November 14, 2015 (edited) Yes most technical subjects have a plethora of jargon and abbreviations to make thing easier for the experienced and harder for the beginner. How did you get on with my link to extrapolation, interpolation, collocation and stuff? Edited November 14, 2015 by studiot
bimbo36 Posted November 14, 2015 Author Posted November 14, 2015 yea , i read that .. still a bit difficult for me to grasp everything written in it .. the pdf book has some simpler explanations ... for example ... Suppose that the function to be approximated, f(x) , is observed at a series of values x 1 ,...,x N . In general, we will observe y i = f(x i ) + ε i ,wherethe ε i are unknown errors. The task is to estimate f(x) for new values of x . If the new x is within the range of the observed abscissae, then the problem is interpolation . If it is outside, then the problem is extrapolation . Polynomials are useful for interpolation, but notoriously poor at extrapolation right now am not sure how many methods there are for polynomial approximations ... i just googled " methods of polynomial approximation " .. and found this site ... http://ads.harvard.edu/books/1990fnmd.book/ the numerical methods for linear equations and matrices We saw in the previous chapter that linear equations play an important role in transformation theory and that these equations could be simply expressed in terms of matrices However, this is only a small segment of the importance of linear equations and matrix theory to the mathematical description of the physical world. Thus we should begi n our study of numerical methods with a description of methods for manipulating matrices and solving syst ems of linear equations. However, before we begin any discussion of numerical methods, we must say something about the accuracy to which those calculations can be made. isnt this a bit like the noob friendly part of the polynomials and numerical method ??? i am not that familiar with other methods ...
studiot Posted November 14, 2015 Posted November 14, 2015 (edited) yea , i read that .. still a bit difficult for me to grasp everything written in it .. I am suprised that you found the formalism expressed in the Harvard pdf simpler than the question and answer expressed below. Currently at collage we are using approximation and interpolation functions, but I cannot really understand what is the difference between them. Can someone please explain to me the difference and when to use one instead of the other? Any help would be appreciated. What johnsomeone has described as an interpolating function is better called a collocating function. A collocating ( = co - locating) function matches the values of a given function exactly at specified points. An interpolating function provides a means of obtaining values of some function between known values. The exact function and its values will be known at specified points. For example you may have a table of sines tabulated at 1 degree intervals and use an interpolating function (which is not a sine) to obtain the values at half degree points. A collocating function (polynomial) may often be used for this purpose. An extrapolating function is similar to interpolating functions, except that it finds values beyond known ones. For example your table of sines may only extend to 30 degrees and you need to find the sine of 44 degrees. Finally an approximating function is a much more general term and used where you perhaps do not have a table of the correct function, or the ability to calculate it. However you can derive some other function that you can prove is never further from the real one than some criterion, That is Vfunction - Vapprox < e over the entire range of interest For example we use Theta = sin(theta) = tan(theta) for small angles as approximating functions. Vfunction may never actually equal Vapprox at any point in the range of interest. Through this thread I have noticed something (this is an observation, not a criticism). That you seem to concentrate on and work from abtract theory and the most general to the particular. So all the references and quotes you are bringing up are about abstract theorisation and generalities. Numerical methods is basically the one part of mathematics that works the other way round. The whole raison d'etre for numerical methods is to obtain an answer, by any trick in or out of the book. If you can later generalise this to more situations so much the better. You originally asked about numerical methods for solving (= finding the roots of) polynomials and provided an example for discussion. This was a good idea as we began to explore the application of numerical methods to a problem we could readily solve exactly by applying a formula. Comparison with the known is always a good way to explore new techniques. Somehow that discussion became diverted before that exploration was anywhere near complete. in particular we did not look at why the numerical method I offered would produce one root but not the other one, or how to ensure we get to both roots or at least to the one we want. Working through that traditionally provides invaluable experience in the study of numerical methods. But we got diverted to generalisations. I suggest you need some hands on experience as to what happens when we try to use particular polynomials in particular circumstances which will show why there are so many different techniques available. I will try to post some sketches which will answer, explore and illustrate bothe these questions and the comments made in your quotes above, if this is of interest? Polynomials are useful for interpolation, but notoriously poor at extrapolation However, this is only a small segment of the importance of linear equations and matrix theory to the mathematical description of the physical world. Thus we should begi n our study of numerical methods with a description of methods for manipulating matrices and solving syst ems of linear equations. However, before we begin any discussion of numerical methods, we must say something about the accuracy to which those calculations can be made. The second quote seems to echo much of what I have said, (or been trying to say). Edited November 14, 2015 by studiot 2
bimbo36 Posted November 14, 2015 Author Posted November 14, 2015 (edited) actually the subject i was following was called computer oriented numerical method ... with some examples of c programming language trying to solve some methods of numerical methods ... there was lots of different types of numerical methods in it ... like newton raphson method , bisection method ...secant method ...regula falsi method ...mullers method ..horners method ...trapezoidal formula ..trapezoidal rule ... etc etc ... and in the end i am supposed to write computer programs for it in C language ... which was and still is a difficult task for me ... but it also had this one ... We saw in the previous chapter that linear equations play an important role in transformation theory and that these equations could be simply expressed in terms of matrices However, this is only a small segment of the importance of linear equations and matrix theory to the mathematical description of the physical world. Thus we should begin our study of numerical methods with a description of methods for manipulating matrices and solving systems of linear equations. However, before we begin any discussion of numerical methods, we must say something about the accuracy to which those calculations can be made. but it also had these ones,with matrix operations ... which looked like a bit more easier ones to put it into computer programs in C ... which is what i was looking for ... the simpler ones ... the rest seems like a mess ... anyway thanks a lot for taking the time to reply ... its this part from that website where i will be focusing on ... http://ads.harvard.edu/books/1990fnmd.book/chapt2.pdf The Numerical Methods for Linear Equations and Matrices We saw in the previous chapter that linear equations play an important role in transformation theory and that these equations could be simply expressed in terms of matrices However, this is only a small segment of the importance of linear equations and matrix theory to the mathematical description of the physical world. Thus we should begin our study of numerical methods with a description of methods for manipulating matrices and solving systems of linear equations. However, before we begin any discussion of numerical methods, we must say something about the accuracy to which those calculations can be made. because i think without much difficulty , this part can be made into a program in C ... Edited November 14, 2015 by bimbo36
studiot Posted November 14, 2015 Posted November 14, 2015 (edited) I really don't know what to make of this last response. Are you moving away from polynomials? The fixed point methods referred to on page 22 of your latest link is a posh name for the method I offered back in post2 to solve your original example. The classic reference work for what you have just outlined (it contains all the programs you could possibly want as the authors set out to code every numerical technique in an encyclopaedic fashion) is Numerical Recipes Flannery, Press, Teukolsky and Vetterling Cambridge University Press There are disks of the computer programs also available. Two books you might get for next to nothing since they are outdated (in Basic) Basic Numerical Methods Further Numerical Methods in Basic Both by R E Scraton They contain excellent presnetations of both the necessary underlying math theory and the computing theory needed to turn these into practical (Basic) coding. I'm sure that a competent C programmer could reuse these. There are many worked examples to act as benchmarks Edited November 14, 2015 by studiot
bimbo36 Posted November 15, 2015 Author Posted November 15, 2015 (edited) the problem was , back in the days ... programming was a bit hard ... especially trying to code something for numerical methods in c ... i had this book ... Numerical Recipes Flannery, Press, Teukolsky and Vetterling but i lost it , somehow ... i think i lost interest too ... since both the programming and the maths involved in it was hard ... noawadays , programming doesnt look that hard ... but the maths is ... this one for example ... this one with a little bit of effort and time ... can be turned into a program in C ... for example a matrix operation with c program ... i need to figure out how to turn a polynomial into a good matrix equation ... with its coefficients and all ... this will take a bit of time .... i think the coefficients becomes the elements of the matrix , in this case ... how to write c program to solve a system of linear equations http://www.slideshare.net/SendashPangambam/solvng-linear-equations-37190053 We saw in the previous chapter that linear equations play an important role in transformation theory and that these equations could be simply expressed in terms of matrices #include <stdio.h>int main(){float a[2][2], b[2][2], c[2][2];int i,j;printf("Enter the elements of 1st matrix\n");/* Reading two dimensional Array with the help of two for loop. If there was an array of 'n' dimension, 'n' numbers of loops are needed for inserting data to array.*/for(i=0;i<2;++i)for(j=0;j<2;++j){printf("Enter a%d%d: ",i+1,j+1);scanf("%f",&a[j]);}printf("Enter the elements of 2nd matrix\n");for(i=0;i<2;++i)for(j=0;j<2;++j){printf("Enter b%d%d: ",i+1,j+1);scanf("%f",&b[j]);}for(i=0;i<2;++i)for(j=0;j<2;++j){/* Writing the elements of multidimensional array using loop. */c[j]=a[j]+b[j]; /* Sum of corresponding elements of two arrays. */}printf("\nSum Of Matrix:");for(i=0;i<2;++i)for(j=0;j<2;++j){printf("%.1f\t",c[j]);if(j==1) /* To display matrix sum in order. */printf("\n");}return 0;} $ gcc inverse_matrix.c -o inverse_matrix$ ./inverse_matrixEnter the order of the Square Matrix : 3Enter the elements of 3X3 Matrix : 3 5 2 1 5 8 3 9 2The inverse of matrix is :0.704545 -0.090909 -0.340909-0.250000 -0.000000 0.2500000.068180 0.136364 -0.113636 let me see if i can focus on the ... The Numerical Methods for Linear Equations and Matrices anyway thanks again for the book recomendations... Edited November 15, 2015 by bimbo36
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now