How to model temperature distribution over time over a 2 Dimensional laminar with increasing accuracy?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
My problem is that i have a code that involves up to at least 500 iterations to give a decent plot of contours showing the temperature distribution of a metal plate, with every number in the matrix representing one division of the plate. I'd have to repeatedly generate this plot with decreasing increments of the size of divisions until it reaches a certain accuracy,How should i do so?? help would be very appreciated.
0 comentarios
Respuestas (2)
Geoff
el 16 de Abr. de 2012
There's a few ways you could do this, and it depends on a number of things about your problem that probably only you know.
I might start by writing a function that computes the temperature distribution over the plate, given a number of subdivisions, ie
function [out] = ComputeTemperatureDistribution( args, step )
...
end
Where out and args are any number of variables required for your problem. So, subdivide in chunks of size step and compute until you reach a steady state or maximum number of iterations, then return the result resampled back to the original size of the metal plate.
Outside this function, I'd have a loop that takes initial conditions and controls the size of the divisions. It also uses the last answer as the initial conditions for the next. It might go like this:
info = some_kind_of_struct;
initialGuess = some_kind_of_guess;
step = 64;
while step >= 1
[answer, info] = ComputeTemperatureDistribution(initialGuess, info, step);
initialGuess = answer;
step = floor(step / 2);
end
Maybe this paradigm will be helpful to you.
0 comentarios
Walter Roberson
el 16 de Abr. de 2012
There are some mathematical calculations for which the increase in precision can be mathematically modeled, allowing the maximum number of iterations to be calculated.
When you mention "500", I immediately wonder whether it is 512, which could represent 10 bits increase in accuracy in a calculation that increased 1 bit in precision per division ? Or 20 bits for increase for the less common case of 2 bits increase in accuracy per division.
Do the divisions need to be changed sequentially? Could you instead run a binary search to find what you need?
0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!