Sub Project_12_ES(ByVal VecType, m, n, m1, n1 As Integer) ' 12_SimetrIa plana_ES ' Updated: 27/03/24 ' Created by: Ariel R. Becerra (21/11/23) ' Modified by: _________________ ' This is the code of your new project. ' Steps to embed the code to ScienSolar: ' Note 1: The number 12 in the name of this function must match the one in the list of the CONFIG sheet for this project. If not, please correct it. ' Note 2: This code will be integrated into the main code to automate the download of the project. ' Note 3: The formulas and cell values generated here correspond only to the first 30 columns from INICIO to the right in the sheet. All your formulas and values are recommended to be written in these columns. ' Step 1. Go to the CONFIG sheet and add a short name and the number of your new project to the last row in the projects list. ' Step 2. Make sure that the list of projects in CONFIG sheet has the correct ascending numbering. ' Step 4. Open the VBA editor (Alt + F11 in Windows or Fn + Option + F11 in macOS). To avoid mistakes, make sure you only have one workbook open. ' Step 5. On the left, in the project explorer, select a non full module (or add a new one). ' Step 6. Select all the code in this file, copy and paste it at the end of the existing code in the module (or in the new one). ' Step 7. To load the project and to check it in a new sheet, go to the CONFIG sheet and click the New Sheet button, then select the project from the list and click the +Vector button. ' Step 8. Click any XYZ button to get the project in the coordinate system. Enjoy it! ' Visit www.sciensolar.com for news and updates of ? ScienSolar. Cells(m1 - 1, n1 + 2).FormulaR1C1 = "2" Cells(m1 + 0, n1 + 2).FormulaR1C1 = "=CONFIG!R3C4" Cells(m1 + 0, n1 + 3).FormulaR1C1 = "850" Cells(m1 + 0, n1 + 6).FormulaR1C1 = "=CONFIG!R3C8" Cells(m1 + 0, n1 + 7).FormulaR1C1 = "=CONFIG!R3C9" Cells(m1 + 0, n1 + 8).FormulaR1C1 = "Ariel R. Becerra (21/11/23)" Cells(m1 + 1, n1 + 2).FormulaR1C1 = "=CONFIG!R4C4" Cells(m1 + 1, n1 + 3).FormulaR1C1 = "400" Cells(m1 + 1, n1 + 4).FormulaR1C1 = "=CONFIG!R4C6" Cells(m1 + 1, n1 + 5).FormulaR1C1 = "0" Cells(m1 + 1, n1 + 6).FormulaR1C1 = "=CONFIG!R4C8" Cells(m1 + 1, n1 + 7).FormulaR1C1 = "=CONFIG!R4C9" Cells(m1 + 2, n1 + 2).FormulaR1C1 = "=CONFIG!R5C4" Cells(m1 + 2, n1 + 3).FormulaR1C1 = "1" Cells(m1 + 2, n1 + 4).FormulaR1C1 = "=CONFIG!R5C6" Cells(m1 + 2, n1 + 5).FormulaR1C1 = "15" Cells(m1 + 2, n1 + 6).FormulaR1C1 = "=CONFIG!R5C8" Cells(m1 + 2, n1 + 7).FormulaR1C1 = "0" Cells(m1 + 3, n1 + 0).FormulaR1C1 = "g" Cells(m1 + 3, n1 + 2).FormulaR1C1 = "=CONFIG!R6C4" Cells(m1 + 3, n1 + 3).FormulaR1C1 = "=CONFIG!R6C5" Cells(m1 + 3, n1 + 4).FormulaR1C1 = "=CONFIG!R6C6" Cells(m1 + 3, n1 + 5).FormulaR1C1 = "15" Cells(m1, n1 + 9).FormulaR1C1 = "HELP" Dim HELPtxt As String HELPtxt = "CAMPO VECTORIAL DE SIMETR" & ChrW(205) & "A PLANA" & Chr(10) & _ " (See english version at the end)" & Chr(10) & _ " El modelo muestra la distribuci" & ChrW(243) & "n en el espacio de un campo de simetr" & ChrW(237) & "a plana, espec" & ChrW(237) & "ficamente el campo vectorial A= (0,0,1). A continuaci" & ChrW(243) & "n vemos las componentes del vector A en coordenadas cartesianas:" & Chr(10) & _ " A12 = 0" & Chr(10) & _ " B12 0" & Chr(10) & _ " C12 = 1" & Chr(10) & _ " En la celda C7 los par" & ChrW(225) & "metros de este campo pueden ser modificados de la siguiente manera: " & Chr(10) & _ " El primer par" & ChrW(233) & "ntesis cuadrado o[ ] indica el paso de incremento de la coordenada x, y el segundo, es decir x=[ ; ], el rango de visualizaci" & ChrW(243) & "n de x. " & Chr(10) & _ " El tercer par" & ChrW(233) & "ntesis cuadrado o2[ ] indica el paso de incremento de la coordenada y, y el cuarto, es decir y=[ ; ], el rango de visualizaci" & ChrW(243) & "n de y. " & Chr(10) & _ " El quinto par" & ChrW(233) & "ntesis cuadrado o3[ ] indica el paso de incremento de la coordenada z, y el sexto, es decir z=[ ; ], el rango de visualizaci" & ChrW(243) & "n de z. " & Chr(10) & _ " El par" & ChrW(225) & "metro color se utiliza para colorear el vector seg" & ChrW(250) & "n su longitud, el n" & ChrW(250) & "mero indica aproximadamente la longitud del vector m" & ChrW(225) & "s grande, el color se distribuye entre rojo (vector m" & ChrW(225) & "s peque" & ChrW(233) & "o) y violeta (vector m" & ChrW(225) & "s grande). El " & ChrW(250) & "ltimo par" & ChrW(233) & "ntesis [ ] indica el origen de las coordenadas, donde comienzan las distribuciones vectoriales. Encierre solo valores num" & ChrW(233) & "ricos entre punto y coma, no modifique la estructura de esta cadena, excepto si es un experto en MS Excel." & Chr(10) & _ " Puede modificar los valores entre los par" & ChrW(233) & "ntesis cuadrados y verificar los resultados, por ejemplo para ver el campo en el plano yz entre --8 y 8 para ambas coordenadas en multiplos de 2 coloque o[1]x=[0;0]o2[2]y=[-8;8]o3[2]z=[-8;8]. Oprima XYZ para ver los resultados. Oprima YZ para ver desde el frente." & Chr(10) & _ " Cambie los valores del campo en A12=1, B12=1, C12=2 y observe los resultados. " & Chr(10) & _ " (ENGLISH)" & Chr(10) & _ " PLANE SYMMETRY VECTOR FIELD" & Chr(10) & _ " The model shows the distribution in space of a plane symmetry field, specifically the vector field A= (0,0,1). Next we see the components of vector A in Cartesian coordinates:" & Chr(10) & _ " A12 = 0, B12 0, C12 = 1" & Chr(10) & _ " In cell C7 you can modify the parameters of this field as follows:" & Chr(10) & _ " The first square bracket or [ ] indicates the increment step of the x-coordinate, and the second, that is, x=[ ; ], the display range of x." & Chr(10) & _ " The third bracket o2[ ] indicates the increment step of the y-coordinate, and the fourth, that is y=[ ; ], the display range of y." & Chr(10) & _ " The fifth bracket o3[ ] indicates the increment step of the z coordinate, and the sixth, that is, z=[ ; ], the display range of z." & Chr(10) & _ " The color parameter is used to color the vector according to its length, the number indicates approximately the length of the largest vector, the color is distributed between red (smallest vector) and purple (largest vector). The last parenthesis [ ] indicates the origin of the coordinates, where vector distributions begin. Enclose only numeric values " & ChrW(233) & "" & ChrW(233) & "between semicolons, do not modify the structure of this string, except if you are an expert in MS Excel." & Chr(10) & _ " You can modify the values " & ChrW(233) & "" & ChrW(233) & "in square brackets and check the results, for example to see the field in the yz plane between --8 and 8 for both coordinates in multiples of 2 put o[1]x=[0;0 ]o2[ 2] y=[-8;8]o3[2]z=[-8;8]. Press XYZ to see the results. Press YZ to view from the front." & Chr(10) & _ " Change the field values " & ChrW(233) & "" & ChrW(233) & "to A12=1, B12=1, C12=2 and observe the results." Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "g" Cells(m + 3, n + 2).FormulaR1C1 = "=CONFIG!R6C4" Cells(m + 3, n + 3).FormulaR1C1 = "=CONFIG!R6C5" Cells(m + 3, n + 4).FormulaR1C1 = "=CONFIG!R6C6" Cells(m + 3, n + 5).FormulaR1C1 = "15" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 1).FormulaR1C1 = "=""o[""&R[5]C[4]&""]x=[""&R[6]C[4]&"";""&R[7]C[4]&""]o2[""&R[10]C[4]&""]y=[""&R[11]C[4]&"";""&R[12]C[4]&""]o3[""&R[15]C[4]&""]z=[""&R[16]C[4]&"";""&R[17]C[4]&""]color=[50]origin[cart.]=[0;0;0]tfactor=0,002011139s""" Cells(m + 4, n + 2).FormulaR1C1 = "Campo de simetr" & ChrW(237) & "a plana" Cells(m + 4, n + 12).FormulaR1C1 = "CAMPO DE SIMETR" & ChrW(205) & "A PLANA" Cells(m + 4, n + 24).FormulaR1C1 = "INSTRUCCIONES" Cells(m + 5, n + -1).FormulaR1C1 = "101" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 6, n + 4).FormulaR1C1 = "DISTRIBUCI" & ChrW(211) & "N DE " Cells(m + 7, n + -1).FormulaR1C1 = "=R[1]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[1]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[1]C" Cells(m + 7, n + 4).FormulaR1C1 = "LOS VECTORES:" Cells(m + 8, n + -1).FormulaR1C1 = "64" Cells(m + 8, n + 0).FormulaR1C1 = "64" Cells(m + 8, n + 1).FormulaR1C1 = "83" Cells(m + 8, n + 2).FormulaR1C1 = "<-- coordenadas variables." Cells(m + 8, n + 4).FormulaR1C1 = "EJE X:" Cells(m + 8, n + 21).FormulaR1C1 = "La simulaci" & ChrW(243) & "n muestra la distribuci" & ChrW(243) & "n de vectores en una determinada regi" & ChrW(243) & "n del espacio de un " Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "=1000/ABS(R[-1]C)" Cells(m + 9, n + 2).FormulaR1C1 = "<< ---F" & ChrW(211) & "RMULA DEL CAMPO" Cells(m + 9, n + 4).FormulaR1C1 = "Paso:" Cells(m + 9, n + 5).FormulaR1C1 = "40" Cells(m + 9, n + 21).FormulaR1C1 = "campo vectorial de simetr" & ChrW(237) & "a plana." Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "x_inicial:" Cells(m + 10, n + 5).FormulaR1C1 = "-100" Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "x_final" Cells(m + 11, n + 5).FormulaR1C1 = "100" Cells(m + 11, n + 21).FormulaR1C1 = "1. Modifique en la columna G los par" & ChrW(225) & "metros de visualizaci" & ChrW(243) & "n del campo." Cells(m + 3, n + 1).Interior.Color = "15773696" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Cells(m1 + 2, n1 - 1).Value = 1 End If ' vector ends If m = m1 + 0 Then Cells(m + 12, n + 4).FormulaR1C1 = "=IF(R[-2]C[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 12, n + 21).FormulaR1C1 = "2. El campo que se muestra en la simulaci" & ChrW(243) & "n es E_z = 1000/|z|. La f" & ChrW(243) & "rmula del campo se encuentra" Cells(m + 13, n + 4).FormulaR1C1 = "EJE Y:" Cells(m + 13, n + 21).FormulaR1C1 = "en la celda C12." Cells(m + 14, n + 4).FormulaR1C1 = "Paso:" Cells(m + 14, n + 5).FormulaR1C1 = "40" Cells(m + 14, n + 21).FormulaR1C1 = "3. Intente modificar la f" & ChrW(243) & "rmula del campo, por ejemplo coloque C12=0 y en " Cells(m + 15, n + 4).FormulaR1C1 = "y_inicial:" Cells(m + 15, n + 5).FormulaR1C1 = "-100" Cells(m + 15, n + 21).FormulaR1C1 = "la celda B12=1000/ABS(B11) para obtener un campo dirigido hacia la derecha." Cells(m + 16, n + 4).FormulaR1C1 = "y_final" Cells(m + 16, n + 5).FormulaR1C1 = "100" Cells(m + 17, n + 21).FormulaR1C1 = "En las celdas G12 - G24 se pueden editar los par" & ChrW(225) & "metros de distribuci" & ChrW(243) & "n de los vectores en cada " Cells(m + 18, n + 4).FormulaR1C1 = "EJE Z:" Cells(m + 18, n + 21).FormulaR1C1 = "coordenada." Cells(m + 19, n + 4).FormulaR1C1 = "Paso:" Cells(m + 19, n + 5).FormulaR1C1 = "60" Cells(m + 20, n + 4).FormulaR1C1 = "z_inicial:" Cells(m + 20, n + 5).FormulaR1C1 = "-100" Cells(m + 21, n + 4).FormulaR1C1 = "z_final" Cells(m + 21, n + 5).FormulaR1C1 = "100" Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub