#include"iostream.

h"
#include"conio.h"
#include"stdio.h"
#include"math.h"
int main()
{
double a1=0,b1=0,c1=0;
double temp=0, d1=0;
double yp=0,xp=0,mp=0,Cp=0;
double Xe1=0,Ye1=0,Xe2=0,mg=0,Cg=0;
double xe1=0,xe2=0,a=0,b=0,xqm=0,yqm=0,mqm=0,cqm=0,aqm=0,bqm=0,Iq=0,Iqy=0;
double nc=0,nf=0,i=0,cqm1=0,aqm1 =0,bqm1 = 0,Yn =0,deln =0,Rn =0,beta = 0,bn = 0
,qn=0,n=0,decl=0;
double xdn=0,ydn=0,mdn=0,Cd=0;
double decls=0,xds=0,yds=0,mds=0,Cds=0,S=0;
cout<<"\n Enter yp value";
cin>>yp;
//******************************************************************************
**********
yp = 1.43287; //y-ordinate of point Pn (main factor to change the size)
xp = 2*yp; //y-coordinate of point Pn
mp = 1/(2*xp); //slope of point Pn
Cp = yp-mp*pow(xp,2); //y-intercept of point Pn
//YP = mp*x^2 + Cp; general equation of parabola
//disp(['Yp = ' num2str(mp) ' * x^2 ' num2str(+ Cp) ]);
cout<<"\nYp = "<<mp<<"*x^2+ ("<<Cp<<")";
Xe1 = 1.32387*yp/1.43287; //x-coordinate of point E1
Ye1 = .30578*yp/1.43287; //y-coordinate of point E2
Xe2 = 4.06387*yp/1.43287; //x-coordinate of point E2
mg = 0.94; //slope of the cutting section of the reflector frame
Cg = Ye1-mg*Xe1; //y-intercept of the cutting section of the reflector frame
//Yg = mg * x + Cg; //equation of the cutting section of the reflector frame
//disp(['Yg = ' num2str(mg) ' * x ' num2str(+ Cg) ]);
cout<<"\nYg = "<<mg<<"*x+ ("<<Cg<<")";
//******************************************************************************
**********
a1=mg/(2*mp);
b1=(Cp-Cg)/mp;
c1=pow(a1,2)-b1;
xe1 = a1+pow(c1,0.5);
a1=0,b1=0,c1=0;
a1=mg/(2*mp);
b1=(Cp-Cg)/mp;
c1=pow(a1,2)-b1;
xe2 = a1-pow(c1,0.5);
a1=0,b1=0,c1=0;
a1=mg/(2*mp);
b1=(Cp-Cg)/mp;
c1=pow(a1,2)-b1;

//****************************************************************************** ********** nc = b/0.06377.2). //semi.23). Rn = (a1+b1)/(2*deln). } cout<<"qn ="<<mqm<<"*x+ "<<cqm. //semi major axis of ith crossbar a1=0.c1=0. //angle of ith crossbar bn = 2*Rn*beta*3. a1=pow(b.14/180. //semi-major axis of the ellipse xqm yqm mqm cqm = = = = (Xe1+Xe2)/2.0.77). //half crossbar of ith crossbar //disp(['Q' num2str(i) '= ' num2str(mqm) ' * x ' num2str(cqm1) ]). //distance between consecutive crossbars Iqy = Iq/0.48.c1=0. d1=pow(c1.b1=0. aqm = pow(c1.b1=0. aqm1 = pow(c1.minor axis of the middle crossbar bqm = aqm/0. temp=i*Iq.2).b1=0. of crossbars required nf = floor(nc).i++) { cqm1 = cqm + i * Iqy.5). b1=pow(Yn. //y-coordinate of the middle crossbar -1.b1=0.6849. c1=pow(a1. //x-cordinate of the middle crossbar mg*xqm+Cg.major axis of the middle crossbar Iq = 0. a1=mqm/(2*mp). //semi. //y-intercept of ith crossbar a1=0.2)-b1. c1=pow(a1.c1=0. b1=pow(Yn.23)*pow(c1.2). //radius of nth crossbar beta = 180/3.2). b1=(Cp-cqm)/mp. //slope of the middle crossbar yqm-xqm*mqm.5). //no. deln = (aqm1-d1)/cos(46. c1=a1-b1. c1=a1-b1.0.c1=0. d1=0.2)-b1.0.2).5).14*asin(Yn/Rn). //semi minor axis of ith crossbar bqm1 = aqm1/. a1=pow(aqm1. //y-intercept of the middle crossbar a1=0. b1=pow(temp. //reflector depth for ith crossbar a1=0. a1=pow(deln.i<=nf. b1=(Cp-cqm)/mp. for (i=-nf. a1=mqm/(2*mp). cout<<"\n"<<"Q"<<i<<" = "<<mqm<<"*x ("<<cqm1<<")".0.5).a = pow(c1.b1=0.0. //semi-minor axis of the ellipse b = a/cos(43.2). a1=0. Yn = cos(43.c1=0.48.6849. .5).6849.

69338*yp/1. //****************************************************************************** ********** //For southern hemisphere decls = -decl.26569-1. cout<<"\n"<<"Yn = "<<mdn<<"*x +("<<Cd<<")".006918-0.43287)*cos(decls)+1.43287-1.399912*cos(2*3. //solpe of seasonal equation Cd =ydn-(mdn)*pow(xdn.00148*sin(3*(2*3. //n = 110. cin>>n. //y-intercept on nth day of the equation //disp(['Yn = ' num2str(mdn) ' * x ' num2str(+ Cd) ]). //y-coordinate f or the seasonal equation mds = tan(43.69338* sin(decl)+(1.070257*sin(2*3. cout<<"\n"<<"Yg = "<<mg<<"*x + ("<<Cg<<")".002697*cos(3*(2*3.43287)*sin(decl).43287.14/3 65*(n-1))-0.006758*cos(2*(2*3.2)*3. cout<<"\n"<<"Yp = "<<mp<<"*x + ("<<Cp<<")".26569*yp/1.43287-1. //surface area of the Scheffler reflector cout<<"\nCollector Area ="<<S. //y-coordinate for the seasonal equation mdn = tan(43. //disp(['Ys = ' num2str(mds) ' * x ' num2str(+ Cds) ]).14*(0.no. } .2).43287)*cos(decl)+1. //disp(['Yg = ' num2str(mg) ' * x ' num2str( Cg) ]) //disp(['Yg = ' num2str(mp) ' * x ' num2str( Cp) ]) S = pow(yp. / /x-coordinate for the seasonal equation yds = 2.94.26569-1. //Y-intercept on nth day of the equation cout<<"\n"<<"Ys = "<<mds<<"*x + ("<<Cds<<")".14/365*(n-1))) + 0.26569*yp/1.69338* sin(decls)+(1.2). //sol ar declination on nth day of the year //****************************************************************************** ********** //For northern hemisphere xdn = (2. xds = (2. //slope of seasonal equation Cds = yds-(mds)*pow(xds.43287)*cos(decl)-(1.14/365*(n-1)))).14/365*(n-1)) )-0.223+ decl/2)/(2*xdn).43287)*cos(decls)-(1.14/365*(n-1))) + 0. of day of the year decl = 180/3.69338*yp/1.14/365*(n-1)) + 0.43287)*sin(decls).cout<<"\n Enter no of day of the year value".223+ decls/2)/(2*xds). getch ().000907*sin(2*(2*3. //x -coordinate for the seasonal equation ydn = 2.43287.