Navigation: Scripting Reference Manual > Functions & Subroutines > AddPowerLawGrinMaterial

 

AddPowerLawGrinMaterial

 

Contact Us: fredsupport@photonengr.com

 

Description

This function adds a Power-Law Gradient Index Material node to the Materials folder of the object tree and returns the node number of the newly created material.  The material is added with a default name, "GRIN Power Law".

 

 

Syntax

matNode = AddPowerLawGrinMaterial(  wavl, n1, n2, alpha, g )

 

 

Parameters

matNode (Long)

Returned node number of the newly created material.

 

wavl As Double

This parameter defines the wavelength (in microns) to which n1 and n2 correspond.

 

n1 As Double

This parameter is the on-axis refractive index value.

 

n2 As Double

This parameter is the cladding refractive index value.

 

alpha As Double

This parameter is the core radius of the associated optical fiber.

 

g As Double

This parameter is the power law exponent and typically has a value around 2.0 but may be in the range 1.5 to 2.5 (not strictly enforced).

 

 

Example

The example below demonstrates how to add a new power law GRIN material, update its name and then add additional wavelength samples for the on-axis and cladding refractive index values.

 

Sub Main

 

    Dim wavl As Double, n1 As Double, n2 As Double

    Dim alpha As Double, g As Double

    Dim matNode As Long

 

    'Initial parameters

    wavl    = 0.62 'microns

    n1      = 1.4893

    n2      = 1.3

    alpha   = 1.0

    g       = 2.0

    matNode = AddPowerLawGRINMaterial( wavl, n1, n2, alpha, g )

    SetMaterialName( matNode, "Custom Power Law GRIN" )

    Update

 

    Print "Power-law GRIN added at node " & matNode

 

    'Now add additional wavelength samples

    AppendPowerLawGRINMaterial( matNode, 0.63, 1.4889, 1.2996 )

    AppendPowerLawGRINMaterial( matNode, 0.64, 1.4886, 1.2993 )

    AppendPowerLawGRINMaterial( matNode, 0.65, 1.4883, 1.2990 )

    Update

 

End Sub

 

See Also

Materials Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC