Square Root Function Block

Analysis Task

Task: Generate an interpretable symbolic formula describing the nonliner multi-input/multi-output behaviour.
Input: II, VLOAD
Output: IVLOAD, V5

Import Data and Setup Equations

data = 
      ReadSimulationData["sqrt.txt", "DC Sweep", 
        Simulator -> "PSpice"];

\(TransientPlot[data, {"V(5)"[II]}, {II, 0.00002, 0.001}, \ 
      PlotRange -> {0.6, 0.8}]; 

    TransientPlot[data, {"I(VLOAD)"[II]}, {II, 0.00002, 0.001}]; \)

\(V5PSpice[ii_] = "V(5)"[ii] /. First[data]; 

    IVLOADPSpice[ii_] = "I(VLOAD)"[ii] /. First[data]; \)

\(netlist = 
      ReadNetlist["sqrt.cir", KeepPrefix -> False, 
        Simulator -> "PSpice"]; 
DisplayForm@netlist\)

mnaFull = 
      
CircuitEquations[
netlist, 
        
AnalysisMode -> DC, 
        
ElementValues -> Symbolic,  
        
Value 
          -> {"*" -> {TEMP, TNOM, $q, $k}}
]

DisplayForm[mnaFull]

solutionFull = NDAESolve[mnaFull, {II, 0.00002, 0.001}];

\(TransientPlot[
      solutionFull, {V$5[II], V5PSpice[II]}, {II, 0.00002, 0.001}, \ 
      PlotRange -> {0.6, 0.8}]; 

    TransientPlot[
      solutionFull, {I$VLOAD[II], IVLOADPSpice[II]}, {II, 0.00002, 0.001}]; 
    \)

Apply Nonlinear Simplification Routines

\(v5maxerror\  = \ 0.005; 
ivloadmaxerror = 0.000025; \)

\(PlotV5[solutionFull]; 
PlotIVLOAD[solutionFull]; \)

DTrange = {
{VLOAD, 0,  3.5,  3.5/5}, 
        
{II,  0.00002,  0.001,  
          ( 0.001 - 0.00002)/5}}

Statistics[mnaFull]

step1 = 
      CompressNonlinearEquations[mnaFull,  {I$VLOAD,  V$5}, 
        Protocol -> All];

Statistics[step1]

step2 = 
      NonlinearSetup[step1, {II, VLOAD}, {V$5,  I$VLOAD}, 
        DT -> {Range -> DTrange}];

step3 = 
      CancelTerms[step2, 
         {DT -> {V$5 -> v5maxerror,  
              I$VLOAD -> ivloadmaxerror}},  
        Protocol -> {Notebook,  StatusLine}]

Statistics[step3]

step4 = 
      CompressNonlinearEquations[step3,  {V$5, I$VLOAD}, 
        Protocol -> All]

step4 // DisplayForm

\(step4 = ApplyDesignPoint[step4, KeepSymbolic -> {"*"}]; 

    step4 // DisplayForm\)

solution4 = NDAESolve[step4, {II, 0.00002, 0.001}];

\(PlotV5[solution4]; 
PlotIVLOAD[solution4]; \)

Solve[step4, V$5] // N

equation = Eliminate[step4[[1, 1]], {V$3, V$4, V$5}]

Solve[Map[Exp, equation],  I$VLOAD]

Initialization Cells

Read Mathematica package Analog Insydes:

Off[General::spell,  General::spell1, Solve::ifun,  Solve::incnst, 
      Eliminate::ifun];

\($NotebookDirectory = 
      ToFileName@
        First["FileName" /. NotebookInformation[EvaluationNotebook[]]]; 

    PrependTo[$Path, $NotebookDirectory]; \)

<< AnalogInsydes`;

SetDirectory[ToFileName[{$NotebookDirectory, "PSpice"}]];

\(SetOptions[TransientPlot, 
      
PlotStyle 
        -> {{Hue[0], AbsoluteThickness[3]}, {Hue[0.4], 
            AbsoluteThickness[3], AbsoluteDashing[{12, 12}]}, {
            RGBColor[0, 0, 1], AbsoluteThickness[1], 
            AbsoluteDashing[{6, 6}]}, {RGBColor[0, 0, 1], 
            AbsoluteThickness[1], AbsoluteDashing[{6, 6}]}}, 
      
Background -> RGBColor[1, 1, 1]
]; 

    SetOptions[DXFGraphics, 
      
Background -> GrayLevel[1. ]
]; 

    SetOptions[NDAESolve, 
MaxIterations -> 200]; 

    SetOptions[NonlinearSetup, Protocol -> {Notebook, \ StatusLine}]; 

    SetOptions[DefaultDTSimulation, \ InitialGuess -> Automatic]; 

    SetOptions[CancelTerms, \ Protocol -> {Notebook, \ StatusLine}]; 
    \)

\(V5UpperBound[II_] := V5PSpice[II] + v5maxerror; 

    V5LowerBound[II_] := V5PSpice[II] - v5maxerror; 

    IVLOADUpperBound[II_] := IVLOADPSpice[II] + ivloadmaxerror; 

    IVLOADLowerBound[II_] := IVLOADPSpice[II] - ivloadmaxerror; \)

\(PlotV5[solution_] := 
      TransientPlot[solution, 
        
{V$5[II], V5PSpice[II], 
          
V5LowerBound[II], V5UpperBound[II]}, {II, 
          0.00002, 0.001}, \ PlotRange -> {0.6, 0.8}, 
        PlotLabel -> "V$5[II]"]; 

    PlotIVLOAD[solution_] := 
      TransientPlot[solution, 
        
{I$VLOAD[II], IVLOADPSpice[II], 
          IVLOADLowerBound[II], IVLOADUpperBound[II]}, 
        
{II, 0.00002, 0.001}, 
        PlotLabel -> "I$VLOAD[II]"]; \)

Copyright © 2000 by ITWM e.V.

Analog Insydes
ITWM - Institut für Techno- und Wirtschaftsmathematik e.V.
Gottlieb-Daimler-Str.
D-67663 Kaiserslautern, Germany

Analog Insydes is a trademark of ITWM.
Mathematica is a registered trademark of Wolfram Research, Inc.
All other product names are trademarks of their respective owners.

Copying and redistribution of this notebook is welcomed and encouraged, provided that the entire contents of the document, in particular the above copyright notice, is left unchanged and that the file is redistributed free of charge.