PDA

View Full Version : How to solve : dT/dt = k(T-Tm)... T(0) = To... k,Tm,&To are constants


savage44
Feb 24, 2011, 05:00 AM
How to solve : dT/dt = k(T-Tm)... T(0) = To... k,Tm,&To are constants
I would like to try to solve this using Maple software, but not sure what the steps are. If not with Maple just showing the steps would be a great help.

Thanks

Unknown008
Feb 24, 2011, 07:34 AM
Is that what you are asking for?

\frac{dT}{dt} = k(T - T_m)

Then, to solve this, divide by (T - Tm) and multiply by dt, on both sides, adding the integration sign:

\int \frac{1}{T - T_m} \ dT = k\int\ dt

When t = 0, T = To
When t = t, T = T.

Hence:

\int\ ^T_{T_o} \frac{1}{T - T_m} \ dT = k\int\ ^t_0 \ dt

Can you complete it?

savage44
Feb 24, 2011, 09:21 AM
I'm not sure how to go about the limits(?)... T -> To & t -> 0

Unknown008
Feb 24, 2011, 09:45 AM
I'm not sure what you are asking here... sorry :(

When you evaluate the integral, you get:

\ln (T - T_m) - \ln(T_o - T_m) = k(t - 0)

And then you can simplify.

jcaron2
Feb 24, 2011, 01:58 PM
How to solve : dT/dt = k(T-Tm)....T(0) = To....k,Tm,&To are constants
I would like to try to solve this using Maple software, but not sure what the steps are. If not with Maple just showing the steps would be a great help.

Thanks

First the manual way:

T'=k(T-T_m)

T' - kT = -kT_m

This is a simple linear first-order differential equation. Now we need to find an integrating factor u(t) that satisfies

-k \cdot u(t) = u'(t)

The answer to that, by inspection is simply

u(t) = e^{-kt}

Multiplying your entire equation by u(t), we then get

u(t) \cdot T' - u(t) \cdot kT = -kT_m \cdot u(t)

T'e^{-kt} - kTe^{-kt} = -kT_m e^{-kt}

Now, notice that the entire left side is the derivative of T*u(t):

T'e^{-kt} - kTe^{-kt} = (Te^{-kt})'

so

(Te^{-kt})' = -kT_m e^{-kt}

Now we can integrate both sides with respect to t:

\int (Te^{-kt})' dt= \int -kT_m e^{-kt}dT

Te^{-kt}= T_me^{-kt}+C

T= T_m+Ce^{kt},

where C is a constant. This is where your initial conditions come in (to find the value of C).

T(0)=T_0

so

T(0)= T_m+Ce^{0 \cdot t}=T_0

T_m+C=T_0

C=T_0-T_m

Plugging that back into the solution for T(t), we finally get:

T(t)= T_m+(T_0-T_m)e^{kt}

Tadaaah! There's your final solution.

-------------------------------------------------

Now, to do it with Maple I think you'd do the following:

DE1 := diff(T(t), t) = k*(T(t) - Tm);

dsolve ( { DE1, T(0) = T0 }, T(t) );


Does it give you the same answer? My differential equations are almost as rusty as my Maple skills. :)

jcaron2
Feb 24, 2011, 02:09 PM
Is that what you are asking for?

\frac{dT}{dt} = k(T - T_m)

Then, to solve this, divide by (T - Tm) and multiply by dt, on both sides, adding the integration sign:

\int \frac{1}{T - T_m} \ dT = k\int\ dt

When t = 0, T = To
When t = t, T = T.

Hence:

\int\ ^T_{T_o} \frac{1}{T - T_m} \ dT = k\int\ ^t_0 \ dt

Can you complete it?

In this case it's significantly more complicated than that because T is a function, not a variable. The goal here is not to find the value of T, but rather to find the function T(t) which satisfies the differential equation under the condition that T(0) = To.

If you plug in my answer, T(t)=Tm + (To-Tm)exp(kt), you'll find that it does indeed satisfy the differential equation in general, as well as the specified initial condition that T(0) = To.

There's a pretty good primer on solving this type of first-order ODE here: Pauls Online Notes : Differential Equations - Linear Equations (http://tutorial.math.lamar.edu/Classes/DE/Linear.aspx)

Unknown008
Feb 25, 2011, 06:32 AM
Um... okay. I see what you mean now. I never did those types of differential equations >.<

Thanks for the link! I'll see if I can understand it :)

Unknown008
Feb 25, 2011, 07:12 AM
Hm.. I just read the first example in the site you gave using what I did here and I got the answer, and I then tried that problem, I got the same answer as yours :)

I guess that only when the variables are 'unseparable' that I'll need to use the method of the site you gave me.

jcaron2
Feb 25, 2011, 07:16 AM
Thanks for the link! I'll see if I can understand it :)

I have complete faith that you'll be an first-order ODE expert by the end of the day. :)

jcaron2
Feb 25, 2011, 07:26 AM
Hm.. I just read the first example in the site you gave using what I did here and I got the answer, and I then tried that problem, I got the same answer as yours :)

I guess that only when the variables are 'unseparable' that I'll need to use the method of the site you gave me.


I just went back and did this problem using your technique too, and you're absolutely right.

Sorry I ever doubted you. :o


So now the OP has two different techniques for solving the DE (three if you include Maple :)). Yours is more intuitive.

Unknown008
Feb 25, 2011, 08:01 AM
I'm starting to get it. I did up to example 5. Example 6 is next! :p

jcaron2
Feb 25, 2011, 08:16 AM
Paul's site is pretty awesome, isn't it? He's got everything on there from basic algebra up through partial differential equations.

Like I said, I'm guessing by the end of the day you'll know more than he does. :)