Formula personalizzata della colonnaVorrei aggiungere una nuova colonna "Vth" nella mia tabella con il seguente calcolo: -
Per prima cosa devo trovare l'indice i della colonna 'Id' dove 'Id' è più vicino a 1e-6; e quindi Vth = Vg(i). Dovrebbe essere raggruppato anche per le colonne Mod e Dispositivo. Cioè, ogni combinazione univoca di Mod e Dispositivo avrà un V° valore.
| Id | Vg | Mod | Dispositivo | V |
| 2.00E-06 | 3 | 1A | X1 | |
| 2.00E-07 | 2.8 | 1A | X1 | |
| 2.00E-08 | 2.6 | 1A | X1 | |
| 2.00E-09 | 2.4 | 1A | X1 | |
| 2.00E-10 | 2.2 | 1A | X1 | |
| 2.00E-12 | 2 | 1A | X1 | |
| 3.00E-06 | 3 | 1B | X1 | |
| 3.00E-07 | 2.8 | 1B | X1 | |
| 3.00E-08 | 2.6 | 1B | X1 | |
| 3.00E-09 | 2.4 | 1B | X1 | |
| 3.00E-10 | 2.2 | 1B | X1 | |
| 3.00E-12 | 2 | 1B | X1 | |
| 4.00E-06 | 3 | 1A | Y1 | |
| 4.00E-07 | 2.8 | 1A | Y1 | |
| 4.00E-08 | 2.6 | 1A | Y1 | |
| 4.00E-09 | 2.4 | 1A | Y1 | |
| 4.00E-10 | 2.2 | 1A | Y1 | |
| 4.00E-12 | 2 | 1A | Y1 | |
| 5.00E-06 | 3 | 1B | Y1 | |
| 5.00E-07 | 2.8 | 1B | Y1 | |
| 5.00E-08 | 2.6 | 1B | Y1 | |
| 5.00E-09 | 2.4 | 1B | Y1 | |
| 5.00E-10 | 2.2 | 1B | Y1 | |
| 5.00E-12 | 2 | 1B | Y1 | |
Tabella datiSceneggiaturaRe: Formula personalizzata colonnaEcco le colonne per generare ciò che stai chiedendo.Ho preso la tua formula di interpolazione così com'è e l'ho implementata.Potrebbe essere necessario modificare alcune cose.
Names default to Here(1);
// Create the sample data table
dt=New Table( "Example",
Add Rows( 24 ),
New Column( "ID",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.000002, 0.0000002, 0.00000002, 0.000000002, 0.0000000002,
0.000000000002, 0.000003, 0.0000003, 0.00000003, 0.000000003,
0.0000000003, 0.000000000003, 0.000004, 0.0000004, 0.00000004,
0.000000004, 0.0000000004, 0.000000000004, 0.000005, 0.0000005,
0.00000005, 0.000000005, 0.0000000005, 0.000000000005]
)
),
New Column( "VG",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[3, 2.8, 2.6, 2.4, 2.2, 2, 3, 2.8, 2.6, 2.4, 2.2, 2, 3, 2.8, 2.6, 2.4,
2.2, 2, 3, 2.8, 2.6, 2.4, 2.2, 2]
)
),
New Column( "Mod",
Character( 16 ),
"Nominal",
Set Values(
{"1A", "1A", "1A", "1A", "1A", "1A", "1B", "1B", "1B", "1B", "1B", "1B",
"1A", "1A", "1A", "1A", "1A", "1A", "1B", "1B", "1B", "1B", "1B", "1B"}
)
),
New Column( "Device",
Character( 16 ),
"Nominal",
Set Values(
{"X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1",
"Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1"}
)
)
);
// Find the index
dt << New Column("Row", formula(
theMin = Col Minimum( Abs( 0.000001 - :ID ), :Mod, :Device );
theValue = .;
If( Abs( 0.000001 - :ID[Row()] ) == theMin,
show(.000001 - :ID[Row()]);
theValue = Row()
);));
dt<<NEW column=""> 0,
iRow = theRow - 1,
.000001 - :ID[theRow] < 0,
iRow = theRow +1,
iRow = theRow
);
);
));
iRow;
// Set the Vth
dt<<NEW column=""></NEW></NEW>Re: Formula personalizzata colonnaGrazie Jim. Funziona. Come posso modificarlo per trovare il Vth che corrisponde esattamente a 1e-6 di ID per interpolazione. Cioè trovare un indice prima e dopo 1e-6 di ID e quindi interpolare.
indice=più vicino a 1e-6 (maggiore di 1e-6)
Interpola(x, [VG(indice) VG(indice-1)], [log10(ID(indice)) log10(ID(indice-1))]);
Re: Formula personalizzata colonnaEcco un piccolo script che crea 2 nuove colonne che ti danno i risultati che hai chiesto.L'immagine seguente ha cancellato la colonna provvisoria poiché è solo una colonna di lavoro.
Names default to Here(1);
// Create the sample data table
dt=New Table( "Example",
Add Rows( 24 ),
New Column( "ID",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.000002, 0.0000002, 0.00000002, 0.000000002, 0.0000000002,
0.000000000002, 0.000003, 0.0000003, 0.00000003, 0.000000003,
0.0000000003, 0.000000000003, 0.000004, 0.0000004, 0.00000004,
0.000000004, 0.0000000004, 0.000000000004, 0.000005, 0.0000005,
0.00000005, 0.000000005, 0.0000000005, 0.000000000005]
)
),
New Column( "VG",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[3, 2.8, 2.6, 2.4, 2.2, 2, 3, 2.8, 2.6, 2.4, 2.2, 2, 3, 2.8, 2.6, 2.4,
2.2, 2, 3, 2.8, 2.6, 2.4, 2.2, 2]
)
),
New Column( "Mod",
Character( 16 ),
"Nominal",
Set Values(
{"1A", "1A", "1A", "1A", "1A", "1A", "1B", "1B", "1B", "1B", "1B", "1B",
"1A", "1A", "1A", "1A", "1A", "1A", "1B", "1B", "1B", "1B", "1B", "1B"}
)
),
New Column( "Device",
Character( 16 ),
"Nominal",
Set Values(
{"X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1", "X1",
"Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1", "Y1"}
)
)
);
// Find the index
dt << New Column("Row", formula(
theMin = Col Minimum( Abs( 0.000001 - :ID ), :Mod, :Device );
theValue = .;
If( Abs( 0.000001 - :ID[Row()] ) == theMin,
theValue = Row()
);));
// Set the Vth
dt<<NEW column=""></NEW>