29 Jun need help in coding
1. Matlab. Complete the quadratic equation solver yournameQuadEqn.m. See the comments at the top for specific directions, but the main idea is to avoid loss of significance by re-writing one of roots
.
· The formula for the root r1 has potential loss of significance when b > 0 and b2 > 4ac; The second root r2 is best left as is.
· The formula for the root r2 has potential loss of significance when b < 0 and b2 > 4ac. The first r1 is best left as is.
2. Write a C program for estimating adding numbers in a 2D grid. See the file yournameGridSum.c to get started. This program will exhibit the effect of cumulative rounding error (caused by adding a lot small values.) Consider an N × N grid (we’ll use N = 5000) dividing up the unit square into smaller squares. Therefore each subsquare has width w = 1/N. Let (xi,yj) denote the midpoint of the square in column i, row j. Note that
xi = (i − 0.5) ∗ w
Your job is to compute the double sum
N N
S = 3w2XX(xi)2 + (yj)2
j=1 i=1
For N large, the value of S should approach 2. You will compute S in two different ways: I. Summing up the numbers 1 by 1 in a nested for loop.
PSEUDOCODE
Initialize: width=1/N; sum1=0;
for loop: row=1 to N for loop: col=1 to N x = (col -0.5)*width y = (row – 0.5)*width sum1 = sum1 + (x*x + y*y)
end of inner loop
end of outer loop finalResult1= 3*width*width*sum1
II. Sum all the number in a row, then add to overall sum.
PSEUDOCODE
Initialize: sum2=0;
for loop: row=1 to N
rowSum=0; y= (row – 0.5)*width for loop: col=1 to N x = (col -0.5)*width rowSum = rowSum + (x*x + y*y)
end of inner loop sum2=sum2+ rowSum
end of outer loop finalResult2= 3*width*width*sum2
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
