如何在JMP中進行微積分?
有一個二維的數據,比如電流和時間,那麼在JMP Grapher中,我們可以繪製一條曲線並對其進行平滑擬合,具體請參見下圖。
會有多少電量?這意味著我想知道如何計算曲線下的面積?
數學方面,如何在JMP中進行微積分?
這是一個簡單的例子@馬克貝利的建議。
Names default to Here(1);
dt = New Table("Example",
Add Rows( 5 ),
New Column( "Time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [0, 2, 4, 6, 8] )
),
New Column( "I",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.303858872597443, 0.22418155030798, 0.202170635461688,
0.181779722721203, 0.148724968294765]
)
)
);
//use bivariate for simplicity
biv = dt << Bivariate(
Y( :I ),
X( :Time ),
Fit Polynomial( 3, {Confid Shaded Indiv( 1 ), Line Color( {212, 73, 88} )} ),
SendToReport(
Dispatch(
{},
"2",
ScaleBox,
{Min( 0 ), Max( 0.45 ), Inc( 0.05 ), Minor Ticks( 1 )}
)
)
);
//get the prediction formula string
fm = report(biv)[OutlineBox("Polynomial ?")][TextEditBox(1)] << get text;
//get the string to the right of the equal sign and convert the string to an expression using Parse()
fm = Parse(Trim(word(2, fm, "=")));
area = Integrate(fm, Time, col minimum(:Time), col maximum(:Time));
Caption("The area under this curve is " || char(area));

看幫助>腳本索引並蒐索整合功能。 此函數執行表達式的數值積分(擬合模型)。 使用索引中的“幫助”按鈕可以獲得有關此功能的更多信息。
您可能需要將擬合模型保存為新的列公式,然後使用簡短的腳本從公式中提取表達式並將其用作 Integrate() 函數的參數。