Sunday, August 31, 2014

Algorithmic Representation


Numerical solution of DE’s is accomplished by feeding in first order differential form of the series of equations to be solved to an algorithm like Runge Kutta or Rosenbrock. First order ODE’s can be easily represented in this manner. With higher order ODE’s, the higher orders are first converted into 1st order ones before an algorithm can be implemented.

Take for example the 2nd order mass-spring-damper system model:



This equation can be numerically solved using the conversion

      

 
To be more specific, let us assume that the variables to be solved are var1 and var2. The algorithmic form would then become:


 

For a series of higher order ODE’s, one has to convert the successive higher orders into first order equivalents and then use the ODE solvers.

Tuesday, August 26, 2014

Solution of the Wave Eqn.

The ODE’s for the wave equation were solved for the following boundary conditions:


The spatial boundary conditions represented by the partials can be converted into ODE’s using the forward and backward difference formulations:

  
The ODE’s were solved using the Rosenbrock method with the GRK4T coefficients, and the result is plotted below.

Sunday, August 24, 2014

The Wave Equation



The PDE that defines the wave equation falls under the class of Hyperbolic partial differential equations.  The equation is:

 
 




 
This 2nd order PDE with the boundary value conditions can be numerically solved by first converting it into two 1st order PDE’s, described by:

 

 




 
The two PDE’s can then be converted into ODE’s using the Method of Lines:

 

 




By dividing the spatial domain into N elements over the total length L, the 2nd order PDE has now reduced to a set of ODE’s that can be quite easily integrated numerically.

Monday, August 11, 2014

Heat Eqn. solved with the L-stable Coefficients



The heat equation with a step function as boundary condition for temperature at time t=0 is solved below, following the example from DaFeda's post. The Method of Lines has been incorporated with the Rosenbrock method using the L-stablecoefficients. The step function used a boundary condition of 100 deg F for locations between 0.25 and 0.7 units along the length, at time t=0. The spatial solution is plotted below.