来自“拟合”的方程式的拉普拉斯变换

这是我之前对上一个问题的跟踪:Laplace transform of numerical data in MATLAB


我已经实验性地收集了数据,并希望对此进行拉普拉斯变换。但是,laplace()需要模型/方程式。我找到了一个拟合方程来对以下数据进行建模:

[up,lo] = envelope(dat);

x = 1:length(up);
x = x';

f = fit(x,up,'poly3');

然后对于我的Laplace转换,我需要传递

的输出
f = fit(x,'poly3');

进入

syms f
laplace(f)

但是此刻,它吐出了f的变换:

laplace(f)

ans =

1/s^2

如果这是f

f = 

     Linear model Poly3:
     f(x) = p1*x^3 + p2*x^2 + p3*x + p4
     Coefficients (with 95% confidence bounds):
       p1 =   1.772e-12  (1.593e-12,1.951e-12)
       p2 =  -2.211e-08  (-2.483e-08,-1.939e-08)
       p3 =   2.847e-05  (1.676e-05,4.017e-05)
       p4 =      0.2762  (0.2627,0.2897)

如何找到f的Laplace变换?

RENXIAODUO87 回答:来自“拟合”的方程式的拉普拉斯变换

我对fit的输出不熟悉,但是您的符号变量至少应为x,因为这是您的因变量。然后,您可以自己建立f

p1 =   1.772e-12;
p2 =  -2.211e-08;
p3 =   2.847e-05;
p4 =      0.2762;

syms x

f = p1*x.^3 + p2*x.^2 + p3*x + p4;

laplace(f)
ans =

(8402860860456175*((50949907131585781563392*s)/5251788037785109375 + 1))/(295147905179352825856*s^2) - 6682337467919863/(151115727451828646838272*s^3) + 26323556995364325/(2475880078570760549798248448*s^4)

fit()为您提供了fitobject类型的变量,如果我正确理解its documentation,可以将其作为结构进行访问。这意味着您应该能够以编程方式使用拟合的参数来构建符号x的功能。

本文链接:https://www.f2er.com/2804256.html

大家都在问