Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Sample Output The rondon integer ts the randon snteper is: The rondon integer oo

ID: 3743837 • Letter: S

Question

Sample Output The rondon integer ts the randon snteper is: The rondon integer ookt's a skunk a skunk Don your le cerf Bonjour le cerf The rondon integer is: 6 integer is Sonjour le petit gocon The randon integer is: The randon integer i9 for each onin we greeted in French outrrel Ne greeted a total of a aninals (12 pts) Question 2: Scientific Calculations: Blackbody Radiation This program uses a header file named gsl const,_mksa.h containing numerous scientific constants. For example, here is the speed of light in MKSA units. definitions 1-3: The file uses header quards Calso called include guards during the compi le stage. appear ot the botton. The nane is given for free on the right. ) to prevent multiple Complete the header guards and give the final line that would GSL .CONST MKSA .GSL CONST MKSA - and then at the very bottom GSL.cONST MKSA/ Planck showed that the spectral radiance of a blackbody for wavelength 2 and absolute temperature T is given by the formula 2hc2 Happily, the physical constants h,c and k are in our header file. double h-GSL-COST NKSA-PLANCKS-CONSTANT..Hi // ptanck.s constant double cGSL.CONST.MKSASPEED-OF-LIGHT: double k GSLCONST MKSA. BOLTZMANN speed of light Boltizmann's constant

Explanation / Answer

Hi, please go threw code and output.

gsl_const_mksa.h

#ifndef __GSL_CONST_MKSA__
#define __GSL_CONST_MKSA__
#include <math.h>
#define GSL_CONST_MKSA_PLANCKS_CONSTANT_H 6.62607004*pow(10,-34)
#define GSL_CONST_MKSA_SPEED_OF_LIGHT 299792458
#define GSL_CONST_MKSA_BOLTZMANN 1.38064852*pow(10,-23)
#endif /* __GSL_CONST_MKSA__ */

spectral_rediation.c

#include <iostream>

#include <math.h>

#include "gsl_const_mksa.h"

using namespace std;

double h = GSL_CONST_MKSA_PLANCKS_CONSTANT_H; //Planck's constant

double c = GSL_CONST_MKSA_SPEED_OF_LIGHT; // speed of light

double k = GSL_CONST_MKSA_BOLTZMANN; //Blotzmann constant

double B(double lambda, double T) {

return (((2*h*pow(c,2))/pow(lambda,5))*(1/(exp((h*c)/(lambda*k*T))-1)));

}

double T_sun=5800; //temperature of the sun in degrees Kelvin

int main()

{

double b = B(500 * pow(10,-9), T_sun);

cout << "The value of b at 500 nanometers is: " << b;

double b_max = 0, lambda_max = 0;

for(int L=1 ; L <= 2000; L++){

double lambda = L*pow(10,-9);

double b = B(lambda, T_sun);

if (b > b_max)

b_max = b;

if (lambda > lambda_max)

lambda_max= lambda;

}// end of for loop

cout << endl << "The sun is brightest at the wavelength" << lambda_max*pow(10,9) << " nanometers" ;

cout << endl << "The value of b_max is: " << b_max << endl;

} //end of main

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote