FC-Compiler™ is a (free) Calculus-level Compiler that simplifies Tweaking parameters in ones math model. The FortranCalculus (FC) language is for math modeling, simulation, and optimization. FC is based on Automatic Differentiation that simplifies computer code to an absolute minimum; i.e., a mathematical model, constraints, and the objective (function) definition. Minimizing the amount of code allows the user to concentrate on the science or engineering problem at hand and not on the (numerical) process requirements to achieve an optimum solution. Download at http://goal-driven.net/apps/fc-compiler.html
FC-Compiler™ App has many (50+) example problems with output (see 'Demos' on main menu) for viewing and getting ideas on solving your own problems. These are improved productivity examples do to using Calculus-level Problem-Solving. Please share this Calculus Problem-Solving tool with your friends. Thanks!
5. Why OptimizationWhy Optimization
over Simulation?over Simulation?
Maximize Parameter Tolerance for Mfg.Maximize Parameter Tolerance for Mfg.
Solutions are at min./max. locations whereSolutions are at min./max. locations where
their partial derivatives = 0 & thus allow largesttheir partial derivatives = 0 & thus allow largest
delta errors.delta errors.
Minimize # of Executions for a solutionMinimize # of Executions for a solution
6. IntroductionIntroduction
toto
FortranCalculusFortranCalculus
a Calculus-level Computer Languagea Calculus-level Computer Language
1974 First Commercial Release (PROSE)1974 First Commercial Release (PROSE)
I taught PROSE in 1975-79.I taught PROSE in 1975-79.
Solved problems within 4 hours (each)Solved problems within 4 hours (each)
Present version is FortranCalculusPresent version is FortranCalculus
Main obstacle: no design objectiveMain obstacle: no design objective
8. What are you building?What are you building?
Mr. Arithmetic Mr. Algebra Mr. CalculusMr. Arithmetic Mr. Algebra Mr. Calculus
------------------- --------------- ----------------------------------- --------------- ----------------
Slide Rule Simulate OptimizeSlide Rule Simulate Optimize
10. Objective-Driven CutsObjective-Driven Cuts
Sawmill's operation
Objective for cutting log?Objective for cutting log?
Maximize company's profitsMaximize company's profits
Minimize pollutionMinimize pollution
Minimize 'waste'Minimize 'waste'
Maximize 2" x 4"sMaximize 2" x 4"s
11. Sawmill's operation
Parameters to consider:Parameters to consider:
Log-to-lumber Processing:Log-to-lumber Processing:
Size of logSize of log: diameter, length, taper, knots, etc.: diameter, length, taper, knots, etc.
Time requiredTime required to: cut log, sharpen blades, lubricateto: cut log, sharpen blades, lubricate
machinery, etc.machinery, etc.
Strength or flexibilityStrength or flexibility desired of various sizes.desired of various sizes.
InventoryInventory
Market trendsMarket trends
Objective-Driven CutsObjective-Driven Cuts
13. Objective-Driven DesignObjective-Driven Design
Surveillance Design Objective:Surveillance Design Objective:
Maximize surveillance coverageMaximize surveillance coverage
Minimize number of satellitesMinimize number of satellites
Solution? (Not realistic; Objective needs work.)Solution? (Not realistic; Objective needs work.)
14. Objective-Driven DesignObjective-Driven Design
Thin-Film-Head (TFH) for Magnetic Recording
TFH with coilTFH with coil
Disc platter cross-sectionDisc platter cross-section
Typical Readback PulseTypical Readback Pulse Optimum pulse shapeOptimum pulse shape
versusversus
15. Objective-Driven DesignObjective-Driven Design
Thin-Film-Head (TFH) for Magnetic RecordingThin-Film-Head (TFH) for Magnetic Recording
Design Objective?Design Objective?
Maximize ProfitMaximize Profit
Maximize Pulse SymmetryMaximize Pulse Symmetry
Minimize Pulse WidthMinimize Pulse Width
Minimize PollutionMinimize Pollution
Maximize User SatisfactionMaximize User Satisfaction
??????
Solution: Determine TFH geometrySolution: Determine TFH geometry
parameters A, B, C, etc. to achieve objective.parameters A, B, C, etc. to achieve objective.
17. Objective-Driven DesignObjective-Driven Design
Matched Filter for Magnetic RecordingMatched Filter for Magnetic Recording
Results:Results:
Textbook problem solved in 4 hoursTextbook problem solved in 4 hours
Design required 2 years to acquire a true practicalDesign required 2 years to acquire a true practical
objective functionobjective function
Development time droppedDevelopment time dropped from 12 to 1 weekfrom 12 to 1 week
Design was mathematically optimalDesign was mathematically optimal
18. "One Step from First Principles to Solutions""One Step from First Principles to Solutions"
EnhancingEnhancing
Scientific & EngineeringScientific & Engineering
ProductivityProductivity
FortranCalculus BackgroundFortranCalculus Background
Optimal Designs EnterpriseOptimal Designs Enterprise
goal-driven.netgoal-driven.net
19. Industry IssueIndustry Issue
A Proven ApproachA Proven Approach
SummSummaryary
Fortran CalculusFortran Calculus LanguageLanguage
AgendaAgenda
20. Scientific & EngineeringScientific & Engineering
ProductivityProductivity
Industry IssueIndustry Issue
Costly Problem/Solution Cycle ...Costly Problem/Solution Cycle ...
Model Married to AlgorithmModel Married to Algorithm
Validation DelayedValidation Delayed
Long Problem/Solution CycleLong Problem/Solution Cycle
Problem "Understanding" DelayedProblem "Understanding" Delayed
21. Basic, Fortran, MACSYMA, etc. LanguagesBasic, Fortran, MACSYMA, etc. Languages
FormulateFormulate
ProblemProblem
Approximations,Approximations,
Methods, etc.Methods, etc.
Programming ofProgramming of
Reduced ProblemReduced Problem
Debug Problem,Debug Problem,
Math, & ProgramMath, & Program
EngineerEngineer
MathematicianMathematician
ProgrammerProgrammer
AllAll
Rapid Prototyping for AdaptiveRapid Prototyping for Adaptive
EngineeringEngineering
22. Rapid PrototypingRapid Prototyping
for Adaptive Engineeringfor Adaptive Engineering
Basic, Fortran, MACSYMA, etc. Languages (Cont.)Basic, Fortran, MACSYMA, etc. Languages (Cont.)
Engineering:Engineering: Quickly FrozenQuickly Frozen
Commitment:Commitment: LargeLarge
Cost:Cost: HighHigh
Delay:Delay: LongLong
Algebra Level SummaryAlgebra Level Summary
23. FC Technology HistoryFC Technology History
Late 1960's - Pioneered - TRW / NASALate 1960's - Pioneered - TRW / NASA
Mid 1970's - Validated - PROSE, Inc.Mid 1970's - Validated - PROSE, Inc.
Late 1980's - Migrated - Du PontLate 1980's - Migrated - Du Pont
Today -Today - FortranCalculusFortranCalculus
PioneeredPioneered
ValidatedValidated
MigratedMigrated
OperationalOperational
24. Scientific & EngineeringScientific & Engineering
ProductivityProductivity
FortranCalculusFortranCalculus
A Proven ApproachA Proven Approach ......
Allows Rapid PrototypingAllows Rapid Prototyping
Decouples Models from AlgorithmsDecouples Models from Algorithms
Allows Interchangeable AlgorithmsAllows Interchangeable Algorithms
Accelerates Problem "Understanding"Accelerates Problem "Understanding"
Enabled by "Automatic Differentiation"Enabled by "Automatic Differentiation"
25. Rapid Prototyping for AdaptiveRapid Prototyping for Adaptive
EngineeringEngineering
Calculus-level Languages: Prose & fortranCalculusCalculus-level Languages: Prose & fortranCalculus
FormulateFormulate
ProblemProblem
Debug ProblemDebug Problem
EngineerEngineer
EngineerEngineer
26. Rapid PrototypingRapid Prototyping
for Adaptive Engineeringfor Adaptive Engineering
FortranCalculus Language (Cont.)FortranCalculus Language (Cont.)
Engineering:Engineering: AdaptiveAdaptive
Commitment:Commitment: SmallSmall
Cost:Cost: LowLow
Delay:Delay: ShortShort
Calculus Level SummaryCalculus Level Summary
27. Enabling TechnologyEnabling Technology
FortranCalculusFortranCalculus
Symbolic Differentiation Evaluated at a PointSymbolic Differentiation Evaluated at a Point
GeneratesGenerates
Gradient VectorsGradient Vectors
Jacobian MatricesJacobian Matrices
Hessian MatricesHessian Matrices
... of Any Programmed Model... of Any Programmed Model
Automatic DifferentiationAutomatic Differentiation
28. Enabling TechnologyEnabling Technology
FortranCalculusFortranCalculus
EnablesEnables
Inverse Problem SolvingInverse Problem Solving
Nonlinear OptimizationNonlinear Optimization
Optimization of Differential EquationsOptimization of Differential Equations
Structured Nesting of Optimization AlgorithmStructured Nesting of Optimization Algorithmss
Automatic Differentiation (Cont.)Automatic Differentiation (Cont.)
29. FortranCalculusFortranCalculus,,
a calculus level languagea calculus level language
Increases Science/Engineering ProductivityIncreases Science/Engineering Productivity
Allows Rapid Model PrototypingAllows Rapid Model Prototyping
Reduces Costly Problem/Solution CycleReduces Costly Problem/Solution Cycle
Accelerates Problem "Understanding"Accelerates Problem "Understanding"
Proven Concept Since 1968Proven Concept Since 1968
Provides a Competitive Technical EdgeProvides a Competitive Technical Edge
SummarySummary
31. Complete Example CodeComplete Example Code
global allglobal all
problem rocket ! three stage rocket design optimizationproblem rocket ! three stage rocket design optimization
dimension spi(3),spivac(3),tburn(3),thrust(3),xip(3),wprop(3),dimension spi(3),spivac(3),tburn(3),thrust(3),xip(3),wprop(3),
& ratio(3),wstage(3),strfac(3),delv(3),g(2)& ratio(3),wstage(3),strfac(3),delv(3),g(2)
thrust(1)=350 : thrust(2)=1500 : thrust(3)=4100thrust(1)=350 : thrust(2)=1500 : thrust(3)=4100
tburn(1)=110 : tburn(2)=100 : tburn(3)=180tburn(1)=110 : tburn(2)=100 : tburn(3)=180
xip(1)=5d-3 : xip(2)=0 : xip(3)=0xip(1)=5d-3 : xip(2)=0 : xip(3)=0
spivac(1)=315 : spivac(2)=315 : spivac(3)=315spivac(1)=315 : spivac(2)=315 : spivac(3)=315
FINDFIND thrust(1),thrust(2),tburn(2),tburn(3); in stages;thrust(1),thrust(2),tburn(2),tburn(3); in stages;
* by Hera; reporting dlvtot,tbtot; to minimize weight* by Hera; reporting dlvtot,tbtot; to minimize weight
endend
model stagesmodel stages
FindFind thrust(3),tburn(1); in eqns; by Ajax; to match gthrust(3),tburn(1); in eqns; by Ajax; to match g
endend
model eqnsmodel eqns
data gc,wpayld,delvip,tbip/32.174,50,2.8e4,400/data gc,wpayld,delvip,tbip/32.174,50,2.8e4,400/
dlvtot=0 : tbtot=0dlvtot=0 : tbtot=0
weight=wpayldweight=wpayld
do 10 i=1,3do 10 i=1,3
spi(i)=spivac(i)*(1-xip(i))spi(i)=spivac(i)*(1-xip(i))
wprop(i)=thrust(i)*tburn(i)/spi(i)wprop(i)=thrust(i)*tburn(i)/spi(i)
wstage(i)=0.0234*thrust(i)+wprop(i)+1.255*wprop(i)**0.704+4wstage(i)=0.0234*thrust(i)+wprop(i)+1.255*wprop(i)**0.704+4
strfac(i)=wprop(i)/wstage(i)strfac(i)=wprop(i)/wstage(i)
weight=weight+wstage(i)weight=weight+wstage(i)
ratio(i)=weight/(weight-wprop(i))ratio(i)=weight/(weight-wprop(i))
delv(i)=gc*spi(i)*log(ratio(i))delv(i)=gc*spi(i)*log(ratio(i))
dlvtot=dlvtot+delv(i)dlvtot=dlvtot+delv(i)
tbtot=tbtot+tburn(i)tbtot=tbtot+tburn(i)
10 continue10 continue
g(1)=dlvtot-delvip ! total delta v constraintg(1)=dlvtot-delvip ! total delta v constraint
g(2)=tbtot-tbipg(2)=tbtot-tbip ! total burn time constraint! total burn time constraint
endend
Math
Model
32. Example Convergence ReportExample Convergence Report
o o oo o o
LOOP NUMBER .... [INITIAL] 5 6LOOP NUMBER .... [INITIAL] 5 6
UNKNOWNSUNKNOWNS
A ( 1) 1.000000E+00 4.432149E-01 3.737358E-01A ( 1) 1.000000E+00 4.432149E-01 3.737358E-01
B ( 1) 1.000000E+00 4.040783E+00 4.284183E+00B ( 1) 1.000000E+00 4.040783E+00 4.284183E+00
C ( 1) 1.230000E+02 4.305000E+02 4.920000E+02C ( 1) 1.230000E+02 4.305000E+02 4.920000E+02
OBJECTIVEOBJECTIVE
ERRSUM 8.189812E+00ERRSUM 8.189812E+00 4.870502E-02 3.879211E-024.870502E-02 3.879211E-02
o o oo o o
33. Explicit EquationExplicit Equation
o o oo o o
FindFind A,B,CA,B,C; In; In EngineEngine; to ...; to ...
o o oo o o
ModelModel EngineEngine
Y = Function( X;Y = Function( X; A,B,CA,B,C))
End ModelEnd Model
Math
Model
34. Implicit EquationImplicit Equation
o o oo o o
FindFind A,B,CA,B,C; In; In EngineEngine; to; to MatchMatch GG
o o oo o o
ModelModel EngineEngine
GG = Y - Function( X, Y;= Y - Function( X, Y; A,B,CA,B,C))
End ModelEnd Model
35. Inverse ProblemInverse Problem
o o oo o o
Ydesired = 123.456 ! target valueYdesired = 123.456 ! target value
FindFind A,B,CA,B,C; In; In EngineEngine; to; to MatchMatch GG
o o oo o o
ModelModel EngineEngine
Y = Function( X;Y = Function( X; A,B,CA,B,C))
GG = Ydesired - Y= Ydesired - Y
End ModelEnd Model
36. Optimization ProblemOptimization Problem
o o oo o o
FindFind A,B,CA,B,C; In; In EngineEngine; to; to MinimizeMinimize GG
o o oo o o
ModelModel EngineEngine
GG = Y - Function( X;= Y - Function( X; A,B,CA,B,C))
End ModelEnd Model
37. Explicit Differental EquationsExplicit Differental Equations
o o oo o o
InitiateInitiate ISISISIS; For; For EngineEngine;;
Equations Y2Dot/YDot, YDot/Y; ...Equations Y2Dot/YDot, YDot/Y; ...
o o oo o o
IntegrateIntegrate EngineEngine; By; By ISISISIS
o o oo o o
ModelModel EngineEngine
Y2DotY2Dot = Function( YDot, Y= Function( YDot, Y))
End ModelEnd Model
38. Implicit Differental EquationsImplicit Differental Equations
Initiate ...Initiate ...
o o oo o o
IntegrateIntegrate EngineEngine; By; By ISISISIS
o o oo o o
ModelModel EngineEngine
FindFind Y2DotY2Dot; In IDE; To Match; In IDE; To Match GG
End ModelEnd Model
Model IDEModel IDE
GG == Y2DotY2Dot -- Fun(Fun(Y2DotY2Dot,, YDot, YYDot, Y))
End ModelEnd Model
39. Initial Value ProblemsInitial Value Problems
Explicit EquationsExplicit Equations
InitiateInitiate
YDot = 123.456 : Y2Dot = 234.567 : Y3Dot = ...YDot = 123.456 : Y2Dot = 234.567 : Y3Dot = ... ! Initial Values! Initial Values
o o oo o o
IntegrateIntegrate ......
o o oo o o
Model ...Model ...
YnDotYnDot = Function( Yn= Function( Yn11Dot, ... , YDot, YDot, ... , YDot, Y))
End ModelEnd Model
40. Initial Value ProblemsInitial Value Problems
Implicit EquationsImplicit Equations
o o oo o o
Integrate ...Integrate ...
o o oo o o
FindFind YnDot; ...; To MatchYnDot; ...; To Match GG
o o oo o o
Model ...Model ...
GG = YnDot - Function( YnDot, ... , YDot, Y= YnDot - Function( YnDot, ... , YDot, Y))
End ModelEnd Model
41. Boundary Value ProblemsBoundary Value Problems
Explicit EquationsExplicit Equations
o o oo o o
FindFind YDot0, ... To MatchYDot0, ... To Match HH
o o oo o o
IntegrateIntegrate ......
o o oo o o
HH = (Y0 - Y0_desired)**2 += (Y0 - Y0_desired)**2 +
(Ylast - Ylast_desired)**2 ! boundary values(Ylast - Ylast_desired)**2 ! boundary values
42. Boundary Value ProblemsBoundary Value Problems
Implicit EquationsImplicit Equations
o o oo o o
FindFind YDot0, ...; To MatchYDot0, ...; To Match HH
o o oo o o
IntegrateIntegrate ......
o o oo o o
FindFind YnDot; ...; To MatchYnDot; ...; To Match GG
o o oo o o
Model ...Model ...
GG = YnDot - Function( YnDot, ... , YDot, Y= YnDot - Function( YnDot, ... , YDot, Y))
End ModelEnd Model
43. Limits & Inequality ConstraintsLimits & Inequality Constraints
o o oo o o
FindFind ... With Lowers ... And Uppers ... Holding ...... With Lowers ... And Uppers ... Holding ...
o o oo o o
44. TweakTweak TweakTweak TweakTweak
o o oo o o
FindFind E,F,GE,F,G ...... ! Add to any problem! Add to any problem
o o oo o o ! in order to tweak! in order to tweak E,F,GE,F,G ......
45. Nested Calculus ProcessesNested Calculus Processes
o o oo o o
FindFind ......
o o oo o o
IntegrateIntegrate ......
o o oo o o
IntegrateIntegrate ......
o o oo o o
FindFind ......
46. How are problems solved?How are problems solved?
o o oo o o
FindFind ...... byby 'Solver''Solver'
o o oo o o
'Solver' is a numerical method using'Solver' is a numerical method using
Automatic Differention to calculateAutomatic Differention to calculate
necessary derivatives. Thenecessary derivatives. The
available solvers are in a MCavailable solvers are in a MC
library; e.g. Ajax, Mars, Neptune,library; e.g. Ajax, Mars, Neptune,
etc.etc.
48. Automotive Mfg. CompanyAutomotive Mfg. Company
Optimization LevelsOptimization Levels
Optimal Designs EnterpriseOptimal Designs Enterprise
Level 1
Company
Company
Design
Dept.
Mfg.
Dept.
Engine
Mfg.
Power
Train
Engine
Design
Power
Train
Level 2
Dept.s
Level 3
Groups
49. Design Department'sDesign Department's
Engine Design CodeEngine Design Code
(Get Iron, Rubber, etc values from Co. database)(Get Iron, Rubber, etc values from Co. database)
FindFind EngineSizeEngineSize, etc; In, etc; In EngineEngine; to Minimize; to Minimize
PollutionPollution; and Maximize; and Maximize GasEfficiencyGasEfficiency......
o o oo o o
ModelModel EngineEngine
HorsePower = ... Iron ...HorsePower = ... Iron ... EngineSizeEngineSize ......
GasEfficiencyGasEfficiency = ... TerrainType ... HorsePower= ... TerrainType ... HorsePower
PollutionPollution = ... CarWeight ... HorsePower ...= ... CarWeight ... HorsePower ...
GasInEfficiency ... RubberGasInEfficiency ... Rubber
End ModelEnd Model
Level 3
50. Design Department's CodeDesign Department's Code
(Get Iron, Rubber, etc values from Co. database)(Get Iron, Rubber, etc values from Co. database)
FindFind CarWeightCarWeight, etc; In, etc; In CarDesignCarDesign; to Minimize; to Minimize
CarPollutionCarPollution; and Maximize; and Maximize CarSafetyCarSafety ......
o o oo o o
ModelModel CarDesignCarDesign
Call EngineDesignCall EngineDesign !! Another OptimizationAnother Optimization
Call PowerTrainCall PowerTrain !! Another OptimizationAnother Optimization
CarPollutionCarPollution = ...= ... CarWeightCarWeight ... HorsePower ...... HorsePower ...
GasInEfficiency ... Rubber ... CoalGasInEfficiency ... Rubber ... Coal
CarSafetyCarSafety = ... Iron ... CarWeight ...= ... Iron ... CarWeight ...
End ModelEnd Model
Level 2
51. Company's CodeCompany's Code
(Get present Iron, Rubber, etc values from Co. database)(Get present Iron, Rubber, etc values from Co. database)
FindFind IronIron,, RubberRubber, etc; In, etc; In CompanyCompany; to Minimize; to Minimize
Time2MarketTime2Market; and Maximize; and Maximize ProfitProfit ......
o o oo o o
ModelModel CompanyCompany
Call DesignCall Design !! Another OptimizationAnother Optimization
Call ManufacturingCall Manufacturing !! Another OptimizationAnother Optimization
Call SalesCall Sales !! Another OptimizationAnother Optimization
Time2MarketTime2Market = ...= ... IronIron ......
ProfitProfit = ...= ... IronIron ...... RubberRubber ... Coal ...... Coal ...
End ModelEnd Model
Level 1
52. Code for OptimizationsCode for Optimizations
Level 3 Code ... GroupsLevel 3 Code ... Groups
Most Important ... fundamental equationsMost Important ... fundamental equations
Can Run IndependentlyCan Run Independently
Contains Math Models to Simulate Design/Mfg.Contains Math Models to Simulate Design/Mfg.
Level 2 Code ... Dept.sLevel 2 Code ... Dept.s
Runs Latest Level 3 code tooRuns Latest Level 3 code too
Level 1 Code ... CompanyLevel 1 Code ... Company
Runs Latest of All LevRuns Latest of All Levelsels
All L 3s
All L 2s
L 1
Some L 3s
l L 2
1 L 3
Easy to UpdateEasy to Update
54. What are you building?What are you building?
Mr. Arithmetic Mr. Algebra Mr. CalculusMr. Arithmetic Mr. Algebra Mr. Calculus
------------------- --------------- ----------------------------------- --------------- ----------------
Slide Rule Simulate OptimizeSlide Rule Simulate Optimize