|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70776 - in sandbox/odeint/branches/karsten: . boost/numeric/odeint/stepper libs/numeric/odeint/regression_test libs/numeric/odeint/test
From: karsten.ahnert_at_[hidden]
Date: 2011-03-31 03:07:40
Author: karsten
Date: 2011-03-31 03:07:38 EDT (Thu, 31 Mar 2011)
New Revision: 70776
URL: http://svn.boost.org/trac/boost/changeset/70776
Log:
rosenbrock4 dense output
Text files modified:
sandbox/odeint/branches/karsten/.cproject | 93 ++++++++++++++++++++-------------------
sandbox/odeint/branches/karsten/.project | 2
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp | 2
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp | 49 ++++++++++++++++----
sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/rosenbrock4.cpp | 55 +++++++++++++++++++++--
sandbox/odeint/branches/karsten/libs/numeric/odeint/test/rosenbrock4.cpp | 49 +++++++++++++-------
6 files changed, 169 insertions(+), 81 deletions(-)
Modified: sandbox/odeint/branches/karsten/.cproject
==============================================================================
--- sandbox/odeint/branches/karsten/.cproject (original)
+++ sandbox/odeint/branches/karsten/.cproject 2011-03-31 03:07:38 EDT (Thu, 31 Mar 2011)
@@ -5,51 +5,52 @@
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="0.1427786045">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1427786045" moduleId="org.eclipse.cdt.core.settings" name="Default">
-<externalSettings/>
-<extensions>
-<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-</extensions>
-</storageModule>
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<configuration buildProperties="" description="" id="0.1427786045" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
-<folderInfo id="0.1427786045." name="/" resourcePath="">
-<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1701227309" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
-<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1701227309.1923743366" name=""/>
-<builder cleanBuildTarget="--clean" command="bjam" id="org.eclipse.cdt.build.core.settings.default.builder.1866451942" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder">
-<outputEntries>
-<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name=""/>
-</outputEntries>
-</builder>
-<tool id="org.eclipse.cdt.build.core.settings.holder.libs.295828857" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
-<tool id="org.eclipse.cdt.build.core.settings.holder.1728088817" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
-<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.558519945" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
-<listOptionValue builtIn="false" value=""${BOOST_ROOT}""/>
-</option>
-<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1379843062" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
-</tool>
-<tool id="org.eclipse.cdt.build.core.settings.holder.780742962" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
-<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1009256344" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
-<listOptionValue builtIn="false" value=""${BOOST_ROOT}""/>
-</option>
-<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.157834134" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
-</tool>
-<tool id="org.eclipse.cdt.build.core.settings.holder.421502995" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
-<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.388283580" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
-<listOptionValue builtIn="false" value=""${BOOST_ROOT}""/>
-</option>
-<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1344941182" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
-</tool>
-</toolChain>
-</folderInfo>
-<sourceEntries>
-<entry excluding="mkl" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
-</sourceEntries>
-</configuration>
-</storageModule>
+ <configuration buildProperties="" description="" id="0.1427786045" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
+ <folderInfo id="0.1427786045." name="/" resourcePath="">
+ <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1701227309" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
+ <targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1701227309.1923743366" name=""/>
+ <builder cleanBuildTarget="--clean" command="bjam" id="org.eclipse.cdt.build.core.settings.default.builder.1866451942" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder">
+ <outputEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name=""/>
+ </outputEntries>
+ </builder>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.libs.295828857" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.1728088817" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <option id="org.eclipse.cdt.build.core.settings.holder.incpaths.558519945" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${BOOST_ROOT}""/>
+ </option>
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1379843062" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.780742962" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1009256344" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${BOOST_ROOT}""/>
+ </option>
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.157834134" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ <tool id="org.eclipse.cdt.build.core.settings.holder.421502995" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
+ <option id="org.eclipse.cdt.build.core.settings.holder.incpaths.388283580" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${BOOST_ROOT}""/>
+ </option>
+ <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1344941182" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="mkl" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
@@ -554,6 +555,6 @@
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<project id="odeint.null.1351650296" name="odeint"/>
-</storageModule>
+ <project id="odeint.null.1351650296" name="odeint"/>
+ </storageModule>
</cproject>
Modified: sandbox/odeint/branches/karsten/.project
==============================================================================
--- sandbox/odeint/branches/karsten/.project (original)
+++ sandbox/odeint/branches/karsten/.project 2011-03-31 03:07:38 EDT (Thu, 31 Mar 2011)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>karsten</name>
+ <name>odeint_new</name>
<comment></comment>
<projects>
<project>boost</project>
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp 2011-03-31 03:07:38 EDT (Thu, 31 Mar 2011)
@@ -74,7 +74,7 @@
/*
- * ToDo : xerr in size_adjuster
+ * ToDo : xerr in size_adjuster und adjust size
*/
template< class System >
boost::numeric::odeint::controlled_step_result
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp 2011-03-31 03:07:38 EDT (Thu, 31 Mar 2011)
@@ -10,6 +10,8 @@
#include <utility>
+#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
+
namespace boost {
namespace numeric {
namespace odeint {
@@ -19,17 +21,15 @@
{
void initialize_variables( void )
{
- boost::numeric::odeint::construct( m_x1 );
- boost::numeric::odeint::construct( m_x2 );
- m_size_adjuster.register_state( 0 , m_x1 );
- m_size_adjuster.register_state( 1 , m_x2 );
+ m_state_adjuster.register_state( 0 , m_x1 );
+ m_state_adjuster.register_state( 1 , m_x2 );
}
void copy_variables( const rosenbrock4_dense_output &rb )
{
m_stepper = rb.m_stepper;
- boost::numeric::copy( rb.m_x1 , m_x1 );
- boost::numeric::copy( rb.m_x2 , m_x2 );
+ m_x1 = rb.m_x1;
+ m_x2 = rb.m_x2;
if( rb.m_current_state == ( & ( rb.m_x1 ) ) )
{
m_current_state = &m_x1;
@@ -48,10 +48,12 @@
public:
typedef ControlledStepper controlled_stepper_type;
+ typedef typename controlled_stepper_type::stepper_type stepper_type;
typedef typename stepper_type::value_type value_type;
typedef typename stepper_type::state_type state_type;
typedef typename stepper_type::time_type time_type;
typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::adjust_size_policy adjust_size_policy;
typedef dense_output_stepper_tag stepper_category;
rosenbrock4_dense_output( const controlled_stepper_type &stepper = controlled_stepper_type() )
@@ -63,7 +65,7 @@
}
rosenbrock4_dense_output( const rosenbrock4_dense_output &rb )
- : m_stepper( stepper ) , m_state_adjuster() ,
+ : m_stepper() , m_state_adjuster() ,
m_x1() , m_x2() , m_current_state( &m_x1 ) , m_old_state( &m_x2 ) ,
m_t() , m_t_old() , m_dt()
{
@@ -79,8 +81,6 @@
~rosenbrock4_dense_output( void )
{
- boost::numeric::odeint::destruct( m_x1 );
- boost::numeric::odeint::destruct( m_x2 );
}
@@ -89,7 +89,7 @@
void initialize( const StateType &x0 , const time_type &t0 , const time_type &dt0 )
{
m_state_adjuster.adjust_size_by_policy( x0 , adjust_size_policy() );
- boost::numeric::odeint::copy( x0 , *m_current_state );
+ *m_current_state = x0;
m_t = t0;
m_dt = dt0;
}
@@ -131,6 +131,35 @@
}
+
+ const state_type& current_state( void ) const
+ {
+ return *m_current_state;
+ }
+
+ const time_type& current_time( void ) const
+ {
+ return m_t;
+ }
+
+ const time_type& previous_state( void ) const
+ {
+ return *m_old_state;
+ }
+
+ const time_type& previous_time( void ) const
+ {
+ return m_t_old;
+ }
+
+ const time_type& current_time_step( void ) const
+ {
+ return m_dt;
+ }
+
+
+
+
private:
controlled_stepper_type m_stepper;
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/rosenbrock4.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/rosenbrock4.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/rosenbrock4.cpp 2011-03-31 03:07:38 EDT (Thu, 31 Mar 2011)
@@ -12,6 +12,7 @@
#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp>
#include <boost/numeric/odeint/stepper/explicit_error_rk54_ck.hpp>
#include <boost/numeric/odeint/stepper/controlled_error_stepper.hpp>
@@ -147,7 +148,7 @@
void test_controlled_rosenbrock_with_stiff_system( void )
{
- const static size_t dim = 3;
+ const static size_t dim = 2;
typedef rosenbrock4< double > stepper_type;
typedef stepper_type::state_type state_type;
typedef stepper_type::matrix_type matrix_type;
@@ -158,14 +159,14 @@
controlled_stepper_type controlled_stepper;
- x[0] = 1.0 ; x[1] = 1.0 ; x[2] = 0.0;
+ x[0] = 1.0 ; x[1] = 1.0 ;
ofstream fout( "rosenbrock_controller_stiff.dat" );
size_t count = 0;
while( t < 50.0 )
{
fout << t << "\t" << dt << "\t" << controlled_stepper.last_error() << "\t";
- fout << x[0] << "\t" << x[1] << "\t" << x[2] << "\t";
+ fout << x[0] << "\t" << x[1] << "\t";
fout <<std::endl;
size_t trials = 0;
@@ -185,21 +186,62 @@
clog << "Rosenbrock: " << count << endl;
}
+void test_dense_output_rosenbrock_with_stiff_system( void )
+{
+ const static size_t dim = 2;
+ typedef rosenbrock4< double > stepper_type;
+ typedef stepper_type::state_type state_type;
+ typedef stepper_type::matrix_type matrix_type;
+ typedef rosenbrock4_controller< stepper_type > controlled_stepper_type;
+ typedef rosenbrock4_dense_output< controlled_stepper_type > dense_output_stepper_type;
+
+ state_type x( dim );
+ double t = 0.0 , dt = 1.0;
+
+ dense_output_stepper_type dense_output_stepper;
+ x[0] = 1.0 ; x[1] = 1.0 ;
+ dense_output_stepper.initialize( x , t , 0.00001 );
+
+ ofstream stepper_out( "rosenbrock_dense_output_stiff_stepper.dat" );
+ ofstream res_out( "rosenbrock_dense_output_stiff.dat" );
+ size_t count = 0;
+
+ while( t < 50.0 )
+ {
+ if( t < dense_output_stepper.current_time() )
+ {
+ dense_output_stepper.calc_state( t , x );
+ res_out << t << "\t" << x[0] << "\t" << x[1] << endl;
+ }
+ else
+ {
+ dense_output_stepper.do_step( make_pair( stiff_system() , stiff_system_jacobi() ) );
+ const state_type &xx = dense_output_stepper.current_state();
+ stepper_out << dense_output_stepper.current_time() << "\t" << xx[0] << "\t" << xx[1] << std::endl;
+ ++count;
+ continue;
+ }
+ t += dt;
+ }
+ clog << "Rosenbrock dense out : " << count << endl;
+
+}
+
void rk54_ck_controlled_with_stiff_system( void )
{
- typedef std::tr1::array< double , 3 > state_type2;
+ typedef std::tr1::array< double , 2 > state_type2;
typedef explicit_error_rk54_ck< state_type2 > stepper_type2;
typedef controlled_error_stepper< stepper_type2 > controlled_stepper_type2;
controlled_stepper_type2 stepper;
- state_type2 x = {{ 1.0 , 1.0 , 0.0 }};
+ state_type2 x = {{ 1.0 , 1.0 }};
double t = 0.0 , dt = 0.00001;
ofstream fout( "rk54_ck_controller_stiff.dat" );
size_t count = 0;
while( t < 50.0 )
{
fout << t << "\t" << dt << "\t" << stepper.last_error() << "\t";
- fout << x[0] << "\t" << x[1] << "\t" << x[2] << "\t";
+ fout << x[0] << "\t" << x[1] << "\t";
fout <<std::endl;
size_t trials = 0;
@@ -230,6 +272,7 @@
rk54_ck_stepper_with_lorenz();
test_controlled_rosenbrock_with_stiff_system();
rk54_ck_controlled_with_stiff_system();
+ test_dense_output_rosenbrock_with_stiff_system();
return 0;
}
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/rosenbrock4.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/rosenbrock4.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/rosenbrock4.cpp 2011-03-31 03:07:38 EDT (Thu, 31 Mar 2011)
@@ -17,6 +17,8 @@
#include <boost/test/unit_test.hpp>
#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
@@ -75,25 +77,38 @@
BOOST_AUTO_TEST_CASE( test_rosenbrock4_controller )
{
+ typedef rosenbrock4_controller< rosenbrock4< value_type > > stepper_type;
+ stepper_type stepper;
+
+ typedef stepper_type::state_type state_type;
+ typedef stepper_type::value_type stepper_value_type;
+ typedef stepper_type::deriv_type deriv_type;
+ typedef stepper_type::time_type time_type;
+ state_type x( 2 );
+ x( 0 ) = 0.0 ; x(1) = 1.0;
+
+ value_type t = 0.0 , dt = 0.01;
+ stepper.try_step( std::make_pair( sys , jacobi ) , x , t , dt );
}
-//BOOST_AUTO_TEST_CASE( test_euler )
-//{
-// implicit_euler< value_type > stepper;
-// state_type x( 2 );
-// x(0) = 0.0; x(1) = 1.0;
-//
-// value_type eps = 1E-12;
-//
-// stepper.do_step( std::make_pair( sys , jacobi ) , x , 0.0 , 0.1 );
-//
-// using std::abs;
-//
-// // compare with analytic solution of above system
-// BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
-// BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
-//
-//}
+BOOST_AUTO_TEST_CASE( test_rosenbrock4_dense_output )
+{
+ typedef rosenbrock4_dense_output< rosenbrock4_controller< rosenbrock4< value_type > > > stepper_type;
+ stepper_type stepper;
+
+ typedef stepper_type::state_type state_type;
+ typedef stepper_type::value_type stepper_value_type;
+ typedef stepper_type::deriv_type deriv_type;
+ typedef stepper_type::time_type time_type;
+
+ state_type x( 2 );
+ x( 0 ) = 0.0 ; x(1) = 1.0;
+ stepper.initialize( x , 0.0 , 0.1 );
+ std::pair< value_type , value_type > tr = stepper.do_step( std::make_pair( sys , jacobi ) );
+ stepper.calc_state( 0.5 * ( tr.first + tr.second ) , x );
+}
+
+
BOOST_AUTO_TEST_SUITE_END()
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk