Sub Project_24_EN(ByVal VecType, m, n, m1, n1 As Integer) ' 24_Coulomb Force_EN ' Updated: 6/02/25 ' 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 24 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 (into the VBA editor) to automate the download of the project. ' Note 3: The formulas and cell values generated here correspond only to the first 30 columns in the sheet. All your formulas and values are recommended to be written in these columns. ' Step 1. Go to the CONFIG sheet (at the end of column C) and add the number of your new project to the last row in the projects list, and a short name in the corresponding langage column. ' 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 - 1, n1).Value = "" Cells(m1 + 0, n1 + 0).FormulaR1C1 = "24" Cells(m1 + 0, n1 + 1).FormulaR1C1 = "41" 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 = "8" 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 = "45" Cells(m1 + 2, n1 + 0).FormulaR1C1 = "t = 0,08203125 s." Cells(m1 + 2, n1 + 2).FormulaR1C1 = "=CONFIG!R5C4" Cells(m1 + 2, n1 + 3).FormulaR1C1 = "20" 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 = "=IF(RC[1]<0, "" - Q"", "" + Q"")" Cells(m1 + 3, n1 + 1).FormulaR1C1 = "-0.0001" Cells(m1 + 3, n1 + 2).FormulaR1C1 = "=CONFIG!RC" Cells(m1 + 3, n1 + 3).FormulaR1C1 = "200" 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 = "FUERZA DE COULOMB PARA UN NÖMERO FINITO DE CARGAS PUNTUALES" & Chr(10) & _ " (See english version at the end)" & Chr(10) & _ " El objetivo de este modelo es a partir de la ley de Coulomb, calcular la fuerza resultante sobre una carga Q por parte de un n“mero finito de cargas que se encuentran distribuidas en el espacio. El usuario podrö, de manera sencilla, agregar o quitar cualquier n“mero finito de cargas al sistema y calcular inmediatamente la fuerza resultante. La Ley de Coulomb establece la fuerza de interacciãn entre dos cargas puntuales que se encuentran una de la otra a una distancia r:" & Chr(10) & _ " F12 =kq1q2/r^2" & Chr(10) & _ " Si se desea calcular la fuerza sobre una carga por parte de dos o mös cargas, se aplica el principio de superposiciãn de fuerzas: " & Chr(10) & _ " F = (Fx,Fy,Fz) = öFi, siendo i el n“mero de cargas que actuarön sobre otra carga determinada. Esta “ltima ecuaciãn no es mös que la suma de vectores que da como resultado una fuerza neta sobre la carga en estudio. " & Chr(10) & _ " En el modelo la carga en estudio es la carga Q, su magnitud se escribe en la celda C6 con su correspondiente signo; su posiciãn P(x,y,z) se establece en el espacio a trav" & ChrW(233) & "s de las celdas A10, B10, C10. " & Chr(10) & _ " Los valores de las demös cargas y su signo se establecen en las celdas C24, C42, C60, C78. Sus posiciones en las correspondientes filas 28, 46, 64, 82. Las componentes de la fuerza resultante sobre Q se verön en las celdas A21 = Fx, B21 = Fy, C21 = Fz." & Chr(10) & _ " Coloque A10=0, B10=0, C10=0 y oprima XYZ para ver la fuerza neta cuando la carga de prueba estö en el origen. Oprima XY para ver desde arriba. Coloque C10=5, B10 = I5, I5=-5, I3 = 1, y oprima Ejecutar para ver el movimiento de la carga de prueba y la fuerza sobre ella durante su recorrido. Oprima Anular y luego Ejecutar para volver a empezar." & Chr(10) & _ " Para agregar una carga mös al sistema, copie las filas completas desde la 42 hasta la 59 inclusive, y p" & ChrW(233) & "guelas al final, es decir coloque el cursor en la celda A96 y con el men“ derecho del raton seleccione Pegar. Luego modifique la posiciãn de la carga agregada. Haga este mismo procedimiento para agregar mös cargas. Oprima XYZ para ver el resultado. " & Chr(10) & _ " (ENGLISH)" & Chr(10) & _ " COULOMB FORCE FOR A FINITE NUMBER OF POINT CHARGES" & Chr(10) & _ " The objective of this model is from Coulomb's law, to calculate the resultant force on a charge Q by a finite number of charges that are distributed in space. The user can easily add or remove any finite number of charges to the system and immediately calculate the resulting force. Coulomb's Law establishes the force of interaction between two point charges that are at a distance r:" & Chr(10) & _ " F12 =kq1q2/r^2" & Chr(10) & _ " If it is desired to calculate the force on a charge by two or more charges, the principle of superposition of forces is applied: F = (Fx,Fy,Fz) = öFi, where i is the number of charges that will act on another given charge. This last equation is nothing more than the addition of vectors that results in a net force on the charge under study. In the model, the charge under study is the charge Q, its magnitude is written in cell C6 with its corresponding sign; its position P(x,y,z) is set in space through cells A10, B10, C10." & Chr(10) & _ " The values " & ChrW(233) & "" & ChrW(233) & "of the other charges and their sign are set in cells C24, C42, C60, C78. Their positions in the corresponding rows 28, 46, 64, 82." & Chr(10) & _ " The components of the resultant force on Q will be seen in the cells A21 = Fx, B21 = Fy, C21 = Fz." & Chr(10) & _ " Set A10=0, B10=0, C10=0 and press XYZ to see the net force when the test charge is at the origin. Press XY to view from top." & Chr(10) & _ " Set C10=5, B10 = I5, I5=-5, I3 = 1 and press Run to see the movement of the test charge and the force on it during its travel. Click Set to zero and then Run to start over." & Chr(10) & _ " To add one more charge to the system, copy the complete rows from 42 to 59 inclusive, and paste them at the end, that is, place the cursor in cell A96 and with the right menu of the mouse select Paste. Then modify the position of the added charge. Do this same procedure to add more charges. Press XYZ to see the result." On Error Resume Next Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 10 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(RC[1]<0, "" - Q"", "" + Q"")" Cells(m + 3, n + 1).FormulaR1C1 = "-0.0001" Cells(m + 3, n + 2).FormulaR1C1 = "=CONFIG!RC" Cells(m + 3, n + 3).FormulaR1C1 = "200" 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 = "9" Cells(m + 4, n + 2).FormulaR1C1 = "Coulomb law" Cells(m + 4, n + 12).FormulaR1C1 = "ELECTRICAL FORCE ON A CHARGE Q DUE TO ANOTHER CHARGES" Cells(m + 4, n + 24).FormulaR1C1 = "INSTRUCTIONS" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 6, n + -1).FormulaR1C1 = "Q =" Cells(m + 6, n + 0).FormulaR1C1 = "=R[-3]C[1]" Cells(m + 6, n + 4).FormulaR1C1 = "Constant :" Cells(m + 7, n + -1).FormulaR1C1 = "0" Cells(m + 7, n + 0).FormulaR1C1 = "4" Cells(m + 7, n + 1).FormulaR1C1 = "4" Cells(m + 7, n + 2).FormulaR1C1 = "<< -- Q position" Cells(m + 7, n + 4).FormulaR1C1 = " k=" Cells(m + 7, n + 5).FormulaR1C1 = "8900000000" Cells(m + 7, n + 21).FormulaR1C1 = "The simulation allows you to calculate and visualize in three dimensions the electric force " Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "exerted by various charges on one in particular, which is designated with the letter Q. In the model, " Cells(m + 9, n + -1).FormulaR1C1 = "2" Cells(m + 9, n + 0).FormulaR1C1 = "2" Cells(m + 9, n + 1).FormulaR1C1 = "2" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 = "Magnitude of the " Cells(m + 9, n + 21).FormulaR1C1 = "4 charges q1, q2, q3, q4 are taken, acting on a fifth charge Q, however more charges q can be added " 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 = "resultant force:" Cells(m + 10, n + 21).FormulaR1C1 = "and the total force on Q can be calculated. The procedure for adding more charges is described " Cells(m + 11, n + -1).FormulaR1C1 = "6" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "8" Cells(m + 11, n + 4).FormulaR1C1 = " F =" Cells(m + 11, n + 5).FormulaR1C1 = "=SQRT(R[7]C[-6]^2+R[7]C[-5]^2+R[7]C[-4]^2)" Cells(m + 11, n + 21).FormulaR1C1 = "at the end." Cells(m + 3, n + 1).Interior.Color = "5287936" 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 = "F" Call AddNewVector End If ' vector ends If m = m1 + 9 Then ' vector 9 Cells(m + 3, n + -1).FormulaR1C1 = "2" Cells(m + 3, n + 0).FormulaR1C1 = "F" Cells(m + 3, n + 2).FormulaR1C1 = "<< -- Resulting force" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "Number of charges:" Cells(m + 4, n + 21).FormulaR1C1 = "The total force on charge Q can be calculated as the vector sum of the forces of each of the " Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 4).FormulaR1C1 = " n =" Cells(m + 5, n + 5).FormulaR1C1 = "=COUNTIF(C[-3],""F_*"")" Cells(m + 5, n + 21).FormulaR1C1 = "charges separately on charge Q:" Cells(m + 6, n + -1).FormulaR1C1 = "=SUMIFS(C[2],C[3],""F_*"")" Cells(m + 6, n + 0).FormulaR1C1 = "=SUMIFS(C[-1],C[2],""F_*"")" Cells(m + 6, n + 1).FormulaR1C1 = "=SUMIFS(C[-1],C[1],""F_*"")" Cells(m + 6, n + 4).FormulaR1C1 = "(to add more charges" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-9]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-9]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-9]C" Cells(m + 7, n + 4).FormulaR1C1 = "press +OBJ.)" Cells(m + 7, n + 27).FormulaR1C1 = "(Eq-19-1)" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-3]C[1]" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-3]C[1]" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-3]C[-2]" Cells(m + 9, n + 2).FormulaR1C1 = "<< -- Components of the resulting force" Cells(m + 9, n + 21).FormulaR1C1 = "where each of the forces is established by Coulomb's law:" 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "2" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "5287936" 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 = " + q1" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 8 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+R6C1" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(RC[1]<0, "" - q""&R[-9]C[-1]/2, "" + q""&R[-9]C[-1]/2)" Cells(m + 3, n + 1).FormulaR1C1 = "0.0001" Cells(m + 3, n + 2).FormulaR1C1 = "=""<< -- Magnitude and color of q""&R[-9]C[-3]/2" Cells(m + 3, n + 27).FormulaR1C1 = "(Eq-19-2)" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "9" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 6, n + -1).FormulaR1C1 = "="" q""&R[-12]C/2&"" = """ Cells(m + 6, n + 0).FormulaR1C1 = "=R[-3]C[1]" Cells(m + 6, n + 21).FormulaR1C1 = "The constant k depends on the system of units and its value is entered in cell G10." Cells(m + 7, n + -1).FormulaR1C1 = "-4" Cells(m + 7, n + 0).FormulaR1C1 = "-4" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 2).FormulaR1C1 = "=""<< -- Position of q""&R[-13]C[-3]/2" Cells(m + 7, n + 21).FormulaR1C1 = "These equations are located respectively for each charge and each coordinate in rows 39, 57, 75 " Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "and 93, and the components of the resulting force in cells A21, B21 and C21." Cells(m + 9, n + -1).FormulaR1C1 = "=R10C1" Cells(m + 9, n + 0).FormulaR1C1 = "=R10C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R10C3" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 21).FormulaR1C1 = "The following table shows the cells to configure the position and magnitude of the charges:" 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "6" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "CHARGE" Cells(m + 11, n + 22).FormulaR1C1 = "MAGNITUDE" Cells(m + 11, n + 23).FormulaR1C1 = "X POSITION" Cells(m + 11, n + 24).FormulaR1C1 = "Y POSITION" Cells(m + 11, n + 25).FormulaR1C1 = "Z POSITION" Cells(m + 3, n + 1).Interior.Color = "255" 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 = "" Call AddNewVector End If ' vector ends If m = m1 + 27 Then ' vector 7 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+R6C1" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "Q" Cells(m + 4, n + 22).FormulaR1C1 = "C6" Cells(m + 4, n + 23).FormulaR1C1 = "A10" Cells(m + 4, n + 24).FormulaR1C1 = "B10" Cells(m + 4, n + 25).FormulaR1C1 = "C10" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "2" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 21).FormulaR1C1 = "q1" Cells(m + 5, n + 22).FormulaR1C1 = "C24" Cells(m + 5, n + 23).FormulaR1C1 = "A28" Cells(m + 5, n + 24).FormulaR1C1 = "B28" Cells(m + 5, n + 25).FormulaR1C1 = "C28" Cells(m + 6, n + 21).FormulaR1C1 = "q2" Cells(m + 6, n + 22).FormulaR1C1 = "C42" Cells(m + 6, n + 23).FormulaR1C1 = "A46" Cells(m + 6, n + 24).FormulaR1C1 = "B46" Cells(m + 6, n + 25).FormulaR1C1 = "C46" Cells(m + 7, n + -1).FormulaR1C1 = "=R10C1" Cells(m + 7, n + 0).FormulaR1C1 = "=R10C2" Cells(m + 7, n + 1).FormulaR1C1 = "=R10C3" Cells(m + 7, n + 21).FormulaR1C1 = "q3" Cells(m + 7, n + 22).FormulaR1C1 = "C60" Cells(m + 7, n + 23).FormulaR1C1 = "A64" Cells(m + 7, n + 24).FormulaR1C1 = "B64" Cells(m + 7, n + 25).FormulaR1C1 = "C64" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "q4" Cells(m + 8, n + 22).FormulaR1C1 = "C78" Cells(m + 8, n + 23).FormulaR1C1 = "A82" Cells(m + 8, n + 24).FormulaR1C1 = "B82" Cells(m + 8, n + 25).FormulaR1C1 = "C82" Cells(m + 9, n + -1).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C-R[-11]C,2)+POWER(R[-9]C[1]-R[-11]C[1],2)+POWER(R[-9]C[2]-R[-11]C[2],2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C[1]*R9C2" Cells(m + 9, n + 0).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C[-1]-R[-11]C[-1],2)+POWER(R[-9]C-R[-11]C,2)+POWER(R[-9]C[1]-R[-11]C[1],2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C*R9C2" Cells(m + 9, n + 1).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C[-2]-R[-11]C[-2],2)+POWER(R[-9]C[-1]-R[-11]C[-1],2)+POWER(R[-9]C-R[-11]C,2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C[-1]*R9C2" Cells(m + 9, n + 2).FormulaR1C1 = "=""F_""&R[-24]C[-3]/2" 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "The color of the charge is modified in the same cell as the magnitude. The magnitude can be negative." Cells(m + 11, n + -1).FormulaR1C1 = "2" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "The forces between each pair of charges are shown as a dotted line." Cells(m + 3, n + 1).Interior.Color = "255" 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 = " + q2" Call AddNewVector End If ' vector ends If m = m1 + 36 Then ' vector 6 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+R6C1" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(RC[1]<0, "" - q""&R[-9]C[-1]/2, "" + q""&R[-9]C[-1]/2)" Cells(m + 3, n + 1).FormulaR1C1 = "0.0001" Cells(m + 3, n + 2).FormulaR1C1 = "=""<< -- Magnitude and color of q""&R[-9]C[-3]/2" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "9" Cells(m + 4, n + 21).FormulaR1C1 = "According to the previous table, modify the magnitude, position and sign of the charges according " Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 21).FormulaR1C1 = "to your criteria and observe the results by pressing the XYZ button or any coordinate button." Cells(m + 6, n + -1).FormulaR1C1 = "="" q""&R[-12]C/2&"" = """ Cells(m + 6, n + 0).FormulaR1C1 = "=R[-3]C[1]" Cells(m + 6, n + 21).FormulaR1C1 = "Identify points of symmetry in space and place the charge Q there." Cells(m + 7, n + -1).FormulaR1C1 = "4" Cells(m + 7, n + 0).FormulaR1C1 = "-4" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 2).FormulaR1C1 = "=""<< -- Position of q""&R[-13]C[-3]/2" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "The model is designed to add more charges in space. To add an additional charge do the following:" Cells(m + 9, n + -1).FormulaR1C1 = "=R10C1" Cells(m + 9, n + 0).FormulaR1C1 = "=R10C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R10C3" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 21).FormulaR1C1 = "1. Press the +OBJ button." 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "2. Enter A100 =3, B100=3, C100=6 for new charge position. Press XYZ to see the result." Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "255" 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 = "" Call AddNewVector End If ' vector ends If m = m1 + 45 Then ' vector 5 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+R6C1" Cells(m + 3, n + 21).FormulaR1C1 = "Press >>C to see the result clearly." Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "To add more charges the procedure is similar." Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "2" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 21).FormulaR1C1 = "The magnitude of the resulting force is shown in cell G14." Cells(m + 7, n + -1).FormulaR1C1 = "=R10C1" Cells(m + 7, n + 0).FormulaR1C1 = "=R10C2" Cells(m + 7, n + 1).FormulaR1C1 = "=R10C3" Cells(m + 7, n + 21).FormulaR1C1 = "Example:" Cells(m + 8, n + -1).FormulaR1C1 = "0" Cells(m + 8, n + 0).FormulaR1C1 = "7" Cells(m + 8, n + 1).FormulaR1C1 = "7" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "Given four charges q1= q2 = q3 = q4 = 3C located at the vertices of a square of side 8." Cells(m + 9, n + -1).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C-R[-11]C,2)+POWER(R[-9]C[1]-R[-11]C[1],2)+POWER(R[-9]C[2]-R[-11]C[2],2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C[1]*R9C2" Cells(m + 9, n + 0).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C[-1]-R[-11]C[-1],2)+POWER(R[-9]C-R[-11]C,2)+POWER(R[-9]C[1]-R[-11]C[1],2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C*R9C2" Cells(m + 9, n + 1).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C[-2]-R[-11]C[-2],2)+POWER(R[-9]C[-1]-R[-11]C[-1],2)+POWER(R[-9]C-R[-11]C,2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C[-1]*R9C2" Cells(m + 9, n + 2).FormulaR1C1 = "=""F_""&R[-24]C[-3]/2" Cells(m + 9, n + 22).FormulaR1C1 = "Find the components of the resultant force on a charge Q = 1C located" 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 22).FormulaR1C1 = "a) in the center of the square" Cells(m + 11, n + -1).FormulaR1C1 = "2" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 22).FormulaR1C1 = "b) at a height of the center of the square z=5" 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 = " + q3" Call AddNewVector End If ' vector ends If m = m1 + 54 Then ' vector 4 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+R6C1" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(RC[1]<0, "" - q""&R[-9]C[-1]/2, "" + q""&R[-9]C[-1]/2)" Cells(m + 3, n + 1).FormulaR1C1 = "0.0001" Cells(m + 3, n + 2).FormulaR1C1 = "=""<< -- Magnitude and color of q""&R[-9]C[-3]/2" Cells(m + 3, n + 22).FormulaR1C1 = "c) on the y axis at y=10" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "9" Cells(m + 4, n + 21).FormulaR1C1 = "Solution:" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 21).FormulaR1C1 = "a)" Cells(m + 5, n + 22).FormulaR1C1 = "Magnitude" Cells(m + 5, n + 24).FormulaR1C1 = "Position" Cells(m + 6, n + -1).FormulaR1C1 = "="" q""&R[-12]C/2&"" = """ Cells(m + 6, n + 0).FormulaR1C1 = "=R[-3]C[1]" Cells(m + 6, n + 21).FormulaR1C1 = "q1 = C24 =" Cells(m + 6, n + 22).FormulaR1C1 = "3" Cells(m + 6, n + 24).FormulaR1C1 = "(A28=0, B28=0, C28=0)" Cells(m + 7, n + -1).FormulaR1C1 = "4" Cells(m + 7, n + 0).FormulaR1C1 = "4" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 2).FormulaR1C1 = "=""<< -- Position of q""&R[-13]C[-3]/2" Cells(m + 7, n + 21).FormulaR1C1 = "q1 = C42 =" Cells(m + 7, n + 22).FormulaR1C1 = "3" Cells(m + 7, n + 24).FormulaR1C1 = "(A46=8, B46=0, C46=0)" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "q1 = C60 =" Cells(m + 8, n + 22).FormulaR1C1 = "3" Cells(m + 8, n + 24).FormulaR1C1 = "(A64=8, B64=8, C64=0)" Cells(m + 9, n + -1).FormulaR1C1 = "=R10C1" Cells(m + 9, n + 0).FormulaR1C1 = "=R10C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R10C3" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 21).FormulaR1C1 = "q1 = C78 =" Cells(m + 9, n + 22).FormulaR1C1 = "3" Cells(m + 9, n + 24).FormulaR1C1 = "(A82=0, B82=8, C82=0)" 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "Q = C6 =" Cells(m + 10, n + 22).FormulaR1C1 = "1" Cells(m + 10, n + 24).FormulaR1C1 = "(A10=4, B10=4, C10=0)" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = " k = G10 =" Cells(m + 11, n + 22).FormulaR1C1 = "8.9" Cells(m + 3, n + 1).Interior.Color = "255" 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 = "" Call AddNewVector End If ' vector ends If m = m1 + 63 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+R6C1" Cells(m + 3, n + 21).FormulaR1C1 = "Press XYZ" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "Observation: we introduce a system of units in which k=8.9." Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "2" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 21).FormulaR1C1 = "RESULT:" Cells(m + 6, n + 21).FormulaR1C1 = "|F| = G9 =" Cells(m + 6, n + 22).FormulaR1C1 = "0" Cells(m + 6, n + 23).FormulaR1C1 = "(due to symmetry)." Cells(m + 7, n + -1).FormulaR1C1 = "=R10C1" Cells(m + 7, n + 0).FormulaR1C1 = "=R10C2" Cells(m + 7, n + 1).FormulaR1C1 = "=R10C3" Cells(m + 8, n + -1).FormulaR1C1 = "0" Cells(m + 8, n + 0).FormulaR1C1 = "3" Cells(m + 8, n + 1).FormulaR1C1 = "3" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "b) " Cells(m + 9, n + -1).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C-R[-11]C,2)+POWER(R[-9]C[1]-R[-11]C[1],2)+POWER(R[-9]C[2]-R[-11]C[2],2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C[1]*R9C2" Cells(m + 9, n + 0).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C[-1]-R[-11]C[-1],2)+POWER(R[-9]C-R[-11]C,2)+POWER(R[-9]C[1]-R[-11]C[1],2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C*R9C2" Cells(m + 9, n + 1).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C[-2]-R[-11]C[-2],2)+POWER(R[-9]C[-1]-R[-11]C[-1],2)+POWER(R[-9]C-R[-11]C,2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C[-1]*R9C2" Cells(m + 9, n + 2).FormulaR1C1 = "=""F_""&R[-24]C[-3]/2" Cells(m + 9, n + 21).FormulaR1C1 = "Q = C6 =" Cells(m + 9, n + 22).FormulaR1C1 = "1" Cells(m + 9, n + 24).FormulaR1C1 = "(A10=4, B10=4, C10=5)" 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "RESULT:" Cells(m + 11, n + -1).FormulaR1C1 = "2" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "|F| = G9 =" Cells(m + 11, n + 22).FormulaR1C1 = "1.24" 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 = " + q4" Call AddNewVector End If ' vector ends If m = m1 + 72 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+R6C1" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(RC[1]<0, "" - q""&R[-9]C[-1]/2, "" + q""&R[-9]C[-1]/2)" Cells(m + 3, n + 1).FormulaR1C1 = "0.0001" Cells(m + 3, n + 2).FormulaR1C1 = "=""<< -- Magnitude and color of q""&R[-9]C[-3]/2" Cells(m + 3, n + 21).FormulaR1C1 = "Fx = A21 =" Cells(m + 3, n + 22).FormulaR1C1 = "0" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "9" Cells(m + 4, n + 21).FormulaR1C1 = "Fy = B21 = " Cells(m + 4, n + 22).FormulaR1C1 = "0" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 21).FormulaR1C1 = "Fz = C21 = " Cells(m + 5, n + 22).FormulaR1C1 = "1.24" Cells(m + 6, n + -1).FormulaR1C1 = "="" q""&R[-12]C/2&"" = """ Cells(m + 6, n + 0).FormulaR1C1 = "=R[-3]C[1]" Cells(m + 6, n + 21).FormulaR1C1 = "RESULT:" Cells(m + 7, n + -1).FormulaR1C1 = "-4" Cells(m + 7, n + 0).FormulaR1C1 = "4" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 2).FormulaR1C1 = "=""<< -- Position of q""&R[-13]C[-3]/2" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "c) " Cells(m + 9, n + -1).FormulaR1C1 = "=R10C1" Cells(m + 9, n + 0).FormulaR1C1 = "=R10C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R10C3" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 21).FormulaR1C1 = "Q = C6 =" Cells(m + 9, n + 22).FormulaR1C1 = "1" Cells(m + 9, n + 24).FormulaR1C1 = "(A10=0, B10=10, C10=0)" 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "RESULT:" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "|F| = G9 =" Cells(m + 11, n + 22).FormulaR1C1 = "7.18" Cells(m + 3, n + 1).Interior.Color = "255" 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 = "" Call AddNewVector End If ' vector ends If m = m1 + 81 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+R6C1" Cells(m + 3, n + 21).FormulaR1C1 = "Fx = A21 =" Cells(m + 3, n + 22).FormulaR1C1 = "-0.5" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "Fy = B21 = " Cells(m + 4, n + 22).FormulaR1C1 = "7.2" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "2" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 21).FormulaR1C1 = "Fz = C21 = " Cells(m + 5, n + 22).FormulaR1C1 = "0" Cells(m + 6, n + 21).FormulaR1C1 = "RESULT:" Cells(m + 7, n + -1).FormulaR1C1 = "=R10C1" Cells(m + 7, n + 0).FormulaR1C1 = "=R10C2" Cells(m + 7, n + 1).FormulaR1C1 = "=R10C3" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "Exercise:" Cells(m + 9, n + -1).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C-R[-11]C,2)+POWER(R[-9]C[1]-R[-11]C[1],2)+POWER(R[-9]C[2]-R[-11]C[2],2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C[1]*R9C2" Cells(m + 9, n + 0).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C[-1]-R[-11]C[-1],2)+POWER(R[-9]C-R[-11]C,2)+POWER(R[-9]C[1]-R[-11]C[1],2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C*R9C2" Cells(m + 9, n + 1).FormulaR1C1 = "=1/(POWER(POWER(R[-9]C[-2]-R[-11]C[-2],2)+POWER(R[-9]C[-1]-R[-11]C[-1],2)+POWER(R[-9]C-R[-11]C,2),3/2))*(R[-9]C-R[-11]C)*R10C7*R[-12]C[-1]*R9C2" Cells(m + 9, n + 2).FormulaR1C1 = "=""F_""&R[-24]C[-3]/2" 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "1. Using the +OBJ button, construct a charged line composed of 20 electric charges of equal magnitude " Cells(m + 11, n + -1).FormulaR1C1 = "2" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "and develop the model to study the force of that line on the charge Q, which is located at a " 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 = 10 End If ' vector ends If m = m1 + 81 Then Cells(m + 12, n + 21).FormulaR1C1 = "certain distance. Compare the results of the model with calculations made using integrals." Cells(m + 14, n + 21).FormulaR1C1 = "2. Build the model to study the force of a dipole on a charge Q." Cells(m + 15, n + 22).FormulaR1C1 = "Note: Use the -OBJ button to remove charges." Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub