Matlab 电磁阀电感L作为其柱塞位置x函数的评估
我需要在Matlab中解决一个问题,其中我必须根据以下公式计算每个柱塞位置的电磁阀电感值: f=0.5*i^2(dL/dx) i是提供给电磁阀的电流,f是柱塞在其位置每一步上的作用力 我需要提取L的值作为x的函数 我尝试使用以下Matlab代码:Matlab 电磁阀电感L作为其柱塞位置x函数的评估,matlab,ode45,Matlab,Ode45,我需要在Matlab中解决一个问题,其中我必须根据以下公式计算每个柱塞位置的电磁阀电感值: f=0.5*i^2(dL/dx) i是提供给电磁阀的电流,f是柱塞在其位置每一步上的作用力 我需要提取L的值作为x的函数 我尝试使用以下Matlab代码: L0 = 3.8184e-3; % inital value of induactance i = 8.75; % current in amp
L0 = 3.8184e-3; % inital value of induactance
i = 8.75; % current in ampere
x = plungerPosition; % data exported in .mat file from excel
for j = 1:numel(F) % F is the force at each plunger position, also exported in .mat file from excel
[x,L] = ode45(@eval, x, L0,[],F(j));
end
function dLdx = eval(x,F,i)
dLdx = (F/0.5*i^2); % equation is dL/dx = F/0.5*i^2
如果你能提供宝贵的意见,那就太好了
感谢和问候,
古瑟姆萨贾