How should I get multiple solutions related to different BCs in this script?
1 次查看(过去 30 天)
显示 更早的评论
Hi, I'm solving a system of ODEs with BCs, with bvp4c function.
My simplified script is as follows:
rmesh = ...
solinit = ...
sol = bvp4c(@bvpfcn,@bcs,solinit);
function dydr = bvpfcn(r,y)
...
end
function res = bcs(ya,yb,C)
...
end
In this case, I solved this system with prefixed values of BCs, reported inside of the second function with the vector C. Thus, I have only one solution, which is related to those BCs values.
However, I'd like to solve this problem with a for loop, through different vectors as input in BCs function in order to have multiple distict solutions, one for every BCs I inserted.
Is this the correct way?
for i=1:10 % 10 vectors of BCs
rmesh= ...
solinit= ...
sol = ??
end
Obviously, I should pass one BC at a time, but I'm interested to do it all together.
Thank you!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Boundary Value Problems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!