Problem with using bvp4c inside a parfor loop
Show older comments
Hi everyone,
Can somebody provide a help about the following matter?
I have a boundary value problem to be solved in the form of:
d^2 F/dx^2 + u*sin(F) + beta * cos(f)=0.
I need to find the response of the F to the u coefficient. For that, I used a "for" loop in which the u is being changed. The code is working perfectly fine with "for" loop; the problem is, due to speed reason, I want to use "parfor", and by doing that I got this error:
%
Error using bvparguments (line 108)
Error in calling BVP4C(ODEFUN,BCFUN,SOLINIT):
The derivative function ODEFUN should return a column vector of length 8.
Error in bvp4c (line 129)
[n,npar,nregions,atol,rtol,Nmax,xyVectorized,printstats] = ...
Error in main_SL_SR (line 26)
parfor ii = 1:numel(Energy)
Can someone let me know what might be the problem?
Below is a part of the code:
%
parfor ii = 1:numel(Energy)
u=Energy(ii);
solinit=bvpinit(linspace(Left_point,Length_SR,10),[1 1 1 1 0 0 0 0]);
A=SL_SR_Diff_Eqs_par_test(u,c3,d3,d_j);
sol=bvp4c(A,@SL_SR_boundary_condition,solinit);
Answers (0)
Categories
Find more on Parallel for-Loops (parfor) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!