Explicite Euler and convergence
13 次查看(过去 30 天)
显示 更早的评论
I have a function with five variables and I use Explicite Euler methode to make a plot with all these ones. My code is like that:
function x = EulerExplicite(h,t0,tf,x0,f)
t = [t0:h:tf];
L = length(t);
x = zeros(size(x0,2),L);
x(:,1) = x0;
for i=2:L
x(:,i) = x(:,i-1) + h * f(t, x(:,i-1));
end
end
It must tend to a balance. I have to determine a condition that verified the balance we have. But I don't know how.
3 个评论
John D'Errico
2020-3-19
编辑:John D'Errico
2020-3-19
Yes, but we don't even see the text of the question. We don't know what is meant by balance. We don't even know the physical context of the equations, so the word balance is to us, essentially meaningless. Could this be a translation issue? That is, if English is not your main language, have you used balance in some context where it might mean something completely unexpected?
Ok, having said that, perhaps my best guess MIGHT be that this is some sort of mass balance thing, where the total mass must stay constant, and you are expected to show if that has indeed happened. In fact, this is a possible problem you might be posed, just to teach you that Euler's method can have problems in that respect. But that is just a wild and virtually random guess on my part.
Coould the intent to mean something about convergence? That is vaguely conceivable, but I don't think so, since then the word limit might have been used. Euler is not an iterative scheme that is used to runs until convergence.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!