Effacer les filtres
Effacer les filtres

Using cfit object as parameter in an equation

1 vue (au cours des 30 derniers jours)
Benedikt Trolp
Benedikt Trolp le 13 Nov 2017
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.

Réponses (0)

Catégories

En savoir plus sur Oil, Gas & Petrochemical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by