Originally Posted by

**Shinchan** HI,

i m a mech engg student currently working on a project to develop a mathematical model of a 4 cylinder diesel engine.

the equation i m trying to solve in matlab is of the basic form

Tcombustion + Tfriction+ Tmass = 0

all the above parameters (T 's) are fuctions of the crank angle (y) and has sme 2nd order terms

so i separated the 2nd order terms, 1st order terms and finally constant and created a seperate m-file for each of it

1st term:

term1=0.036+5*symsum((0.06)*(sin(y)+((0.5*sin(y)*c os(y))/sqrt(1- 0.025*(sin(y))^2)))1,2);

2nd term:

term2=(symsum((0.06)*(sin(y)+((0.5*sin(y)*cos(y))/sqrt(1-0.025*(sin(y))^2))),1,2))*(5*(0.06*cos(y)+(0.03125 *(sin(2*y))^2)/(1-0.025*(sin(y))^2)-(0.5*cos(2*y))/(sqrt(1-0.025*(sin(y))^2)))*y^2+(0.0025*symsum((0.06)*(sin (y)+((0.5*sin(y)*cos(y))/sqrt(1-0.025*(sin(y))^2))),1,2)));

3rd term :

term3=symsum((p2*y-p1)*ap*((0.06)*(sin(y)+((0.5*sin(y)*cos(y))/sqrt(1-0.025*(sin(y))^2)))),1,2);

Well its actually a mess of a lot of terms in here

now i hav to solve the 2nd order ode of the form

Ay''+By'+Cy=0

where A, B and C are the above terms

now i wrote a separate m file for the function which is :

function dydt=ode1(t,x)

dydt=zeros(2,1);

dydt(1)=x(2);

dydt(2)=-b(x(2)) - c(x(1));

where

x=y'

i m getting errors and not able to solve

can u guys help me with this

i m not sure but do i need to separate the 'y' terms in the equation ????