Plotting Time Step Range for Temperature Profiles in Matlab/Mathematica

  • Context: MATLAB 
  • Thread starter Thread starter Dustinsfl
  • Start date Start date
  • Tags Tags
    Plot Range Time
Click For Summary
SUMMARY

This discussion focuses on plotting temperature profiles using a series approximation in Matlab and Mathematica for the dimensionless time interval $t \in [0,4]$. The temperature function is defined as a combination of cosine terms with exponential decay, specifically: $$T(x,t) = 1.7624\cos(0.86x)e^{-0.86^2t} - 0.1638\cos(3.426x)e^{-3.426^2t} + ... - 0.0025\cos(38.31x)e^{-28.31^2t}.$$ The participants provide specific instructions for implementing this in Mathematica, including using the Plot function for various time steps and combining plots with the Show function.

PREREQUISITES
  • Understanding of series approximations in mathematical modeling
  • Familiarity with temperature profile equations
  • Proficiency in using Matlab or Mathematica for plotting
  • Knowledge of exponential decay functions
NEXT STEPS
  • Learn how to implement the Plot function in Mathematica for multiple time steps
  • Explore the use of the Show function in Mathematica to combine multiple plots
  • Investigate the impact of varying coefficients in temperature profile equations
  • Study the application of series approximations in other physical phenomena
USEFUL FOR

Mathematicians, physicists, and engineers interested in modeling temperature profiles and visualizing data using Matlab or Mathematica.

Dustinsfl
Messages
2,217
Reaction score
5
Using this series approximation, plot the temperature profiles on the same set of axes for a range of time steps in the dimensionless time interval $t\in [0,4]$ in order to visualize the process.
$$
\begin{alignat*}{3}
T(x,t) & = & 1.7624\cos(0.86x)e^{-0.86^2t} - 0.1638\cos(3.426x)e^{-3.426^2t} + 0.476\cos(6.437x)e^{6.437^2t}\\
& - & 0.0218\cos(9.529x)e^{-9.529^2t} + 0.0124\cos(12.645x)e^{-12.645^2t} - 0.0080\cos(15.771x)e^{-15.771^2t}\\
& + & 0.0055\cos(18.902x)e^{-18.902^2t} - 0.0041\cos(22.036x)e^{-22.036^2t} + 0.0031\cos(25.172x)e^{-25.172^2t}\\
& - & 0.0025\cos(38.31x)e^{-28.31^2t}
\end{alignat*}
$$
How can I do this in Matlab or Mathematica?
 
Physics news on Phys.org
In Mathematica, you could do something like this:

f[x_,t_]=your_function
PlotOne=Plot[... at t=0]
PlotTwo=Plot[... at t=0.5]
PlotThree=Plot[... at t=1]
.
.
.
Show[PlotOne,PlotTwo,PlotThree].
 
PlotOne = Plot[f[x,0],{x,-10,10}]

Like this?
 
Exactly. Just make sure your $x$ range corresponds to the region of interest for the problem.