Академический Документы
Профессиональный Документы
Культура Документы
CONSOLIDATION ANALYSIS
Reference: R.F Craig, Soil Mechanics (Chapter 7), Fourth Edition, Spon Press, London, 1987
To create a program, it simply copies and pastes the code into modules and a command
button. Form related to the program is shown below:
Excel Spreadsheet:
1
Module1 (FDC)
Option Explicit
Public dZ() As Double
Public IP() As Double
Public rsdZ() As Double
Public rsIP() As Double
Public rsTP() As Double
Public m As Integer
Public im As Integer
Sub FDC()
'==================================================================
'FDC v.1.0 Program for One Dimensional Consolidation Analysis, 2004
'by: Gunthar Pangaribuan - Refer to the book:
'An Introduction to Excel for Civil Engineers
'==================================================================
Dim LastRow
LastRow = ActiveSheet.UsedRange.Rows.Count
Range(Cells(9, 1), Cells(LastRow, 4)).ClearContents
If FDCCase = 1 Then
'open layered
Tv = cv * t / (h / 2) ^ 2
n = 1.5 * m ^ 2 * Tv
u(0, 0) = 0
For i = 0 To n
u(0, i + 1) = 0 'first row = 0
u(m, i + 1) = 0 'last row = 0
Next i
u(0, 0) = 0
For i = 0 To n
u(0, i + 1) = 0 'first row = 0
Next i
For i = 1 To m
u(i, 0) = rsIP(i)
Next i
Else
GoTo Check
End If
'Result: after t pressure
For i = 1 To m
rsTP(i) = u(i, n + 1)
Next i
'Result
For i = 0 To im
Cells(9 + i, 1).NumberFormat = "0.00"
Cells(9 + i, 1) = dZ(i)
Cells(9 + i, 2).NumberFormat = "0.00"
Cells(9 + i, 2) = IP(i)
Cells(9 + i, 3).NumberFormat = "0.00"
Cells(9 + i, 3) = rsTP(10 * i)
Next i
Check: MsgBox "Please check the input data ...", vbOKOnly + vbExclamation, "FDC
Error!"
End Sub
Module2 (FDC)
Sub FDCchart()
Dim am As Integer
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
Selection.ClearContents
j = im + m
am = 0
'creating series lines: after t pressure
For i = im + 1 To j
mxValaf(i) = Array(rsTP(am), rsTP(am + 1))
myValaf(i) = Array(rsdZ(am), rsdZ(am + 1))
With ActiveChart
.SeriesCollection.NewSeries
.SeriesCollection(i).XValues = mxValaf(i)
.SeriesCollection(i).Values = myValaf(i)
.SeriesCollection(i).Name = "="""""
End With
ActiveChart.SeriesCollection(i).Select
With Selection
.MarkerStyle = xlNone
.Smooth = False
End With
With Selection.Border
.ColorIndex = 7
.Weight = xlMedium
.LineStyle = xlContinuous
End With
am = am + 1
Next i
End Sub
This article is part of the book, "An Introduction to Excel for Civil Engineers", from the
author blog: http://exceljunior.blogspot.co.id