Sub Project_31_ES(ByVal VecType, m, n, m1, n1 As Integer) ' 31_Onda plana_ES ' Updated: 30/06/24 ' Created by: Ariel Becerra (26/04/24) ' Modified by: _________________ ' This is the code of your new project. ' Steps to embed the code to ScienSolar: ' Note 1: The number 31 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 ="1" Cells(m1 + 0, n1 + 2).FormulaR1C1 ="=CONFIG!R3C4" Cells(m1 + 0, n1 + 3).FormulaR1C1 ="600" Cells(m1 + 0, n1 + 6).FormulaR1C1 ="=CONFIG!R3C8" Cells(m1 + 0, n1 + 7).FormulaR1C1 ="0.000105" Cells(m1 + 0, n1 + 8).FormulaR1C1 ="Ariel Becerra (26/04/24)" Cells(m1 + 1, n1 + 2).FormulaR1C1 ="=CONFIG!R4C4" Cells(m1 + 1, n1 + 3).FormulaR1C1 ="400" Cells(m1 + 1, n1 + 4).FormulaR1C1 ="i" Cells(m1 + 1, n1 + 5).FormulaR1C1 ="0" Cells(m1 + 1, n1 + 6).FormulaR1C1 ="=CONFIG!R4C8" Cells(m1 + 1, n1 + 7).FormulaR1C1 ="40" Cells(m1 + 2, n1 + 2).FormulaR1C1 ="=CONFIG!R5C4" Cells(m1 + 2, n1 + 3).FormulaR1C1 ="1" Cells(m1 + 2, n1 + 4).FormulaR1C1 ="x" 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 ="E" Cells(m1 + 3, n1 + 2).FormulaR1C1 ="=CONFIG!R6C4" Cells(m1 + 3, n1 + 3).FormulaR1C1 ="250" Cells(m1 + 3, n1 + 4).FormulaR1C1 ="E" Cells(m1 + 3, n1 + 5).FormulaR1C1 ="15.0042" Cells(m1, n1 + 9).FormulaR1C1 = "HELP" Dim HELPtxt as String HELPtxt = "HELP Comment:" & Chr(10) & _ " 1. To create new projects, press the +Vector button without selecting any project in the project list." & Chr(10) & _ " 2. To load an existing project, select a project from the list and then press +Vector" & Chr(10) & _ " 3. To export a new project, press the Get Code button. The code will be saved on your PC in the same directory where this file is located." & Chr(10) & _ " " & Chr(10) & _ " If necessary, use this comment to create your own HELP comment for your project. To do this, simply replace this text with your own (Right Click, Edit Comment) and avoid special characters." & Chr(10) & _ " After pressing Get Code, your comment will be updated and saved in the same txt file as your project and will be uploaded after the project appears in ScienSolar.To include the new project in ScienSolar, perform the following steps:" & Chr(10) & _ " a) Open the txt file where the project was saved; b) copy all the contents of the file and paste it in the VBA Editor of the Excel file ScienSolar; b) add the project name and number to the list on the CONFIG sheet; a) Verify that the number is correlative and that it agrees with the project header number, if not modify it in the header or in the list as necessary;”" & Chr(10) & _ " " & Chr(10) & _ " Right click to delete or edit this comment." & Chr(10) & _ " " & Chr(10) & _ " For documentation on ScienSolar, please visit www.sciensolar.com. ScienSolar was designed for 3D physics modeling in MS Excel.It is normal that for some projects it takes time to load it in the sheet, it depends on the number of objects in your project and the performance of your PC." On Error Resume Next Cells(m1 , n1 + 9).Comment.Text Text:= HELPtxt If m = m1 + 0 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 ="1" Cells(m + 3, n + 0).FormulaR1C1 ="E" Cells(m + 3, n + 2).FormulaR1C1 ="=CONFIG!R6C4" Cells(m + 3, n + 3).FormulaR1C1 ="250" Cells(m + 3, n + 4).FormulaR1C1 ="E" Cells(m + 3, n + 5).FormulaR1C1 ="15.0042" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="183" Cells(m + 4, n + 1).FormulaR1C1 ="=IF(R[34]C[4]=1,R[35]C[4],IF(R[34]C[4]=2,R[36]C[4],IF(R[34]C[4]=3,R[37]C[4],"""")))" Cells(m + 4, n + 12).FormulaR1C1 ="PROPAGACI" & ChrW(211) & "N DE UNA ONDA ELECTROMAGN" & ChrW(201) & "TICA PLANA" Cells(m + 4, n + 24).FormulaR1C1 ="INSTRUCCIONES" Cells(m + 5, n + -1).FormulaR1C1 ="1" Cells(m + 5, n + 0).FormulaR1C1 ="1" Cells(m + 5, n + 1).FormulaR1C1 ="=R[18]C[4]" 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 ="DATOS INICIALES" Cells(m + 8, n + -1).FormulaR1C1 ="0" Cells(m + 8, n + 0).FormulaR1C1 ="=R[-6]C[7]*100000" Cells(m + 8, n + 1).FormulaR1C1 ="0" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 ="H_0 =" Cells(m + 8, n + 5).FormulaR1C1 ="100" Cells(m + 8, n + 21).FormulaR1C1 ="En el modelo se estudia de forma sencilla la propagaci" & ChrW(243) & "n de una onda electromagn" & ChrW(233) & "tica " Cells(m + 9, n + -1).FormulaR1C1 ="=IF(R[12]C[6]=0,RC[6]*IMAGINARY(IMEXP(COMPLEX(0,(R[1]C[6]*R[-7]C[8]-R[6]C[6]*R[-1]C[1])))),0)" Cells(m + 9, n + 0).FormulaR1C1 ="0" Cells(m + 9, n + 1).FormulaR1C1 ="=RC[4]*IMREAL(IMEXP(COMPLEX(0,(R[1]C[4]*R[-7]C[6]-R[6]C[4]*R[-1]C[-1]))))" Cells(m + 9, n + 2).FormulaR1C1 ="=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 ="E_0 =" Cells(m + 9, n + 5).FormulaR1C1 ="100" Cells(m + 9, n + 21).FormulaR1C1 ="plana, cuyos campos el" & ChrW(233) & "ctrico y magn" & ChrW(233) & "tico son perpendiculares entre s" & ChrW(237) & " y perpendiculares " 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 ="w =" Cells(m + 10, n + 5).FormulaR1C1 ="10000000" Cells(m + 10, n + 21).FormulaR1C1 ="a la direcci" & ChrW(243) & "n de propagaci" & ChrW(243) & "n. Para el caso de la propagaci" & ChrW(243) & "n en direcci" & ChrW(243) & "n positiva del eje x" Cells(m + 11, n + -1).FormulaR1C1 ="4" Cells(m + 11, n + 0).FormulaR1C1 ="0" Cells(m + 11, n + 1).FormulaR1C1 ="1" Cells(m + 11, n + 4).FormulaR1C1 ="c =" Cells(m + 11, n + 5).FormulaR1C1 ="300000000" Cells(m + 11, n + 21).FormulaR1C1 ="los campos el" & ChrW(233) & "ctrico y magn" & ChrW(233) & "tico tienen la forma:" Cells(m + 3, n + 1).Interior.Color = "3506772" Cells(m + 3, n + 1).Font.Size = "12" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "H" Call AddNewVector end if ' vector ends If m = m1 + 9 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 ="2" Cells(m + 3, n + 0).FormulaR1C1 ="H" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="183" Cells(m + 4, n + 1).FormulaR1C1 ="=IF(R[25]C[4]=1,R[26]C[4],IF(R[25]C[4]=2,R[27]C[4],IF(R[25]C[4]=3,R[28]C[4],"""")))" Cells(m + 5, n + -1).FormulaR1C1 ="1" Cells(m + 5, n + 0).FormulaR1C1 ="1" Cells(m + 5, n + 1).FormulaR1C1 ="=R[11]C[4]" Cells(m + 5, n + 4).FormulaR1C1 ="Vector de onda:" Cells(m + 5, n + 23).FormulaR1C1 ="E = E_0 exp[i(wt-kx)]" Cells(m + 6, n + 4).FormulaR1C1 ="k=" Cells(m + 6, n + 5).FormulaR1C1 ="=R[-5]C/R[-4]C" Cells(m + 6, n + 23).FormulaR1C1 ="H = H_0 exp[i(wt-kx)]." 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 + 8, n + -1).FormulaR1C1 ="0" Cells(m + 8, n + 0).FormulaR1C1 ="=R[-15]C[7]*100000" Cells(m + 8, n + 1).FormulaR1C1 ="0" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=R[-10]C[6]*IMREAL(IMEXP(COMPLEX(0,(R[-8]C[6]*R[-16]C[8]-R[-3]C[6]*R[-1]C[1]))))" Cells(m + 9, n + 0).FormulaR1C1 ="0" Cells(m + 9, n + 1).FormulaR1C1 ="=IF(R[3]C[4]=0,R[-10]C[4]*IMAGINARY(IMEXP(COMPLEX(0,(R[-8]C[4]*R[-16]C[6]-R[-3]C[4]*R[-10]C[-1])))),0)" Cells(m + 9, n + 2).FormulaR1C1 ="=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 ="MOSTRAR:" Cells(m + 9, n + 21).FormulaR1C1 ="Estas f" & ChrW(243) & "rmulas se introducen para E en las celdas C12 (parte real y A12 (parte imaginaria, y para" Cells(m + 10, n + -1).FormulaR1C1 ="1" Cells(m + 10, n + 0).FormulaR1C1 ="0" Cells(m + 10, n + 1).FormulaR1C1 ="=R[-9]C" Cells(m + 10, n + 4).FormulaR1C1 ="Si=0, NO=1" Cells(m + 10, n + 21).FormulaR1C1 =" H en A21 (parte real) y C21 (parte imaginaria)." Cells(m + 11, n + -1).FormulaR1C1 ="4" Cells(m + 11, n + 0).FormulaR1C1 ="0" Cells(m + 11, n + 1).FormulaR1C1 ="1" Cells(m + 11, n + 4).FormulaR1C1 ="Parte imaginaria:" Cells(m + 11, n + 21).FormulaR1C1 ="Datos iniciales:" Cells(m + 3, n + 1).Interior.Color = "16718985" Cells(m + 3, n + 1).Font.Size = "12" 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 = 2 end if ' vector ends If m = m1 + 9 Then Cells(m + 12, n + 5).FormulaR1C1 ="1" Cells(m + 12, n + 22).FormulaR1C1 ="Magnitud" Cells(m + 12, n + 24).FormulaR1C1 ="Etiqueta" Cells(m + 12, n + 25).FormulaR1C1 ="Valor en" Cells(m + 12, n + 26).FormulaR1C1 ="Valor num" & ChrW(233) & "rico:" Cells(m + 13, n + 4).FormulaR1C1 ="Campo el" & ChrW(233) & "ctrico" Cells(m + 14, n + 5).FormulaR1C1 ="0" Cells(m + 14, n + 22).FormulaR1C1 ="Amplitud inicial de H" Cells(m + 14, n + 24).FormulaR1C1 ="H_0 =" Cells(m + 14, n + 25).FormulaR1C1 ="G11" Cells(m + 14, n + 26).FormulaR1C1 ="100" Cells(m + 15, n + 4).FormulaR1C1 ="Campo magn" & ChrW(233) & "tico:" Cells(m + 15, n + 22).FormulaR1C1 ="Amplitud inicial de E" Cells(m + 15, n + 24).FormulaR1C1 ="E_0 =" Cells(m + 15, n + 25).FormulaR1C1 ="G12" Cells(m + 15, n + 26).FormulaR1C1 ="100" Cells(m + 16, n + 5).FormulaR1C1 ="0" Cells(m + 16, n + 22).FormulaR1C1 ="Frecuencia" Cells(m + 16, n + 24).FormulaR1C1 ="w =" Cells(m + 16, n + 25).FormulaR1C1 ="G13" Cells(m + 16, n + 26).FormulaR1C1 ="10000000" Cells(m + 17, n + 2).FormulaR1C1 ="=IF(R[-13]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 17, n + 22).FormulaR1C1 ="Velocidad de la luz:" Cells(m + 17, n + 24).FormulaR1C1 ="c =" Cells(m + 17, n + 25).FormulaR1C1 ="G14" Cells(m + 17, n + 26).FormulaR1C1 ="300000000" Cells(m + 18, n + 2).FormulaR1C1 ="=IF(R[-14]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 18, n + 22).FormulaR1C1 ="Vector de onda" Cells(m + 18, n + 24).FormulaR1C1 ="k=" Cells(m + 18, n + 25).FormulaR1C1 ="G19" Cells(m + 18, n + 26).FormulaR1C1 ="w" & ChrW(218) & "c" Cells(m + 19, n + 4).FormulaR1C1 ="=IF(R[-9]C[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 20, n + 4).FormulaR1C1 ="=IF(R[-10]C[-4]>0,""<-- use these cells."","""")" Cells(m + 20, n + 21).FormulaR1C1 ="Vista 1:" Cells(m + 20, n + 22).FormulaR1C1 ="MODO VECTORES:" Cells(m + 20, n + 25).FormulaR1C1 ="G41" Cells(m + 20, n + 26).FormulaR1C1 ="0" Cells(m + 21, n + 22).FormulaR1C1 ="Unidad del tiempo:" Cells(m + 21, n + 24).FormulaR1C1 ="t" Cells(m + 21, n + 25).FormulaR1C1 ="I3" Cells(m + 21, n + 26).FormulaR1C1 ="0.000105" Cells(m + 22, n + 22).FormulaR1C1 ="No. de pasos:" Cells(m + 22, n + 24).FormulaR1C1 ="Paso" Cells(m + 22, n + 25).FormulaR1C1 ="I4" Cells(m + 22, n + 26).FormulaR1C1 ="40" Cells(m + 23, n + 22).FormulaR1C1 ="Coordenada:" Cells(m + 23, n + 24).FormulaR1C1 ="x (para E)" Cells(m + 23, n + 25).FormulaR1C1 ="B11" Cells(m + 23, n + 26).FormulaR1C1 =" =I5*100000" Cells(m + 24, n + 22).FormulaR1C1 ="Coordenada:" Cells(m + 24, n + 24).FormulaR1C1 ="x (para H)" Cells(m + 24, n + 25).FormulaR1C1 ="B20" Cells(m + 24, n + 26).FormulaR1C1 =" =I5*100000" Cells(m + 25, n + 22).FormulaR1C1 ="Escala " Cells(m + 25, n + 25).FormulaR1C1 ="E5" Cells(m + 25, n + 26).FormulaR1C1 ="1" Cells(m + 26, n + 4).FormulaR1C1 ="TIPO DE " Cells(m + 26, n + 21).FormulaR1C1 ="Acci" & ChrW(243) & "nes:" Cells(m + 26, n + 22).FormulaR1C1 ="Oprimir <<-- y luego >>." Cells(m + 27, n + 4).FormulaR1C1 ="COORDENADAS:" Cells(m + 27, n + 22).FormulaR1C1 ="Para grabar recorrido, oprimir el primer bot" & ChrW(243) & "n izquierdo en A6 antes que >>." Cells(m + 28, n + 4).FormulaR1C1 ="=IF(R[1]C[1]=0,""Ingrese P(x,y,z) en A11, B11, C11"","""")" Cells(m + 29, n + 4).FormulaR1C1 ="0, 1, 2 Ñ 3:" Cells(m + 29, n + 5).FormulaR1C1 ="0" Cells(m + 29, n + 21).FormulaR1C1 ="Vista 2" Cells(m + 29, n + 22).FormulaR1C1 ="MODO CAMPO" Cells(m + 29, n + 25).FormulaR1C1 ="G41" Cells(m + 29, n + 26).FormulaR1C1 ="1" Cells(m + 30, n + 4).FormulaR1C1 ="=IF(R[-1]C[1]=1,"" 1- Cart.-->>"",""|"")" Cells(m + 30, n + 5).FormulaR1C1 ="=IF(R[-1]C=1,""o[2]x=[0;0]o2[7]y=[0;600]o3[2]z=[0;0]color=[0]origin[cart.]=[0;0;0]tfactor=0,002297794s"","""")" Cells(m + 30, n + 6).FormulaR1C1 =" " Cells(m + 30, n + 22).FormulaR1C1 ="Unidad del tiempo:" Cells(m + 30, n + 25).FormulaR1C1 ="I3" Cells(m + 30, n + 26).FormulaR1C1 ="0.000105" Cells(m + 31, n + 4).FormulaR1C1 ="=IF(R[-2]C[1]=2,"" 2- Cyl -->>"",IF(R[-2]C[1]=3,"""",IF(R[-2]C[1]=1,"""",""|"")))" Cells(m + 31, n + 5).FormulaR1C1 ="=IF(R[-2]C=2,""c[10]rho=[90;90]c2[10]phi=[0;360]c3[10]z=[-200;200]color=[8]origin[cart.]=[0;0;0]tfactor=0,00323606s"","""")" Cells(m + 31, n + 22).FormulaR1C1 ="No. de pasos:" Cells(m + 31, n + 25).FormulaR1C1 ="I4" Cells(m + 31, n + 26).FormulaR1C1 ="40" Cells(m + 32, n + 4).FormulaR1C1 ="=IF(R[-3]C[1]=3,"" 3- Sph -->>"",""|"")" Cells(m + 32, n + 5).FormulaR1C1 ="=IF(R[-3]C=3,""s[10]r=[150;150]s2[10]phi=[0;360]s3[10]theta=[0;180]color=[8]origin[cart.]=[0;0;0]tfactor=0,003322398s"","""")" Cells(m + 32, n + 22).FormulaR1C1 ="Escala " Cells(m + 32, n + 25).FormulaR1C1 ="E5" Cells(m + 32, n + 26).FormulaR1C1 ="1" Cells(m + 33, n + 4).FormulaR1C1 ="||||||||||||||||||||||||" Cells(m + 33, n + 21).FormulaR1C1 ="Acciones:" Cells(m + 33, n + 22).FormulaR1C1 ="Desactivar el primer bot" & ChrW(243) & "n izquierdo de A6." Cells(m + 34, n + 22).FormulaR1C1 ="Oprimir <<-- y luego >>." Cells(m + 36, n + 21).FormulaR1C1 ="Para ver u ocultar la parte imaginaria, el campo el" & ChrW(233) & "ctrico o el campo magn" & ChrW(233) & "tico utilice los " Cells(m + 37, n + 21).FormulaR1C1 ="valores 0 y 1 en las celdas C24, C26 y C28 respectivamente. " Cells(m + 39, n + 21).FormulaR1C1 ="Para salir de MODO CAMPO elimine el contenido de G41 y coloque B11=I5*100000 y B20=I5*100000" Cells(m + 41, n + 21).FormulaR1C1 ="Experimente cambiando la frecuencia, la unidad de tiempo y otros par" & ChrW(225) & "metros. Tenga mucho cuidado" Cells(m + 42, n + 21).FormulaR1C1 ="al cambiar valores de celdas que contienen f" & ChrW(243) & "rmulas. " Call BlackWhiteDesk Call PutEqBut end if ' actualizar hoja End Sub