Any Ideas How can I write this correctly?

2 views (last 30 days)
Ahmed Abo Sriea
Ahmed Abo Sriea on 29 Nov 2019
Commented: darova on 29 Nov 2019
can any one tell me how I can write this equation formula in matlab ?
I have tried writting the code myself but it keeps getting me double complex resuts !!
btw ( Theta ) is a set of angles.
and that was my code :
clear;
clc;
A=0.0106944*(theta-90);
a=4*(theta-85);
b=(cosd(theta)./cosd(85)).^a;
B=(1-0.254*b);
c=(theta./95.406).^(0.9775);
alpha=(A.*B)/(c-1);
  3 Comments
Ahmed Abo Sriea
Ahmed Abo Sriea on 29 Nov 2019
Edited: Ahmed Abo Sriea on 29 Nov 2019
no I'm sure.
here you are the whole code>
clear;
clc;
%tatal incident beam
Ib=[0 0 112 265 391 460 495 460 391 265 112 0 0];
Id=[0 0 49 77 91 98 98 98 91 77 49 0 0];
Delta=-23.43936028;
Rd=0.8830222216;
Rr=0.02339555569;
QQ=30;
gamma=20;
beta=40;
ST=[6 7 8 9 10 11 12 13 14 15 16 17 18];
w=15*(12-ST);
x=sind(QQ)*(sind(Delta)*cosd(beta)+cosd(Delta)*cosd(gamma)*cosd(w)*sind(beta))+cosd(QQ)*(cosd(Delta)*cosd(w)*cosd(beta)-sind(Delta)*cosd(gamma)*sind(beta))+cosd(Delta)*sind(gamma)*sind(w)*sind(beta);
y=sind(Delta)*sind(QQ)+cosd(QQ)*cosd(Delta)*cosd(w);
theta=acosd(x);
thetaZ=acosd(y);
Rb=x./y;
I=(Ib.*Rb)+(Id.*Rd)+((Ib+Id)*Rr);
plot(ST,I);
%Incident solar flux
alpha=(0.0106944*(theta-90)*(1-0.254*(cosd(theta)/cosd(85).^(4*(theta-85))))/((theta./95.406).^0.9775)-1);
the prblm is that I got only one value for alpha which it doesn't make sence because there are so many values for theta !
I merged the alpha equation in one command so I can bypass the double complex results for some parts of the equation.
help me please if you can..
darova
darova on 29 Nov 2019
You lost the dot "./"
Find it

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!