How can I model a temperature change using MATLAB?

  • Thread starter Thread starter BubblesAreUs
  • Start date Start date
  • Tags Tags
    Matlab Modelling
AI Thread Summary
To model temperature change in MATLAB using the equation k = Delta Q / t, the user seeks to calculate time (t) given a fixed Delta Q of -40. The approach involves setting a loop for k values ranging from 0 to 10 minutes in 0.5 increments, and nesting the expression for t to plot a k vs t curve. It is clarified that Delta Q is a fixed variable, while k and t are floating variables dependent on it. Additionally, MATLAB's array indexing differs from Python, requiring the use of x(0) instead of x[0]. Proper understanding of these concepts will facilitate the modeling process in MATLAB.
BubblesAreUs
Messages
43
Reaction score
1

Homework Statement


Modelling the following equation:

k = Delta Q / t

Homework Equations



Q = T2 - T1 = -40 (fixed)

t = Delta Q / k. I need to find t.

k can be floating so I suppose 0 to 10 minutes with 0.5 increments

The Attempt at a Solution



I don't have MATLAB on me at the moment, but I think I should just set a loop for k, nest the expression for t and the plot a k vs t curve.

Does that sound right?
 
Physics news on Phys.org
Is the delta Q a fixed constant or does it depend on k or t?
 
jedishrfu said:
Is the delta Q a fixed constant or does it depend on k or t?
Delta Q is a fixed variable and rather k, t depend on it as they are floating variables.

MATLAB is a bit different from python in that its arrays aren't indexable. Say x = [1,2,3,4,5], I can't use x[0] = 1, x[3] = 4, etc.
 
Back
Top