Heat Equation Plot Problem
14 次查看(过去 30 天)
显示 更早的评论
Hi everyone. I'm new-ish to Matlab and I'm just trying to plot the heat equation, du/dt=d^2x/dt^2. I was trying to write a script based on the PDE toolbox and tried to follow examples but I don't want to use any boundary or initial conditions. I simply want this differential equation to be solved and plotted.
* * What my end goal is to essentially compare data that I have gathered to the equation. I gathered data for 0-24hrs (x-axis) and those values correspond to Temperature in Celcius (y-axis) which vary from 18-25 degrees Celcius. The data that I have resembles a cosine/sine curve. I just want to plot both on the same figure (which I have achieved with a basic cos(x) curve) and compare.
*I guess if I did need initial conditions x(0)=0, x(f)=24, but then I wouldn't know what to write for t (temperature) because I would just want it to vary based on the solution to the equation
Thank you!
0 个评论
回答(2 个)
David Ding
2017-9-25
Hi,
I am not quite understanding your workflow. First off, you do need initial conditions or boundary values to solve the differential equation, as the solution depends on those conditions. You are on the right track in that you need to input boundary values of temperature at time x = 0 and at time x = 24 (so this is a boundary-value problem). However, I do not understand what you mean by "I would just want it to vary based on the solution to the equation"? If you give boundary values for x = 0 and x = 24 (assume these values yield solutions), then you will obtain an unique solution.
If you are to obtain the unique solution based on your boundary conditions, please find the examples below to guide you:
Thanks,
David
0 个评论
Svetlana Pease
2017-9-25
编辑:Svetlana Pease
2017-9-26
Hi Ljuboslav,
David is right: you need to specify boundary or initial conditions in order to solve this equation. Actually, du/dt = d^2x/dt^2, x(0) = 0, x(f) = 24 seems incorrect. I think you meant to solve the equation du/dt = d^2u/dx^2 with the boundary conditions u(0) = u0, (24) = u24, where u0 is temperature at t = 0 and u24 is the temperature at t = 24.
Regards,
Svetlana Pease
Technical writer, MathWorks documentation group
2 个评论
Svetlana Pease
2017-9-26
编辑:Svetlana Pease
2017-9-26
Sorry, I still don't understand which equation are you trying to solve. If it's a heat equation, can you please write it down, including what each variable and function stands for? In particular, what x, t, and u(x) are?
You can look up a heat equation here, for example:
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Eigenvalue Problems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!