How can I model a temperature change using MATLAB?

  • Thread starter Thread starter BubblesAreUs
  • Start date Start date
  • Tags Tags
    Matlab Modelling
Click For Summary
SUMMARY

This discussion focuses on modeling temperature change using MATLAB, specifically the equation k = Delta Q / t, where Delta Q is a fixed value of -40. The user seeks to determine the time variable t by iterating over k values from 0 to 10 minutes in 0.5-minute increments. Key insights include the necessity of using MATLAB's array indexing with parentheses (e.g., x(0) instead of x[0]) and the distinction between MATLAB and Python in handling arrays.

PREREQUISITES
  • Understanding of MATLAB array indexing
  • Familiarity with basic thermodynamics equations
  • Knowledge of loop structures in programming
  • Experience with plotting functions in MATLAB
NEXT STEPS
  • Learn MATLAB for loop syntax and structure
  • Explore MATLAB array indexing techniques
  • Research plotting functions in MATLAB for visualizing data
  • Study the implications of fixed versus floating variables in mathematical modeling
USEFUL FOR

Students and professionals in engineering, physics, or any field requiring temperature modeling, particularly those using MATLAB for simulations and data analysis.

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.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
5K
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
0
Views
2K