<s> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> from __future__ import absolute_import <EOL> import sys , os <EOL> if os . path . join ( sys . path [ <NUM_LIT:0> ] [ : sys . path [ <NUM_LIT:0> ] . rfind ( os . sep ) ] , '<STR_LIT:..>' ) not in sys . path : <EOL> sys . path . append ( os . path . join ( sys . path [ <NUM_LIT:0> ] [ : sys . path [ <NUM_LIT:0> ] . rfind ( os . sep ) ] , '<STR_LIT:..>' ) ) <EOL> import pyeq2 <EOL> import numpy <EOL> numpy . seterr ( all = '<STR_LIT:ignore>' ) <EOL> import pyeq2 . Model_3D_BaseClass <EOL> class RomanSurfaceMinus ( pyeq2 . Model_3D_BaseClass . Model_3D_BaseClass ) : <EOL> _baseName = "<STR_LIT>" <EOL> _HTML = '<STR_LIT>' <EOL> _leftSideHTML = '<STR_LIT:z>' <EOL> _coefficientDesignators = [ '<STR_LIT:k>' ] <EOL> _canLinearSolverBeUsedForSSQABS = False <EOL> webReferenceURL = '<STR_LIT>' <EOL> baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions = False <EOL> autoGenerateOffsetForm = True <EOL> autoGenerateReciprocalForm = True <EOL> autoGenerateInverseForms = True <EOL> autoGenerateGrowthAndDecayForms = True <EOL> independentData1CannotContainZeroFlag = False <EOL> independentData1CannotContainPositiveFlag = False <EOL> independentData1CannotContainNegativeFlag = False <EOL> independentData2CannotContainZeroFlag = False <EOL> independentData2CannotContainPositiveFlag = False <EOL> independentData2CannotContainNegativeFlag = False <EOL> def GetDataCacheFunctions ( self ) : <EOL> functionList = [ ] <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . XSQMINUSYSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . YSQMINUSXSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . XSQPLUSYSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> return self . extendedVersionHandler . GetAdditionalDataCacheFunctions ( self , functionList ) <EOL> def CalculateModelPredictions ( self , inCoeffs , inDataCacheDictionary ) : <EOL> XSQMINUSYSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> YSQMINUSXSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> XSQPLUSYSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> k = inCoeffs [ <NUM_LIT:0> ] <EOL> try : <EOL> temp = ( k * YSQMINUSXSQ - XSQMINUSYSQ * numpy . sqrt ( k * k - XSQMINUSYSQ ) ) / ( <NUM_LIT> * XSQPLUSYSQ ) <EOL> return self . extendedVersionHandler . GetAdditionalModelPredictions ( temp , inCoeffs , inDataCacheDictionary , self ) <EOL> except : <EOL> return numpy . ones ( len ( inDataCacheDictionary [ '<STR_LIT>' ] ) ) * <NUM_LIT> <EOL> def SpecificCodeCPP ( self ) : <EOL> s = "<STR_LIT>" <EOL> return s <EOL> class RomanSurfaceMinus_OffsetXY ( pyeq2 . Model_3D_BaseClass . Model_3D_BaseClass ) : <EOL> _baseName = "<STR_LIT>" <EOL> _HTML = '<STR_LIT>' <EOL> _leftSideHTML = '<STR_LIT:z>' <EOL> _coefficientDesignators = [ '<STR_LIT:k>' , '<STR_LIT:a>' , '<STR_LIT:b>' ] <EOL> _canLinearSolverBeUsedForSSQABS = False <EOL> webReferenceURL = '<STR_LIT>' <EOL> baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions = False <EOL> autoGenerateOffsetForm = True <EOL> autoGenerateReciprocalForm = True <EOL> autoGenerateInverseForms = True <EOL> autoGenerateGrowthAndDecayForms = True <EOL> independentData1CannotContainZeroFlag = False <EOL> independentData1CannotContainPositiveFlag = False <EOL> independentData1CannotContainNegativeFlag = False <EOL> independentData2CannotContainZeroFlag = False <EOL> independentData2CannotContainPositiveFlag = False <EOL> independentData2CannotContainNegativeFlag = False <EOL> def GetDataCacheFunctions ( self ) : <EOL> functionList = [ ] <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . X ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . Y ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> return self . extendedVersionHandler . GetAdditionalDataCacheFunctions ( self , functionList ) <EOL> def CalculateModelPredictions ( self , inCoeffs , inDataCacheDictionary ) : <EOL> x_in = inDataCacheDictionary [ '<STR_LIT:X>' ] <EOL> y_in = inDataCacheDictionary [ '<STR_LIT:Y>' ] <EOL> k = inCoeffs [ <NUM_LIT:0> ] <EOL> a = inCoeffs [ <NUM_LIT:1> ] <EOL> b = inCoeffs [ <NUM_LIT:2> ] <EOL> try : <EOL> temp_x_sq = ( x_in + a ) * ( x_in + a ) <EOL> temp_y_sq = ( y_in + b ) * ( y_in + b ) <EOL> temp = ( k * ( temp_y_sq - temp_x_sq ) - ( temp_x_sq - temp_y_sq ) * numpy . sqrt ( k * k - temp_x_sq - temp_y_sq ) ) / ( <NUM_LIT> * ( temp_x_sq + temp_y_sq ) ) <EOL> return self . extendedVersionHandler . GetAdditionalModelPredictions ( temp , inCoeffs , inDataCacheDictionary , self ) <EOL> except : <EOL> return numpy . ones ( len ( inDataCacheDictionary [ '<STR_LIT>' ] ) ) * <NUM_LIT> <EOL> def SpecificCodeCPP ( self ) : <EOL> s = '<STR_LIT>' <EOL> s += '<STR_LIT>' <EOL> s += "<STR_LIT>" <EOL> return s <EOL> class RomanSurfaceMinus_ScaledAndOffsetXY ( pyeq2 . Model_3D_BaseClass . Model_3D_BaseClass ) : <EOL> _baseName = "<STR_LIT>" <EOL> _HTML = '<STR_LIT>' <EOL> _leftSideHTML = '<STR_LIT:z>' <EOL> _coefficientDesignators = [ '<STR_LIT:k>' , '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT:c>' , '<STR_LIT:d>' ] <EOL> _canLinearSolverBeUsedForSSQABS = False <EOL> webReferenceURL = '<STR_LIT>' <EOL> baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions = False <EOL> autoGenerateOffsetForm = True <EOL> autoGenerateReciprocalForm = True <EOL> autoGenerateInverseForms = True <EOL> autoGenerateGrowthAndDecayForms = True <EOL> independentData1CannotContainZeroFlag = False <EOL> independentData1CannotContainPositiveFlag = False <EOL> independentData1CannotContainNegativeFlag = False <EOL> independentData2CannotContainZeroFlag = False <EOL> independentData2CannotContainPositiveFlag = False <EOL> independentData2CannotContainNegativeFlag = False <EOL> def GetDataCacheFunctions ( self ) : <EOL> functionList = [ ] <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . X ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . Y ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> return self . extendedVersionHandler . GetAdditionalDataCacheFunctions ( self , functionList ) <EOL> def CalculateModelPredictions ( self , inCoeffs , inDataCacheDictionary ) : <EOL> x_in = inDataCacheDictionary [ '<STR_LIT:X>' ] <EOL> y_in = inDataCacheDictionary [ '<STR_LIT:Y>' ] <EOL> k = inCoeffs [ <NUM_LIT:0> ] <EOL> a = inCoeffs [ <NUM_LIT:1> ] <EOL> b = inCoeffs [ <NUM_LIT:2> ] <EOL> c = inCoeffs [ <NUM_LIT:3> ] <EOL> d = inCoeffs [ <NUM_LIT:4> ] <EOL> try : <EOL> temp_x_sq = ( a * x_in + b ) * ( a * x_in + b ) <EOL> temp_y_sq = ( c * y_in + d ) * ( c * y_in + d ) <EOL> temp = ( k * ( temp_y_sq - temp_x_sq ) - ( temp_x_sq - temp_y_sq ) * numpy . power ( k * k - temp_x_sq - temp_y_sq ) ) / ( <NUM_LIT> * ( temp_x_sq + temp_y_sq ) ) <EOL> return self . extendedVersionHandler . GetAdditionalModelPredictions ( temp , inCoeffs , inDataCacheDictionary , self ) <EOL> except : <EOL> return numpy . ones ( len ( inDataCacheDictionary [ '<STR_LIT>' ] ) ) * <NUM_LIT> <EOL> def SpecificCodeCPP ( self ) : <EOL> s = '<STR_LIT>' <EOL> s += '<STR_LIT>' <EOL> s += "<STR_LIT>" <EOL> return s <EOL> class RomanSurfacePlus ( pyeq2 . Model_3D_BaseClass . Model_3D_BaseClass ) : <EOL> _baseName = "<STR_LIT>" <EOL> _HTML = '<STR_LIT>' <EOL> _leftSideHTML = '<STR_LIT:z>' <EOL> _coefficientDesignators = [ '<STR_LIT:k>' ] <EOL> _canLinearSolverBeUsedForSSQABS = False <EOL> webReferenceURL = '<STR_LIT>' <EOL> baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions = False <EOL> autoGenerateOffsetForm = True <EOL> autoGenerateReciprocalForm = True <EOL> autoGenerateInverseForms = True <EOL> autoGenerateGrowthAndDecayForms = True <EOL> independentData1CannotContainZeroFlag = False <EOL> independentData1CannotContainPositiveFlag = False <EOL> independentData1CannotContainNegativeFlag = False <EOL> independentData2CannotContainZeroFlag = False <EOL> independentData2CannotContainPositiveFlag = False <EOL> independentData2CannotContainNegativeFlag = False <EOL> def GetDataCacheFunctions ( self ) : <EOL> functionList = [ ] <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . XSQMINUSYSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . YSQMINUSXSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . XSQPLUSYSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> return self . extendedVersionHandler . GetAdditionalDataCacheFunctions ( self , functionList ) <EOL> def CalculateModelPredictions ( self , inCoeffs , inDataCacheDictionary ) : <EOL> XSQMINUSYSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> YSQMINUSXSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> XSQPLUSYSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> k = inCoeffs [ <NUM_LIT:0> ] <EOL> try : <EOL> temp = ( k * YSQMINUSXSQ + XSQMINUSYSQ * numpy . sqrt ( k * k - XSQMINUSYSQ ) ) / ( <NUM_LIT> * XSQPLUSYSQ ) <EOL> return self . extendedVersionHandler . GetAdditionalModelPredictions ( temp , inCoeffs , inDataCacheDictionary , self ) <EOL> except : <EOL> return numpy . ones ( len ( inDataCacheDictionary [ '<STR_LIT>' ] ) ) * <NUM_LIT> <EOL> def SpecificCodeCPP ( self ) : <EOL> s = "<STR_LIT>" <EOL> return s <EOL> class RomanSurfacePlus_scaled ( pyeq2 . Model_3D_BaseClass . Model_3D_BaseClass ) : <EOL> _baseName = "<STR_LIT>" <EOL> _HTML = '<STR_LIT>' <EOL> _leftSideHTML = '<STR_LIT:z>' <EOL> _coefficientDesignators = [ '<STR_LIT:k>' , '<STR_LIT>' ] <EOL> _canLinearSolverBeUsedForSSQABS = False <EOL> webReferenceURL = '<STR_LIT>' <EOL> baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions = False <EOL> autoGenerateOffsetForm = True <EOL> autoGenerateReciprocalForm = True <EOL> autoGenerateInverseForms = True <EOL> autoGenerateGrowthAndDecayForms = True <EOL> independentData1CannotContainZeroFlag = False <EOL> independentData1CannotContainPositiveFlag = False <EOL> independentData1CannotContainNegativeFlag = False <EOL> independentData2CannotContainZeroFlag = False <EOL> independentData2CannotContainPositiveFlag = False <EOL> independentData2CannotContainNegativeFlag = False <EOL> def GetDataCacheFunctions ( self ) : <EOL> functionList = [ ] <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . XSQMINUSYSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . YSQMINUSXSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . XSQPLUSYSQ ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> return self . extendedVersionHandler . GetAdditionalDataCacheFunctions ( self , functionList ) <EOL> def CalculateModelPredictions ( self , inCoeffs , inDataCacheDictionary ) : <EOL> XSQMINUSYSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> YSQMINUSXSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> XSQPLUSYSQ = inDataCacheDictionary [ '<STR_LIT>' ] <EOL> k = inCoeffs [ <NUM_LIT:0> ] <EOL> scale = inCoeffs [ <NUM_LIT:1> ] <EOL> try : <EOL> temp = scale * ( k * YSQMINUSXSQ + XSQMINUSYSQ * numpy . sqrt ( k * k - XSQMINUSYSQ ) ) / ( <NUM_LIT> * XSQPLUSYSQ ) <EOL> return self . extendedVersionHandler . GetAdditionalModelPredictions ( temp , inCoeffs , inDataCacheDictionary , self ) <EOL> except : <EOL> return numpy . ones ( len ( inDataCacheDictionary [ '<STR_LIT>' ] ) ) * <NUM_LIT> <EOL> def SpecificCodeCPP ( self ) : <EOL> s = "<STR_LIT>" <EOL> return s <EOL> class RomanSurfacePlus_OffsetXY ( pyeq2 . Model_3D_BaseClass . Model_3D_BaseClass ) : <EOL> _baseName = "<STR_LIT>" <EOL> _HTML = '<STR_LIT>' <EOL> _leftSideHTML = '<STR_LIT:z>' <EOL> _coefficientDesignators = [ '<STR_LIT:k>' , '<STR_LIT:a>' , '<STR_LIT:b>' ] <EOL> _canLinearSolverBeUsedForSSQABS = False <EOL> webReferenceURL = '<STR_LIT>' <EOL> baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions = False <EOL> autoGenerateOffsetForm = True <EOL> autoGenerateReciprocalForm = True <EOL> autoGenerateInverseForms = True <EOL> autoGenerateGrowthAndDecayForms = True <EOL> independentData1CannotContainZeroFlag = False <EOL> independentData1CannotContainPositiveFlag = False <EOL> independentData1CannotContainNegativeFlag = False <EOL> independentData2CannotContainZeroFlag = False <EOL> independentData2CannotContainPositiveFlag = False <EOL> independentData2CannotContainNegativeFlag = False <EOL> def GetDataCacheFunctions ( self ) : <EOL> functionList = [ ] <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . X ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . Y ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> return self . extendedVersionHandler . GetAdditionalDataCacheFunctions ( self , functionList ) <EOL> def CalculateModelPredictions ( self , inCoeffs , inDataCacheDictionary ) : <EOL> x_in = inDataCacheDictionary [ '<STR_LIT:X>' ] <EOL> y_in = inDataCacheDictionary [ '<STR_LIT:Y>' ] <EOL> k = inCoeffs [ <NUM_LIT:0> ] <EOL> a = inCoeffs [ <NUM_LIT:1> ] <EOL> b = inCoeffs [ <NUM_LIT:2> ] <EOL> try : <EOL> temp_x_sq = ( x_in + a ) * ( x_in + a ) <EOL> temp_y_sq = ( y_in + b ) * ( y_in + b ) <EOL> temp = ( k * ( temp_y_sq - temp_x_sq ) + ( temp_x_sq - temp_y_sq ) * numpy . sqrt ( k * k - temp_x_sq - temp_y_sq ) ) / ( <NUM_LIT> * ( temp_x_sq + temp_y_sq ) ) <EOL> return self . extendedVersionHandler . GetAdditionalModelPredictions ( temp , inCoeffs , inDataCacheDictionary , self ) <EOL> except : <EOL> return numpy . ones ( len ( inDataCacheDictionary [ '<STR_LIT>' ] ) ) * <NUM_LIT> <EOL> def SpecificCodeCPP ( self ) : <EOL> s = '<STR_LIT>' <EOL> s += '<STR_LIT>' <EOL> s += "<STR_LIT>" <EOL> return s <EOL> class RomanSurfacePlus_ScaledAndOffsetXY ( pyeq2 . Model_3D_BaseClass . Model_3D_BaseClass ) : <EOL> _baseName = "<STR_LIT>" <EOL> _HTML = '<STR_LIT>' <EOL> _leftSideHTML = '<STR_LIT:z>' <EOL> _coefficientDesignators = [ '<STR_LIT:k>' , '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT:c>' , '<STR_LIT:d>' ] <EOL> _canLinearSolverBeUsedForSSQABS = False <EOL> webReferenceURL = '<STR_LIT>' <EOL> baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions = False <EOL> autoGenerateOffsetForm = True <EOL> autoGenerateReciprocalForm = True <EOL> autoGenerateInverseForms = True <EOL> autoGenerateGrowthAndDecayForms = True <EOL> independentData1CannotContainZeroFlag = False <EOL> independentData1CannotContainPositiveFlag = False <EOL> independentData1CannotContainNegativeFlag = False <EOL> independentData2CannotContainZeroFlag = False <EOL> independentData2CannotContainPositiveFlag = False <EOL> independentData2CannotContainNegativeFlag = False <EOL> def GetDataCacheFunctions ( self ) : <EOL> functionList = [ ] <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . X ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> functionList . append ( [ pyeq2 . DataCache . DataCacheFunctions . Y ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ) <EOL> return self . extendedVersionHandler . GetAdditionalDataCacheFunctions ( self , functionList ) <EOL> def CalculateModelPredictions ( self , inCoeffs , inDataCacheDictionary ) : <EOL> x_in = inDataCacheDictionary [ '<STR_LIT:X>' ] <EOL> y_in = inDataCacheDictionary [ '<STR_LIT:Y>' ] <EOL> k = inCoeffs [ <NUM_LIT:0> ] <EOL> a = inCoeffs [ <NUM_LIT:1> ] <EOL> b = inCoeffs [ <NUM_LIT:2> ] <EOL> c = inCoeffs [ <NUM_LIT:3> ] <EOL> d = inCoeffs [ <NUM_LIT:4> ] <EOL> try : <EOL> temp_x_sq = ( a * x_in + b ) * ( a * x_in + b ) <EOL> temp_y_sq = ( c * y_in + d ) * ( c * y_in + d ) <EOL> temp = ( k * ( temp_y_sq - temp_x_sq ) + ( temp_x_sq - temp_y_sq ) * numpy . sqrt ( k * k - temp_x_sq - temp_y_sq ) ) / ( <NUM_LIT> * ( temp_x_sq + temp_y_sq ) ) <EOL> return self . extendedVersionHandler . GetAdditionalModelPredictions ( temp , inCoeffs , inDataCacheDictionary , self ) <EOL> except : <EOL> return numpy . ones ( len ( inDataCacheDictionary [ '<STR_LIT>' ] ) ) * <NUM_LIT> <EOL> def SpecificCodeCPP ( self ) : <EOL> s = '<STR_LIT>' <EOL> s += '<STR_LIT>' <EOL> s += "<STR_LIT>" <EOL> return s </s>
