Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write C programs for the following: 1. When a heat source is placed at r=0 at t=0 in an infinitely extended bar, the temperature distribution
Write C programs for the following: 1. When a heat source is placed at r=0 at t=0 in an infinitely extended bar, the temperature distribution at (x, t) is expressed as exp(-x+1(41)) T(X, 1) = 2/ Using GnuPlot, 1. Plot the temperature profile at 10.1, 0.5, 1.0, 10.0 in a series of graphs using GnuPlot's plot command, -1 1 2 but in four plots, not an 2. Submit a printed copy of each graph for a total of four graphs. The results should look like -2 animated gif like this one. 2. Pretending that the cosine function, cos(x), is not available in the compiler, create your own cos(x) using cos(x)=1.2 *4 to 2! 4! 6! and demonstrate your program by making a table as: x mycos(x) cos(x) 10.00 1.000 1.000 0.1 1.101 |1.105 1.308 || 1.221 1.0 1.69 1.781 where mycos(x) is from your program and cos (x) is the C-supplied function in math.h. Note: 1. The values above are false. 2. The following is the general form of cos (x). cos(x) = (-1) 221. (2 i)! izo 3. Take first 10 terms for the series. Template: #include #include int factorial (int n) (your code here) float mycos (float x) { float sum=0; int i; for (i=0;i int main() (no space)"); int a,b,c,d, den, num; printf ("Enter two fractions in a/b+c/d scanf("%d/%d+%d/%d", &a, &b, &c, &d); den=....; num=...; printf("The sum is %d/%d. ", ..,..); return 0; Write C programs for the following: 1. When a heat source is placed at r=0 at t=0 in an infinitely extended bar, the temperature distribution at (x, t) is expressed as exp(-x+1(41)) T(X, 1) = 2/ Using GnuPlot, 1. Plot the temperature profile at 10.1, 0.5, 1.0, 10.0 in a series of graphs using GnuPlot's plot command, -1 1 2 but in four plots, not an 2. Submit a printed copy of each graph for a total of four graphs. The results should look like -2 animated gif like this one. 2. Pretending that the cosine function, cos(x), is not available in the compiler, create your own cos(x) using cos(x)=1.2 *4 to 2! 4! 6! and demonstrate your program by making a table as: x mycos(x) cos(x) 10.00 1.000 1.000 0.1 1.101 |1.105 1.308 || 1.221 1.0 1.69 1.781 where mycos(x) is from your program and cos (x) is the C-supplied function in math.h. Note: 1. The values above are false. 2. The following is the general form of cos (x). cos(x) = (-1) 221. (2 i)! izo 3. Take first 10 terms for the series. Template: #include #include int factorial (int n) (your code here) float mycos (float x) { float sum=0; int i; for (i=0;i int main() (no space)"); int a,b,c,d, den, num; printf ("Enter two fractions in a/b+c/d scanf("%d/%d+%d/%d", &a, &b, &c, &d); den=....; num=...; printf("The sum is %d/%d. ", ..,..); return 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started