1: <?php
2:
3: /**
4: * Copyright 2015 AutEne.com.
5: *
6: * This work is licensed under the
7: * Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
8: * To view a copy of this license, visit
9: *
10: * http://creativecommons.org/licenses/by-nc-nd/3.0/
11: *
12: * or send a letter to Creative Commons, 444 Castro Street, Suite 900,
13: * Mountain View, California, 94041, USA.
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: */
20:
21: /**
22: * Description of Irradiacion
23: *
24: * La clase Irradiacion.php gestiona las propiedades de los parámetros de cálculo
25: * necesarios para obtener el Factor de Irradiación. Las propiedades $α y $β son
26: * introducidas por el usuario y se corresponden con Azimut(αº) e Inclinación(βº).
27: * La propiedad $φ se corresponde con la Latitud y es obtenida en un paso previo
28: * en la clase Latitud, en funcion de la provincia seleccionada. En cuanto a la
29: * propiedad $βopt, la obtenemos a partir de la Clase Latitud en función de la
30: * Clase Periodo, que define el periodo de cálculo. Con las propiedades anteriores
31: * obtenemos el Factor de Irradiación, mediante un cálculo en su método Set. El
32: * constructor de la clase toma como parametros de entrada las propiedades que
33: * define el usuario, las propiedades obtenidas de otros cálculos e invoca al
34: * método setFi() para mostrar $fi, el Factor de Irradiación.
35: *
36: * @author antonio horrillo horrillo
37: */
38: class Irradiacion {
39:
40: ////////////////////////////////////////////////////////////////////////////////
41: // Propiedades de Irradiación
42: ////////////////////////////////////////////////////////////////////////////////
43:
44: protected $φ;
45: protected $α;
46: protected $β;
47: protected $βopt;
48: protected $fi;
49:
50: ////////////////////////////////////////////////////////////////////////////////
51: // Métodos Get
52: ////////////////////////////////////////////////////////////////////////////////
53:
54: public function getφ() {
55: return $this->φ;
56: }
57:
58: public function getα() {
59: return $this->α;
60: }
61:
62: public function getβ() {
63: return $this->β;
64: }
65:
66: public function getβopt() {
67: return $this->βopt;
68: }
69:
70: public function getFi() {
71: return $this->fi;
72: }
73:
74: ////////////////////////////////////////////////////////////////////////////////
75: // Métodos Set
76: ////////////////////////////////////////////////////////////////////////////////
77:
78: public function setφ($φ) {
79: $this->φ=$φ;
80: }
81:
82: public function setα($α) {
83: $this->α=$α;
84: }
85:
86: public function setβ($β) {
87: $this->β=$β;
88: }
89:
90: public function setβopt($βopt) {
91: $this->βopt=$βopt;
92: }
93:
94: public function setFi() {
95: if ($this->β <= 15) {
96: $this->fi = 1 - ((1.2)*(pow(10,-4))*(pow(($this->β-$this->βopt),2)));
97: }
98: elseif ($this->β > 15 || $this->β < 90) {
99: $this->fi = 1 - (((1.2)*(pow(10,-4))*(pow(($this->β-$this->βopt),2))) + ((3.5)*(pow(10,-5))*(pow($this->α,2))));
100: }
101: else {
102: $this->fi = 0;
103: }
104: }
105:
106: ////////////////////////////////////////////////////////////////////////////////
107: // Constructor de Clase Irradiación
108: ////////////////////////////////////////////////////////////////////////////////
109:
110: function __construct($φ, $α, $β, $βopt) {
111: $this->φ=$φ;
112: $this->α=$α;
113: $this->β=$β;
114: $this->βopt=$βopt;
115: $this->setFi();
116: }
117: }