Heat Equation Plot Problem
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
David Ding
le 25 Sep 2017
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 commentaires
Svetlana Pease
le 25 Sep 2017
Modifié(e) : Svetlana Pease
le 26 Sep 2017
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 commentaires
Svetlana Pease
le 26 Sep 2017
Modifié(e) : Svetlana Pease
le 26 Sep 2017
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:
Voir également
Catégories
En savoir plus sur Eigenvalue Problems dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!