필터 지우기
필터 지우기

Using cfit object as parameter in an equation

조회 수: 1 (최근 30일)
Benedikt Trolp
Benedikt Trolp 2017년 11월 13일
Hello, My current Problem revolves around the gas Forces in the combustion chamber of an engine. The pressure inside the chamber has been given to me as an Excel sheet consisting of the pressure values dependent of the crank angle. My final Goal is to pass the function for the gas Forces to my 2nd order ODE which describes the Motion of the crank with respect to time.
D1q = diff(q,t);
D2q = diff(q,t,2);
BewGL=D2q-(1/Theta)*[Q_E-1/2*Theta_strich*D1q^2] == 0;
ODE_BewGL=odeToVectorField(BewGL);
ODE_BewGL_fcn = matlabFunction(ODE_BewGL, 'Vars' , [t Y]);
tspan = [0 10];
Y0 = [0 1];
[t,Y]=ode45(ODE_BewGL_fcn, tspan, Y0);
The gas Forces are included in the term "Q_E". I used the fit() function to fit a curve to my datapoints for the pressure. The fit works fine and i can evaluate it at an crank angle i want. I would now like to pass that fit which represents the pressure-curve as a function to my ODE. I tried using funtion handle and feval as a method of passing the fit to the ODE but that doesnt really work.( i get the error "Cannot evaluate cfit model for some reason") Is that a completely wrong Approach ? I'd be very thankful for any suggestions on how to create a continuous function of pressure over time from my datapoints and then passing it to my ODE.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Oil, Gas & Petrochemical에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by