Can some one solve a ODE and give me matlab code for "dx/dt=k(X-Xe)" where K,Xe both are time dependent

(dX/dt)=k(X-Xe)
k and Xe both are time dependent

1 Comment

You write that k and Xe are time-dependent. In what form are k and Xe available ? Do you have a list of values over time ? Or an explicit function of time ?
Best wishes
Torsten.

Sign in to comment.

Answers (1)

function main
[T,Y] = ode15s(@myfun,[0 14],[3.93]);
plot(T,Y(:,1),'-o')
function dx = myfun(t,x)
k=0.6854*exp(-3316.1/((15*sin((5*3.1415*t)/3)+25)+273.15));
xe=(((0.00822)*( 0.107*exp(561.66/((15*sin((5*3.1415*t)/3)+25)+273))) *(0.911*exp(9.07/((15*sin((5*3.1415*t)/3)+25)+273)))*0.98))/( (1-(0.911*exp(9.07/((15*sin((5*3.1415*t)/3)+25)+273.15)))*0.98)*((1-(0.911*exp(9.07/((15*sin((5*3.1415*t)/3)+25)+273.15)))*0.98)+(( 0.107*exp(561.66/((15*sin((5*3.1415*t)/3)+25)+273)))*(0.911*exp(9.07/((15*sin((5*3.1415*t)/3)+25)+273.15)))*0.98)));
dx=k*(x(1)-xe);
Best wishes
Torsten.

Categories

Find more on Programming in Help Center and File Exchange

Tags

Asked:

on 30 Nov 2015

Commented:

on 30 Nov 2015

Community Treasure Hunt

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

Start Hunting!