|
Example Boundary Value Problem
Boundary
Value
Problems (BVPs)
solved with
Calculus Programming
_________
- This section shows how to solve equations of
the following form:.
- Uxx
= f(x, U, Ux, ...)
- This is a general form of a differential
equation. To solve with the boundary values/conditions, Ustart & Uend, in
Calculus programming we replace the following code for the "call xAxis"
statement in these examples:
-
|
Ustart = 1.23e-3: Uend = 9.87e-3 ! Initial Conditions (BCs) error = 0: U0 = 1 find U0; In xAxis; ooo to match error
|
|
plus, add
some error statements thru out
ooo
error = error + (U - ???)**2
|
This 'find'
statement will vary the 'U0' parameter until 'error' equals zero.
Thus meeting your boundary conditions.
- Enjoy learning Calculus-level Programming!
|
|
|
Example Boundary Value Problem Source
Code:
-
A Boundary Value Problem:
global all problem nonLinPDE C ------------------------------------------------------------------------ C --- Calculus Programming example: non-linear PDE (1D) Boundary C --- Value Problem solved. C ------------------------------------------------------------------------ C C User parameters ... ! rho = ... e0 = 8.854187817e-12 ! F/m or A2 s4 kg-1m−3 permittivity of free space ! ipoints = 10 ! grid pts. over x-axis C C x-parameter initial settings: x ==> i ! xFinal = 1: xPrint = xFinal/ipoints: ip = ipoints pi= 4*atan(1) C Ustart = 1.23e-3: Uend = 9.87e-3 ! Initial Conditions (BCs) error = 0: U0 = 1 find U0; in xAxis; by mars; to match error end model xAxis C ... Integrate over x-axis C x= 0: xPrt = xPrint: dx = xPrt / 10 Initiate janus; for PDE; ~ equations Uxx/Ux, Ux/U; of x; step dx; to xPrt ! Ux = ??? ! @ x = 0 ... Ux at x=0 too be found as a BC U = U0 error = error + (U - Ustart)**2 do while (x .lt. xFinal) Integrate PDE; by janus if( x .ge. xPrt) then print 79, x, U, Ux, Uxx xPrt = xPrt + xPrint end if end do error = error + (U - Uend)**2 79 format( 1h , f8.4, 2x, 10(g14.5, 2x)) end model PDE ! Partial Differential Equation Uxx = -rho/e0 * (1.23 + sin( Ux * pi) - .543) ooo ! your Diff Eq goes here end
Example Boundary Value Problem Output:
-
selected output goes here ...
HTML code
for linking to this page:
- <a
href="http://www.digitalcalculus.com/math-problems/boundary-value-problem.html"><img
align="middle" width="100"
src="http://www.digitalcalculus.com/image/fc-win-icon.gif"/>
<strong>Example Boundary Value Problem</strong>
</a>; Simulation to Optimization, Tweak Parameters for Optimal
Solution.
Go to top
|
|