Sub Project_39_EN(ByVal VecType, m, n, m1, n1 As Integer) ' 39_Field Flux, Gausss Law _EN ' Updated: 5/10/25 ' Created by: Becerra Ariel, Villamizar Abiud, Yepes Alexander (1/10/25) ' Modified by: _________________ ' This file contains the code for your new ScienSolar project. ' ============================================================================== ' PROJECT CODE: 39 ' ' INTEGRATION INSTRUCTIONS: ' Note 1: The project number (39) in the function name must match the entry in the CONFIG sheet project list. Update if necessary. ' Note 2: This code will be integrated into the main VBA project to automate project loading and execution. ' Note 3: Generated formulas and values are limited to the first 30 columns. Keep all project data within this range for optimal performance. ' ' STEP-BY-STEP INTEGRATION: ================== ' 1. CONFIG Sheet Setup (for new projects): ' - Navigate to the CONFIG sheet and add a consecutive number to the last row of the projects list (column C, from row 35) ' - Add a descriptive project name in the corresponding language column ' - Replace (if it doesn't match) the number in Sub Project_48 with the new number from the list ' 2. Numbering Validation: ' - Ensure projects in the CONFIG sheet maintain ascending numerical order ' - Only integers are allowed ' 3. VBA Editor Preparation: ' - Open VBA Editor (Alt+F11 Windows / Fn+Option+F11 macOS) ' - Close other workbooks to avoid accidental code placement ' - In the Project Explorer, select an existing module with available space ' - Alternatively, insert a new module (Insert -- > Module) ' 5. Code Implementation: ' - Select all code in this file and copy it ' - Paste at the end of the selected module's code (for new projects) ' - Replace de old code with the new one (for existing projects). Verify the code ' 6. Project Testing: ' - Return to the CONFIG sheet and click 'New Sheet' ' - Select your project from the list and click '+Vector' ' - Large projects require repeated '+Vector' button presses when loading. ' - Verify successful loading in the new sheet ' SUPPORT AND UPDATES: ===================== ' Visit www.sciensolar.com for latest updates and documentation ' © ScienSolar - Advanced Solar Project Management ' ============================================================================== ' 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 = "900" Cells(m1 + 0, n1 + 6).FormulaR1C1 = "=CONFIG!R3C8" Cells(m1 + 0, n1 + 7).FormulaR1C1 = "1" Cells(m1 + 0, n1 + 8).FormulaR1C1 = "Becerra Ariel, Villamizar Abiud, Yepes Alexander (1/10/25)" Cells(m1 + 1, n1 + 2).FormulaR1C1 = "=CONFIG!R4C4" Cells(m1 + 1, n1 + 3).FormulaR1C1 = "500" 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 = "20" Cells(m1 + 2, n1 + 0).FormulaR1C1 = "t = 0,7070312 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 = "E" Cells(m1 + 3, n1 + 1).FormulaR1C1 = "15" 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 = "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; c) add the project name and number to the list on the CONFIG sheet; d) 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) & _ " 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 ' Código para recrear controles Dim ws As Worksheet Set ws = ThisWorkbook.ActiveSheet If m = 3 Then PatronW = ActiveSheet.Cells(1, 1).Width PatronH = ActiveSheet.Cells(1, 1).Height ' ComboBox Set dd = ws.DropDowns.Add(Left:=Range("E16").Left + Range("$E$16").Width * 0, Top:=Range("$E$16").Top, Width:=Range("$E$16").Width * 1.5, Height:=Range("$E$16").Height * 1) With dd .Placement = 2 .name = "ViewType" .LinkedCell = "$X$19" .AddItem "1. None" .AddItem "2: Flat " .AddItem "3. Cylindrical" .AddItem "4. Spherical" .ListFillRange = "$W$20:$W$23" .Value = 1 .Display3DShading = True End With Set dd = Nothing ' Opton button Set opt = ws.OptionButtons.Add(Left:=Range("E11").Left + Range("$E$11").Width * 0.5, Top:=Range("$E$11").Top, Width:=Range("$E$11").Width * 0.5, Height:=Range("$E$11").Height * 1.5) opt.Caption = "" With opt .name = "YesOptionButt" .LinkedCell = "$G$11" End With Set opt = Nothing ' Opton button Set opt = ws.OptionButtons.Add(Left:=Range("F11").Left + Range("$F$11").Width * 0.5, Top:=Range("$F$11").Top, Width:=Range("$F$11").Width * 0.5, Height:=Range("$F$11").Height * 1.5) opt.Caption = "" With opt .name = "NoOptionButt" .LinkedCell = "$G$11" End With Set opt = Nothing ' Button ws.Buttons.Add(Left:=Range("G11").Left + Range("$G$11").Width * 0, Top:=Range("$G$11").Top, Width:=Range("$G$11").Width * 1, Height:=Range("$G$11").Height * 1.5).Select With Selection .name = "DelTableButt" .OnAction = "ShowHideVecConf" .text = "Clean Data" End With ' ComboBox Set dd = ws.DropDowns.Add(Left:=Range("F16").Left + Range("$F$16").Width * 0.5, Top:=Range("$F$16").Top, Width:=Range("$F$16").Width * 1.5, Height:=Range("$F$16").Height * 1) With dd .Placement = 2 .name = "Drop Down 1540" .LinkedCell = "$W$15" .AddItem "Show" .AddItem "Hide" .ListFillRange = "$V$14:$V$15" .Value = 1 .Display3DShading = False End With Set dd = Nothing ' ComboBox Set dd = ws.DropDowns.Add(Left:=Range("F13").Left + Range("$F$13").Width * 0.5, Top:=Range("$F$13").Top, Width:=Range("$F$13").Width * 1.5, Height:=Range("$F$13").Height * 1) With dd .Placement = 2 .name = "Drop Down 1541" .LinkedCell = "$W$14" .AddItem "Show" .AddItem "Hide" .ListFillRange = "$V$14:$V$15" .Value = 1 .Display3DShading = False End With Set dd = Nothing ' SpinButton Set spin = ws.Spinners.Add(Left:=Range("G26").Left + Range("$G$26").Width * 0, Top:=Range("$G$26").Top, Width:=Range("$G$26").Width * 0.5, Height:=Range("$G$26").Height * 1) spin.name = "Spinner 1871" spin.LinkedCell = "$G$26" spin.Min = 0 spin.max = 30000 spin.Value = 1 spin.SmallChange = 1 spin.Value = 1 spin.OnAction = "Rotate" Set spin = Nothing ' SpinButton Set spin = ws.Spinners.Add(Left:=Range("G33").Left + Range("$G$33").Width * 0, Top:=Range("$G$33").Top, Width:=Range("$G$33").Width * 0.5, Height:=Range("$G$33").Height * 1) spin.name = "Spinner 1872" spin.LinkedCell = "$G$33" spin.Min = 0 spin.max = 30000 spin.Value = 0 spin.SmallChange = 1 spin.Value = 0 spin.OnAction = "Rotate" Set spin = Nothing ' SpinButton Set spin = ws.Spinners.Add(Left:=Range("G34").Left + Range("$G$34").Width * 0, Top:=Range("$G$34").Top, Width:=Range("$G$34").Width * 0.5, Height:=Range("$G$34").Height * 1) spin.name = "Spinner 1873" spin.LinkedCell = "$G$34" spin.Min = 0 spin.max = 30000 spin.Value = 90 spin.SmallChange = 1 spin.Value = 90 spin.OnAction = "Rotate" Set spin = Nothing ' SpinButton Set spin = ws.Spinners.Add(Left:=Range("G36").Left + Range("$G$36").Width * 0, Top:=Range("$G$36").Top, Width:=Range("$G$36").Width * 0.5, Height:=Range("$G$36").Height * 1) spin.name = "Spinner 1874" spin.LinkedCell = "$G$36" spin.Min = 0 spin.max = 30000 spin.Value = 10 spin.SmallChange = 1 spin.Value = 10 spin.OnAction = "Rotate" Set spin = Nothing ' Button ws.Buttons.Add(Left:=Range("H11").Left + Range("$H$11").Width * 0, Top:=Range("$H$11").Top, Width:=Range("$H$11").Width * 0.5, Height:=Range("$H$11").Height * 1.5).Select With Selection .name = "Button 2475" .OnAction = "Rotate" .text = "" & ChrW(8629) & " " End With ' Button ws.Buttons.Add(Left:=Range("H16").Left + Range("$H$16").Width * 0, Top:=Range("$H$16").Top, Width:=Range("$H$16").Width * 0.5, Height:=Range("$H$16").Height * 1).Select With Selection .name = "Button 4399" .OnAction = "Rotate" .text = "" & ChrW(8629) & " " End With ' Button ws.Buttons.Add(Left:=Range("H13").Left + Range("$H$13").Width * 0, Top:=Range("$H$13").Top, Width:=Range("$H$13").Width * 0.5, Height:=Range("$H$13").Height * 1).Select With Selection .name = "Button 4459" .OnAction = "Rotate" .text = "" & ChrW(8629) & " " End With ' Button ws.Buttons.Add(Left:=Range("H38").Left + Range("$H$38").Width * 0, Top:=Range("$H$38").Top, Width:=Range("$H$38").Width * 0.5, Height:=Range("$H$38").Height * 1).Select With Selection .name = "AddButt1" .OnAction = "AddObject" .text = "+ OBJ" End With ' Button ws.Buttons.Add(Left:=Range("H39").Left + Range("$H$39").Width * 0, Top:=Range("$H$39").Top, Width:=Range("$H$39").Width * 0.5, Height:=Range("$H$39").Height * 1).Select With Selection .name = "DelButt1" .OnAction = "AddObject" .text = "- OBJ" End With End If Dim p As Integer For p = 1 To 0 If Range("A5").Value = "Next sub_i" Then Exit Sub Application.Run "Project_39_" & p & "_EN", VecType, m, n, m1, n1 ' Next p If m = m1 + 0 Then ' vector 4 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "E" Cells(m + 3, n + 1).FormulaR1C1 = "15" 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 + 3, n + 9).FormulaR1C1 = "Vectors visually modified (magnitude unchanged). Adjust scale in B8" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 1).FormulaR1C1 = "=IF(R[12]C[21]=1,"""",IF(R[12]C[21]=2,R[14]C[19],IF(R[12]C[21]=3,R[15]C[19],IF(R[12]C[21]=4,R[16]C[19],IF(R[12]C[21]=5,R[17]C[19],"""")))))" Cells(m + 4, n + 2).FormulaR1C1 = "Field Flux Through Surfaces" Cells(m + 4, n + 12).FormulaR1C1 = "FIELD FLUX THROUGH A SURFACE" Cells(m + 4, n + 24).FormulaR1C1 = "SETUP AND INSTRUCTIONS" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "60*1" Cells(m + 5, n + 1).FormulaR1C1 = "=R[6]C[20]-1" Cells(m + 5, n + 12).FormulaR1C1 = "The Gauss-Ostrogradsky Theorem" Cells(m + 6, n + -1).FormulaR1C1 = "=SUMIFS(C[2],C[3],""E_*"")" Cells(m + 6, n + 0).FormulaR1C1 = "=SUMIFS(C[-1],C[2],""E_*"")" Cells(m + 6, n + 1).FormulaR1C1 = "=SUMIFS(C[-1],C[1],""E_*"")" Cells(m + 6, n + 6).FormulaR1C1 = "=IF(R[10]C[16]=1,"" Selecting a surface in E16"",IF(R[10]C[16]=2,"" Edit the area in cells Y10 -AC12 -- >> "",IF(R[10]C[16]=3,"" Edit the area in cells Y12 -AC14) -- >>. "",IF(R[10]C[16]=4,"" Edit the area in cells Y13 - AC15) --- >> "",""""))))" Cells(m + 6, n + 20).FormulaR1C1 = "//////////////////////////////////////////// FORMULAS OF. SURFACE (Y10 - AC15) ///////////////////////////////////////" Cells(m + 6, n + 28).FormulaR1C1 = " Range:" 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 + 2).FormulaR1C1 = "/ / / / / / / / / / FLUX / / / / / / / / / / / " Cells(m + 7, n + 4).FormulaR1C1 = "" & ChrW(-10187) & ChrW(-8515) & " " & ChrW(8776) & " " & ChrW(8721) & "E" & ChrW(7522) & " " & ChrW(916) & "S" & ChrW(7522) & " =" Cells(m + 7, n + 5).FormulaR1C1 = "=R[7]C[23]" Cells(m + 7, n + 6).FormulaR1C1 = "=IF(AND(R[7]C[-7]>3000,R[3033]C[25]=""""),"" << -- Possible inaccuracy! EXTEND THE FORMULA TO THE END OF COLUMN AE, press Clear data and try again"", IF(AND(R[3033]C[28]<>"""",R[3033]C[25]=""""),"" < -- Possible inaccuracy! Please press Clear data and try again. "",IF(COUNTIF(C[25],"">0"")>R[7]C[-7],"" < -- Possible inaccuracy! Please press Clear data and try again. "","""")))" Cells(m + 7, n + 22).FormulaR1C1 = " x_ini =" Cells(m + 7, n + 23).FormulaR1C1 = "-10" Cells(m + 7, n + 24).FormulaR1C1 = " x_fin =" Cells(m + 7, n + 25).FormulaR1C1 = "10" Cells(m + 7, n + 26).FormulaR1C1 = " Step:" Cells(m + 7, n + 27).FormulaR1C1 = "2" Cells(m + 7, n + 28).FormulaR1C1 = "=RC[-3]-RC[-5]+RC[-1]" Cells(m + 8, n + -1).FormulaR1C1 = "4.92403876506104" Cells(m + 8, n + 0).FormulaR1C1 = "-0.868240888334652" Cells(m + 8, n + 1).FormulaR1C1 = "9" Cells(m + 8, n + 2).FormulaR1C1 = "Calculate:" Cells(m + 8, n + 3).FormulaR1C1 = " YES" Cells(m + 8, n + 4).FormulaR1C1 = " NO" Cells(m + 8, n + 5).FormulaR1C1 = "2" Cells(m + 8, n + 22).FormulaR1C1 = " y_ini =" Cells(m + 8, n + 23).FormulaR1C1 = "-10" Cells(m + 8, n + 24).FormulaR1C1 = " y_fin =" Cells(m + 8, n + 25).FormulaR1C1 = "10" Cells(m + 8, n + 26).FormulaR1C1 = " Step:" Cells(m + 8, n + 27).FormulaR1C1 = "2" Cells(m + 8, n + 28).FormulaR1C1 = "=RC[-3]-RC[-5]+RC[-1]" 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 + 20).FormulaR1C1 = "Color:" Cells(m + 9, n + 21).FormulaR1C1 = "0" Cells(m + 9, n + 22).FormulaR1C1 = " z_ini =" Cells(m + 9, n + 23).FormulaR1C1 = "=IF(R[7]C[-1]=3,5,10)" Cells(m + 9, n + 24).FormulaR1C1 = " z_fin =" Cells(m + 9, n + 25).FormulaR1C1 = "10" Cells(m + 9, n + 26).FormulaR1C1 = " Step:" Cells(m + 9, n + 27).FormulaR1C1 = "=IF(RC[-4]=RC[-2],0,2)" Cells(m + 9, n + 28).FormulaR1C1 = "=RC[-3]-RC[-5]+RC[-1]" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "=IF(R[-2]C[5]=1,15,0)" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 2).FormulaR1C1 = "/ / / / / / / / / / FIELD / / / / / / / / / / / " Cells(m + 10, n + 20).FormulaR1C1 = "Field/Surface" Cells(m + 10, n + 22).FormulaR1C1 = " " & ChrW(-10187) & ChrW(-8601) & "_ini =" Cells(m + 10, n + 23).FormulaR1C1 = "5" Cells(m + 10, n + 24).FormulaR1C1 = " " & ChrW(-10187) & ChrW(-8601) & "_fin =" Cells(m + 10, n + 25).FormulaR1C1 = "5" Cells(m + 10, n + 26).FormulaR1C1 = " Step:" Cells(m + 10, n + 27).FormulaR1C1 = "1" Cells(m + 10, n + 28).FormulaR1C1 = "=RC[-3]-RC[-5]" Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "=IF(R[-3]C[5]=1,36,0)" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(OR(R[36]C[1]="""",R[36]C[1]>3,R[36]C[1]=0),"" |E| ="","""")" Cells(m + 11, n + 5).FormulaR1C1 = "=SQRT(R[-2]C[-6]^2+R[-2]C[-5]^2+R[-2]C[-4]^2)" Cells(m + 11, n + 20).FormulaR1C1 = "Show" Cells(m + 11, n + 21).FormulaR1C1 = "1" Cells(m + 11, n + 22).FormulaR1C1 = " " & ChrW(-10187) & ChrW(-8257) & "_ini =" Cells(m + 11, n + 23).FormulaR1C1 = "0" Cells(m + 11, n + 24).FormulaR1C1 = " " & ChrW(-10187) & ChrW(-8257) & "_fin =" Cells(m + 11, n + 25).FormulaR1C1 = "=360-RC[2]" Cells(m + 11, n + 26).FormulaR1C1 = " Step:" Cells(m + 11, n + 27).FormulaR1C1 = "=IF(R[5]C[-5]=4,15,10)" Cells(m + 11, n + 28).FormulaR1C1 = "=RC[-3]-RC[-5]+RC[-1]" Cells(m + 3, n + 1).Interior.Color = "15773696" Cells(m + 3, n + 1).Font.Size = "14" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "S" Call AddNewVector End If ' vector ends If m = m1 + 9 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 = "S" Cells(m + 3, n + 1).FormulaR1C1 = "15" Cells(m + 3, n + 2).FormulaR1C1 = "/ / / / / / / / / / SURFACE / / / / / / / / / / / / / / / / / / / / " Cells(m + 3, n + 20).FormulaR1C1 = "Hide" Cells(m + 3, n + 21).FormulaR1C1 = "1" Cells(m + 3, n + 22).FormulaR1C1 = " " & ChrW(-10187) & ChrW(-8271) & "_ini =" Cells(m + 3, n + 23).FormulaR1C1 = "0" Cells(m + 3, n + 24).FormulaR1C1 = " " & ChrW(-10187) & ChrW(-8271) & "_fin =" Cells(m + 3, n + 25).FormulaR1C1 = "=180-RC[2]" Cells(m + 3, n + 26).FormulaR1C1 = " Step:" Cells(m + 3, n + 27).FormulaR1C1 = "=IF(R[4]C[-5]=4,15,10)" Cells(m + 3, n + 28).FormulaR1C1 = "=RC[-3]-RC[-5]+RC[-1]" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 1).FormulaR1C1 = "=IF(R[3]C[21]=1,"""",IF(R[3]C[21]=2,R[5]C[19],IF(R[3]C[21]=3,R[6]C[19],IF(R[3]C[21]=4,R[7]C[19],IF(R[3]C[21]=5,R[8]C[19],"""")))))" Cells(m + 4, n + 2).FormulaR1C1 = "Type:" Cells(m + 4, n + 20).FormulaR1C1 = "________________________________________________________________________________________________" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "=R[-2]C[20]-1" Cells(m + 5, n + 4).FormulaR1C1 = " x_o =" Cells(m + 5, n + 5).FormulaR1C1 = "0" Cells(m + 5, n + 20).FormulaR1C1 = " k =" Cells(m + 5, n + 21).FormulaR1C1 = "8990000000" Cells(m + 5, n + 22).FormulaR1C1 = " " & ChrW(-10187) & ChrW(-8448) & ChrW(8320) & " =" Cells(m + 5, n + 23).FormulaR1C1 = "0.000000000008854" Cells(m + 5, n + 26).FormulaR1C1 = " " & ChrW(-10187) & ChrW(-8515) & " = " & ChrW(8748) & "E " & ChrW(183) & " dS " & ChrW(8776) & " " & ChrW(8721) & " E " & ChrW(7522) & " " & ChrW(183) & " " & ChrW(916) & "S " & ChrW(7522) & " =" Cells(m + 5, n + 28).FormulaR1C1 = "=SUM(C[3])" Cells(m + 6, n + -1).FormulaR1C1 = "2.22044604925031E-16" Cells(m + 6, n + 0).FormulaR1C1 = "-2.73114864057789E-14" Cells(m + 6, n + 1).FormulaR1C1 = "0" Cells(m + 6, n + 2).FormulaR1C1 = " Surface Displacement:" Cells(m + 6, n + 4).FormulaR1C1 = " y_o =" Cells(m + 6, n + 5).FormulaR1C1 = "0" Cells(m + 6, n + 20).FormulaR1C1 = " _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ " 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 = " z_o =" Cells(m + 7, n + 5).FormulaR1C1 = "0" Cells(m + 7, n + 20).FormulaR1C1 = "Selected surface:" Cells(m + 7, n + 22).FormulaR1C1 = "1" Cells(m + 7, n + 24).FormulaR1C1 = "Formula" Cells(m + 7, n + 26).FormulaR1C1 = "|" Cells(m + 7, n + 27).FormulaR1C1 = "Normalizing (for " & ChrW(916) & "S " & ChrW(7522) & ")" Cells(m + 8, n + -1).FormulaR1C1 = "4.92403876506104" Cells(m + 8, n + 0).FormulaR1C1 = "-0.868240888334652" Cells(m + 8, n + 1).FormulaR1C1 = "9" Cells(m + 8, n + 21).FormulaR1C1 = "1. None" Cells(m + 8, n + 23).FormulaR1C1 = " x" Cells(m + 8, n + 24).FormulaR1C1 = " y" Cells(m + 8, n + 25).FormulaR1C1 = " z" Cells(m + 8, n + 26).FormulaR1C1 = " i" Cells(m + 8, n + 27).FormulaR1C1 = " j" Cells(m + 8, n + 28).FormulaR1C1 = " k" Cells(m + 9, n + -1).FormulaR1C1 = "=IFERROR(VLOOKUP(R19C24,R21C24:R23C30,5,FALSE),0)" Cells(m + 9, n + 0).FormulaR1C1 = "=IFERROR(VLOOKUP(R19C24,R21C24:R23C30,6,FALSE),0)" Cells(m + 9, n + 1).FormulaR1C1 = "=IFERROR(VLOOKUP(R19C24,R21C24:R23C30,7,FALSE),0)" Cells(m + 9, n + 4).FormulaR1C1 = " Area =" Cells(m + 9, n + 5).FormulaR1C1 = "=MAX(R[3]C[18],R[3]C[20],R[3]C[22])" Cells(m + 9, n + 20).FormulaR1C1 = "=""o[""&R[-11]C[7]&""]x=[""&R[-11]C[3]&"";""&R[-11]C[5]&""]o2[""&R[-10]C[7]&""]y=[""&R[-10]C[3]&"";""&R[-10]C[5]&""]o3[""&R[-9]C[7]&""]z=[""&R[-9]C[3]&"";""&R[-9]C[5]&""]color=[""&R[-9]C[1]&""]origin[cart.]=[""&R[-4]C[-15]&"";""&R[-3]C[-15]&"";""&R[-2]C[-15]&""]FieldLayers[0]FieldLayersRange=[0;0]LayerThickness=[1]tfactor=0,008s""" Cells(m + 9, n + 21).FormulaR1C1 = "2: Flat " Cells(m + 9, n + 22).FormulaR1C1 = "2" Cells(m + 9, n + 23).FormulaR1C1 = "0" Cells(m + 9, n + 24).FormulaR1C1 = "0" Cells(m + 9, n + 25).FormulaR1C1 = "1" Cells(m + 9, n + 26).FormulaR1C1 = "=RC[-3]/SQRT(RC[-3]^2+RC[-2]^2+RC[-1]^2)*R[4]C[-3]" Cells(m + 9, n + 27).FormulaR1C1 = "=RC[-3]/SQRT(RC[-4]^2+RC[-3]^2+RC[-2]^2)*R[4]C[-4]" Cells(m + 9, n + 28).FormulaR1C1 = "=RC[-3]/SQRT(RC[-5]^2+RC[-4]^2+RC[-3]^2)*R[4]C[-5]" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "=R[-9]C" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 20).FormulaR1C1 = "=""c[""&R[-9]C[7]&""]rho=[""&R[-9]C[3]&"";""&R[-9]C[5]&""]c2[""&R[-8]C[7]&""]phi=[""&R[-8]C[3]&"";""&R[-8]C[5]&""]c3[""&R[-10]C[7]&""]z=[""&R[-10]C[3]&"";""&R[-10]C[5]&""]color=[""&R[-10]C[1]&""]origin[cart.]=[""&R[-5]C[-15]&"";""&R[-4]C[-15]&"";""&R[-3]C[-15]&""]FieldLayers[0]FieldLayersRange=[0;0]LayerThickness=[1]tfactor=0,008s""" Cells(m + 10, n + 21).FormulaR1C1 = "3. Cylindrical" Cells(m + 10, n + 22).FormulaR1C1 = "3" Cells(m + 10, n + 23).FormulaR1C1 = "=(R[-5]C[-2]*(R[-2]C[-24]-R[-5]C[-18]))/((R[-2]C[-23]-R[-4]C[-18])^2+(R[-2]C[-22]-R[-3]C[-18])^2)" Cells(m + 10, n + 24).FormulaR1C1 = "=(R[-5]C[-3]*(R[-2]C[-24]-R[-4]C[-19]))/((R[-2]C[-24]-R[-4]C[-19])^2+(R[-2]C[-23]-R[-3]C[-19])^2)" Cells(m + 10, n + 25).FormulaR1C1 = "0" Cells(m + 10, n + 26).FormulaR1C1 = "=RC[-3]/SQRT(RC[-3]^2+RC[-2]^2+RC[-1]^2)*R[3]C[-1]" Cells(m + 10, n + 27).FormulaR1C1 = "=RC[-3]/SQRT(RC[-4]^2+RC[-3]^2+RC[-2]^2)*R[3]C[-2]" Cells(m + 10, n + 28).FormulaR1C1 = "=RC[-3]/SQRT(RC[-5]^2+RC[-4]^2+RC[-3]^2)*R[3]C[-3]" Cells(m + 11, n + -1).FormulaR1C1 = "2" Cells(m + 11, n + 0).FormulaR1C1 = "=R[-9]C+10" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 20).FormulaR1C1 = "=""s[""&R[-10]C[7]&""]r=[""&R[-10]C[3]&"";""&R[-10]C[5]&""]s2[""&R[-9]C[7]&""]phi=[""&R[-9]C[3]&"";""&R[-9]C[5]&""]s3[""&R[-8]C[7]&""]theta=[""&R[-8]C[3]&"";""&R[-8]C[5]&""]color=[""&R[-11]C[1]&""]origin[cart.]=[""&R[-6]C[-15]&"";""&R[-5]C[-15]&"";""&R[-4]C[-15]&""]FieldLayers[0]FieldLayersRange=[0;0]LayerThickness=[1]tfactor=0,008s""" Cells(m + 11, n + 21).FormulaR1C1 = "4. Spherical" Cells(m + 11, n + 22).FormulaR1C1 = "4" Cells(m + 11, n + 23).FormulaR1C1 = "=(R[-3]C[-24]-R[-6]C[-18])*R[-6]C[-2]/POWER((R[-3]C[-24]-R[-6]C[-18])^2+(R[-3]C[-23]-R[-5]C[-18])^2+(R[-3]C[-22]-R[-4]C[-18])^2,3/2)" Cells(m + 11, n + 24).FormulaR1C1 = "=(R[-3]C[-24]-R[-5]C[-19])*R[-6]C[-3]/POWER((R[-3]C[-25]-R[-6]C[-19])^2+(R[-3]C[-24]-R[-5]C[-19])^2+(R[-3]C[-23]-R[-4]C[-19])^2,3/2)" Cells(m + 11, n + 25).FormulaR1C1 = "=(R[-3]C[-24]-R[-4]C[-20])*R[-6]C[-4]/POWER((R[-3]C[-26]-R[-6]C[-20])^2+(R[-3]C[-25]-R[-5]C[-20])^2+(R[-3]C[-24]-R[-4]C[-20])^2,3/2)" Cells(m + 11, n + 26).FormulaR1C1 = "=RC[-3]/SQRT(RC[-3]^2+RC[-2]^2+RC[-1]^2)*R[-10]C[-1]^2*R[-9]C[1]*PI()/180*(COS(ACOS(RC[-1]/SQRT(RC[-3]^2+RC[-2]^2+RC[-1]^2)))-COS(ACOS(RC[-1]/SQRT(RC[-3]^2+RC[-2]^2+RC[-1]^2))+R[-8]C[1]*PI()/180))" Cells(m + 11, n + 27).FormulaR1C1 = "=RC[-3]/SQRT(RC[-4]^2+RC[-3]^2+RC[-2]^2)*R[-10]C[-2]^2*R[-9]C*PI()/180*(COS(ACOS(RC[-2]/SQRT(RC[-4]^2+RC[-3]^2+RC[-2]^2)))-COS(ACOS(RC[-2]/SQRT(RC[-4]^2+RC[-3]^2+RC[-2]^2))+R[-8]C*PI()/180))" Cells(m + 11, n + 28).FormulaR1C1 = "=RC[-3]/SQRT(RC[-5]^2+RC[-4]^2+RC[-3]^2)*R[-10]C[-3]^2*R[-9]C[-1]*PI()/180*(COS(ACOS(RC[-3]/SQRT(RC[-5]^2+RC[-4]^2+RC[-3]^2)))-COS(ACOS(RC[-3]/SQRT(RC[-5]^2+RC[-4]^2+RC[-3]^2))+R[-8]C[-1]*PI()/180))" Cells(m + 3, n + 1).Interior.Color = "255" Cells(m + 3, n + 1).Font.Size = "14" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "L1" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(LEFT(R[5]C[4],1)=""x"",""L""&R24C7,IF(R25C7>0,"" + "", "" - ""))" Cells(m + 3, n + 1).FormulaR1C1 = "=IF(R[-9]C[-1]=""S"",1,R[-18]C+1)" Cells(m + 3, n + 2).FormulaR1C1 = "/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /" Cells(m + 3, n + 4).FormulaR1C1 = "LINE Nr. =" Cells(m + 3, n + 5).FormulaR1C1 = "1" Cells(m + 3, n + 20).FormulaR1C1 = "Surface area:" Cells(m + 3, n + 22).FormulaR1C1 = "Flat:" Cells(m + 3, n + 23).FormulaR1C1 = "=IF(R[-5]C[-1]=2,IF(R[-12]C[5]=0,R[-13]C[5]*R[-14]C[5],IF(R[-13]C[5]=0,R[-14]C[5]*R[-12]C[5],IF(R[-14]C[5]=0,R[-13]C[5]*R[-12]C[5],""""))),"""")" Cells(m + 3, n + 24).FormulaR1C1 = "Cylindrical:" Cells(m + 3, n + 25).FormulaR1C1 = "=IF(R[-5]C[-3]=3,IF(R[-12]C[3]=0,PI()*(R[-11]C^2-R[-11]C[-2]^2)*R[-10]C[3]/360,IF(R[-11]C[3]=0,2*PI()*R[-11]C*R[-12]C[3]*R[-10]C[3]/360,IF(R[-10]C[3]=0,R[-12]C[3]*R[-11]C[3],""""))),"""")" Cells(m + 3, n + 26).FormulaR1C1 = "Spherical:" Cells(m + 3, n + 27).FormulaR1C1 = "=IF(R[-5]C[-5]=4,IF(R[-11]C[1]=0,4*PI()*R[-11]C[-2]^2*R[-10]C[1]/360*R[-9]C[1]/180,IF(R[-10]C[1]=0,PI()*(R[-11]C[-2]^2-R[-11]C[-4]^2)*R[-9]C[1]/180,IF(R[-9]C[1]=0,PI()*(R[-11]C[-2]^2-R[-11]C[-4]^2)*R[-10]C[1]/360,""""))),"""")" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "=R40C7" Cells(m + 4, n + 4).FormulaR1C1 = "=""Q_""&R[-1]C[1]" Cells(m + 4, n + 5).FormulaR1C1 = "0.000001" Cells(m + 4, n + 20).FormulaR1C1 = "Area per unit vector:" Cells(m + 4, n + 23).FormulaR1C1 = "=IFERROR(R[-1]C/R17C1,0)" Cells(m + 4, n + 25).FormulaR1C1 = "=IFERROR(R[-1]C/R17C1,0)" Cells(m + 4, n + 26).FormulaR1C1 = " Note: for each " & ChrW(916) & "S " & ChrW(7522) & " of spherical:" 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 = "dL =" Cells(m + 5, n + 5).FormulaR1C1 = "1" Cells(m + 5, n + 20).FormulaR1C1 = "/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////" Cells(m + 5, n + 26).FormulaR1C1 = " (x,y,z)/r " & ChrW(-10187) & ChrW(-8653) & ChrW(178) & ChrW(-10187) & ChrW(-8475) & ChrW(-10187) & ChrW(-8431) & "(cos " & ChrW(952) & " - cos(" & ChrW(952) & " + " & ChrW(-10187) & ChrW(-8475) & ChrW(952) & ")" Cells(m + 7, n + -1).FormulaR1C1 = "=IF(LEFT(R[1]C[5],1)=""x"",R[1]C[6],R[-18]C+R[-16]C)" Cells(m + 7, n + 0).FormulaR1C1 = "=IF(LEFT(R[1]C[4],1)=""x"",R[2]C[5],R[-18]C+R[-16]C)" Cells(m + 7, n + 1).FormulaR1C1 = "=IF(LEFT(R[1]C[3],1)=""x"",R[3]C[4],R[-18]C+R[-16]C)" Cells(m + 7, n + 4).FormulaR1C1 = "Charge Position:" Cells(m + 7, n + 20).FormulaR1C1 = "THEORETICAL BASIS:" Cells(m + 8, n + 4).FormulaR1C1 = "x_o =" Cells(m + 8, n + 5).FormulaR1C1 = "0" Cells(m + 8, n + 21).FormulaR1C1 = "The electric field flux (" & ChrW(934) & ") through a surface is a measure of the net number of field lines" Cells(m + 9, n + -1).FormulaR1C1 = "=R26C7*COS(RADIANS(R33C7+R36C7*R[-6]C[2]))*SIN(RADIANS(R34C7+R37C7*R[-6]C[2]))" Cells(m + 9, n + 0).FormulaR1C1 = "=R26C7*SIN(RADIANS(R33C7+R36C7*R[-6]C[1]))*SIN(RADIANS(R34C7+R37C7*R[-6]C[1]))" Cells(m + 9, n + 1).FormulaR1C1 = "=R26C7*COS(RADIANS(R34C7+R37C7*R[-6]C))" Cells(m + 9, n + 4).FormulaR1C1 = "y_o =" Cells(m + 9, n + 5).FormulaR1C1 = "0" Cells(m + 9, n + 21).FormulaR1C1 = "traversing that surface. Mathematically, it is defined in two ways:" 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 = "z_o =" Cells(m + 10, n + 5).FormulaR1C1 = "0" Cells(m + 10, n + 21).FormulaR1C1 = "Continuous form:" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "=R41C7" Cells(m + 11, n + 4).FormulaR1C1 = "Line Tilt:" Cells(m + 11, n + 23).FormulaR1C1 = "" & ChrW(934) & " = " & ChrW(8748) & "E " & ChrW(183) & " dS" Cells(m + 3, n + 1).Interior.Color = "3506772" 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 1 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" Cells(m + 3, n + 4).FormulaR1C1 = "phi =" Cells(m + 3, n + 5).FormulaR1C1 = "-5" Cells(m + 3, n + 21).FormulaR1C1 = "where E is the electric field vector and dS is the area element vector (normal to the surface)." Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "theta =" Cells(m + 4, n + 5).FormulaR1C1 = "90" Cells(m + 4, n + 21).FormulaR1C1 = "Discrete form (implemented in the model):" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "1" Cells(m + 5, n + 4).FormulaR1C1 = "Line Bending:" Cells(m + 5, n + 23).FormulaR1C1 = "" & ChrW(934) & " = " & ChrW(931) & " E " & ChrW(7522) & " " & ChrW(183) & " " & ChrW(916) & "S " & ChrW(7522) & "" Cells(m + 6, n + 4).FormulaR1C1 = "Azimuth =" Cells(m + 6, n + 5).FormulaR1C1 = "10" Cells(m + 6, n + 21).FormulaR1C1 = "This sum is done on all the elements of the area into which the surface is divided, where E " & ChrW(7522) & " is the field" Cells(m + 7, n + -1).FormulaR1C1 = "=R11C1" Cells(m + 7, n + 0).FormulaR1C1 = "=R11C2" Cells(m + 7, n + 1).FormulaR1C1 = "=R11C3" Cells(m + 7, n + 4).FormulaR1C1 = "Elevation =" Cells(m + 7, n + 5).FormulaR1C1 = "0" Cells(m + 7, n + 21).FormulaR1C1 = "in the center of each element " & ChrW(916) & " S " & ChrW(7522) & "." Cells(m + 8, n + -1).FormulaR1C1 = "1" Cells(m + 8, n + 0).FormulaR1C1 = "1" Cells(m + 8, n + 1).FormulaR1C1 = "1" Cells(m + 8, n + 4).FormulaR1C1 = " n =" Cells(m + 8, n + 5).FormulaR1C1 = "=COUNTIF(C[-3],""E_""&R[-14]C&""_*"")" Cells(m + 8, n + 20).FormulaR1C1 = "IMPLEMENTATION IN THE MODEL:" Cells(m + 9, n + -1).FormulaR1C1 = "=1/(POWER(POWER(R11C1-R[-11]C,2)+POWER(R11C2-R[-11]C[1],2)+POWER(R11C3-R[-11]C[2],2),3/2))*(R11C1-R[-11]C)*R17C23*R25C7/R38C7" Cells(m + 9, n + 0).FormulaR1C1 = "=1/(POWER(POWER(R11C1-R[-11]C[-1],2)+POWER(R11C2-R[-11]C,2)+POWER(R11C3-R[-11]C[1],2),3/2))*(R11C2-R[-11]C)*R17C23*R25C7/R38C7" Cells(m + 9, n + 1).FormulaR1C1 = "=1/(POWER(POWER(R11C1-R[-11]C[-2],2)+POWER(R11C2-R[-11]C[-1],2)+POWER(R11C3-R[-11]C,2),3/2))*(R11C3-R[-11]C)*R17C23*R25C7/R38C7" Cells(m + 9, n + 2).FormulaR1C1 = "=""E_""&R24C7&""_""&(R[-6]C[-3]-2)/2" Cells(m + 9, n + 4).FormulaR1C1 = " L =" Cells(m + 9, n + 5).FormulaR1C1 = "=R[-13]C*R[-1]C" Cells(m + 9, n + 21).FormulaR1C1 = "1. Electric Field Sources" 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 = " Type =" Cells(m + 10, n + 5).FormulaR1C1 = "=IF(R[-2]C<4,9,183)" Cells(m + 10, n + 22).FormulaR1C1 = "Point charges:" 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 = " Thickness =" Cells(m + 11, n + 5).FormulaR1C1 = "=IF(R[-3]C<4,7,2)" Cells(m + 11, n + 23).FormulaR1C1 = "Magnitude and sign in cell G25" Cells(m + 3, n + 1).Interior.Color = "49407" 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 = 4 End If ' vector ends If m = m1 + 27 Then Cells(m + 12, n + 23).FormulaR1C1 = "Up to 3 charges can be added with the +OBJ button" Cells(m + 13, n + 23).FormulaR1C1 = "Adjustable distance in G26" Cells(m + 14, n + 22).FormulaR1C1 = "Linear charge distributions:" Cells(m + 15, n + 23).FormulaR1C1 = "Pressing +OBJ more than 4 times converts the line to a charged line" Cells(m + 16, n + 23).FormulaR1C1 = "Configuration parameters:" Cells(m + 17, n + 23).FormulaR1C1 = "G33: Azimuth tilt angle" Cells(m + 18, n + 23).FormulaR1C1 = "G34: Polar angle" Cells(m + 19, n + 23).FormulaR1C1 = "G36: Incremental azimuth angle (for curvature)" Cells(m + 20, n + 23).FormulaR1C1 = "G37: Incremental polar angle" Cells(m + 21, n + 23).FormulaR1C1 = "For multiple segments: enter the number of segments in B2 and press +OBJ" Cells(m + 22, n + 21).FormulaR1C1 = "2. Calculation surfaces" Cells(m + 23, n + 22).FormulaR1C1 = "The model allows three types of surfaces:" Cells(m + 24, n + 22).FormulaR1C1 = "Select the surface in E16" Cells(m + 25, n + 22).FormulaR1C1 = "Planar surface: Coordinate range settings in Y10 - AA12" Cells(m + 26, n + 22).FormulaR1C1 = "Cylindrical surface: Height, radius, and angle in Y12 - AA14" Cells(m + 27, n + 22).FormulaR1C1 = "Spherical surface: Spherical radius and angles in Y13 - AA15" Cells(m + 28, n + 22).FormulaR1C1 = "Area element settings in AC10 - AC15 determine the magnitude of " & ChrW(916) & "S_i" Cells(m + 29, n + 22).FormulaR1C1 = "Surface formulas in Y21 - AA23" Cells(m + 30, n + 22).FormulaR1C1 = "Surface vectors normalization in AB21 - AD23" Cells(m + 31, n + 21).FormulaR1C1 = "3. Calculation control" Cells(m + 32, n + 22).FormulaR1C1 = "Activation: Yes/No in E11/F11" Cells(m + 33, n + 22).FormulaR1C1 = "Flux result in G10" Cells(m + 34, n + 22).FormulaR1C1 = "Important: Press ""Clear Data"" before each recalculation." Cells(m + 35, n + 21).FormulaR1C1 = "Calculation Methodology" Cells(m + 36, n + 22).FormulaR1C1 = "1. Division of the surface into " & ChrW(916) & "S_i elements according to the defined step." Cells(m + 37, n + 22).FormulaR1C1 = "2. Calculation of the E_i field for each element, considering all sources." Cells(m + 38, n + 22).FormulaR1C1 = "3. Dot product of the vectors: E_i " & ChrW(183) & " " & ChrW(916) & "S_i for each element." Cells(m + 39, n + 22).FormulaR1C1 = "4. Discrete sum of all contributions." Cells(m + 40, n + 22).FormulaR1C1 = "5. Display of the total flux in G10." Cells(m + 41, n + 21).FormulaR1C1 = "This model allows for a quantitative study of how surface geometry and charge distribution affect" Cells(m + 42, n + 21).FormulaR1C1 = "the flux of the electric field, numerically verifying fundamental laws such as Gauss's." Cells(m + 44, n + 20).FormulaR1C1 = "PRACTICAL EXAMPLE: calculation of electric flux through a spherical surface:" Cells(m + 45, n + 21).FormulaR1C1 = "Objective: Calculate the electric flux through a spherical surface enclosing a positive point charge." Cells(m + 46, n + 21).FormulaR1C1 = "Step 1: Initial Setup. Press the ""Clear Data"" button to clear previous calculations." Cells(m + 47, n + 21).FormulaR1C1 = "Step 2: Field Source Setup" Cells(m + 48, n + 22).FormulaR1C1 = "In cell G25: Enter `1E-9` (1 nC of positive charge)" Cells(m + 49, n + 21).FormulaR1C1 = "Step 3: Spherical Surface Setup" Cells(m + 50, n + 22).FormulaR1C1 = "Select Spherical in E16" Cells(m + 51, n + 22).FormulaR1C1 = "In cells Y13 - AA15:" Cells(m + 52, n + 22).FormulaR1C1 = "Y13: 0.15 (Sphere radius: 15 cm) (or using comma: 0,15 depending on your Excel system)" Cells(m + 53, n + 22).FormulaR1C1 = "AA13: 0.15" Cells(m + 54, n + 22).FormulaR1C1 = "Y14: 0 (Initial phi angle)" Cells(m + 55, n + 22).FormulaR1C1 = "AA14: 360 (Final phi angle in degrees)" Cells(m + 56, n + 22).FormulaR1C1 = "Y15: 0 (Initial theta angle)" Cells(m + 57, n + 22).FormulaR1C1 = "AA15: 180 (Final theta angle in degrees)" Cells(m + 58, n + 21).FormulaR1C1 = "Step 4: Surface Discretization" Cells(m + 59, n + 21).FormulaR1C1 = "In cells AC14 - AC15:" Cells(m + 60, n + 22).FormulaR1C1 = "AC14: 10 (Phi angular pitch in degrees)" Cells(m + 61, n + 22).FormulaR1C1 = "AC15: 10 (Theta angular pitch in degrees)" Cells(m + 62, n + 21).FormulaR1C1 = "Step 5: Surface Formulas (Y23 - AA23): These are not modified; they are already set." Cells(m + 63, n + 21).FormulaR1C1 = "Step 6: Activate the Calculation" Cells(m + 64, n + 22).FormulaR1C1 = "In cell E11: Select ""Yes""" Cells(m + 65, n + 22).FormulaR1C1 = "Click either of the Execute buttons (located in H11 and below)" Cells(m + 66, n + 21).FormulaR1C1 = "Expected Result:" Cells(m + 66, n + 23).FormulaR1C1 = "In cell G10 it should appear approximately: `113.0 N m" & ChrW(178) & "/C`" Cells(m + 67, n + 21).FormulaR1C1 = "Theoretical verification using Gauss's Law:" Cells(m + 68, n + 22).FormulaR1C1 = "" & ChrW(934) & "_theoretical = Q/" & ChrW(949) & ChrW(8320) & " = G25/Y17 = (1.0 " & ChrW(215) & " 10" & ChrW(8315) & ChrW(8313) & " C) / (8.854 " & ChrW(215) & " 10" & ChrW(8315) & ChrW(185) & ChrW(178) & " C" & ChrW(178) & "/N" & ChrW(183) & "m" & ChrW(178) & ")" Cells(m + 69, n + 22).FormulaR1C1 = " = 113.0 N" & ChrW(183) & "m" & ChrW(178) & "/C" Cells(m + 70, n + 21).FormulaR1C1 = "The result of the model (G10) must match this theoretical value, confirming that:" Cells(m + 71, n + 22).FormulaR1C1 = "The spherical surface completely encloses the charge." Cells(m + 72, n + 22).FormulaR1C1 = "The discrete calculation converges to the analytical value." Cells(m + 73, n + 22).FormulaR1C1 = "The numerical implementation is correct." Cells(m + 75, n + 21).FormulaR1C1 = "Example Variation: Partial Surface" Cells(m + 76, n + 22).FormulaR1C1 = "Half-sphere configuration:" Cells(m + 77, n + 22).FormulaR1C1 = "Y15: 90 (Initial theta angle " & ChrW(960) & "/2, lower hemisphere only)" Cells(m + 78, n + 22).FormulaR1C1 = "AA15: 170 (Final theta angle " & ChrW(960) & ", lower hemisphere only. 180 would exceed this angle due to " & ChrW(916) & "S)" Cells(m + 79, n + 22).FormulaR1C1 = "Expected result in G10: Approximately 56.5 N m" & ChrW(178) & "/C (half of the total flux)" Cells(m + 80, n + 22).FormulaR1C1 = "Important: Verify that the number of vectors in A8 is approximately half that for the entire sphere." Cells(m + 81, n + 22).FormulaR1C1 = "If not, adjust the angle in AA15 until it is achieved." Cells(m + 82, n + 20).FormulaR1C1 = "ADVANCED EXAMPLE: CHARGED LINE" Cells(m + 83, n + 22).FormulaR1C1 = "1. Press ""Clear Data""" Cells(m + 84, n + 22).FormulaR1C1 = "2. In B2, enter `10` (10 segments)" Cells(m + 85, n + 22).FormulaR1C1 = "3. Press +OBJ to create a filled line" Cells(m + 86, n + 22).FormulaR1C1 = "4. Configure parameters in G33 - G37:" Cells(m + 87, n + 22).FormulaR1C1 = "G33: 90 (azimuth inclination in degrees)" Cells(m + 88, n + 22).FormulaR1C1 = "G34: 90 (polar inclination in degrees)" Cells(m + 89, n + 22).FormulaR1C1 = "G36: 20 (azimuth curvature in degrees)" Cells(m + 90, n + 22).FormulaR1C1 = "G37: 0 (no polar curvature)" Cells(m + 91, n + 21).FormulaR1C1 = "This example would demonstrate flux calculation for more complex charge distributions." Cells(m + 93, n + 20).FormulaR1C1 = "IMPORTANT NOTE:" Cells(m + 94, n + 21).FormulaR1C1 = "Please note the decimal divisor in your system (comma or period) for proper operation." For i = 1 To 3000 ' formulas to calculate E dS in each point Cells(16 + i, n + 31).FormulaR1C1 = "=RC[7]*RC[17]+RC[8]*RC[18]+RC[9]*RC[19]" Next i Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub