Fix step bvp4c

Hello
How do I fix step size at bvp4c when I solve my problem.
I want to show a specific point value and the step mesh is auto and I can't enter specific number of mesh because I don't know number of mesh
[Merged from continuation question]
Answer about bvp4c fix step at runtime.
We have only specific point at the my domain for example my domain is [0, 0.1, 0.2, 0.3,0.4] When solver bvp4c solve my equation the domain have not just 5 mesh and maybe have 5 maybe have more than 5 mesh and when I want understand number of all mesh I must use function length(x) then length is variable some time is 5 point some time is more than 5 point and when I want value variable at X=0.2 I can't understand number of mesh because the mesh is auto maybe the number mesh 3 is X=O.2 or maybe another number mesh is X=0.2.
How do i fix step mesh at timerun.?forexample I wanThank you But the answer is not for me. We have only specific point at the my domain for example my domain is [0, 0.1, 0.2, 0.3,0.4] When solver bvp4c solve my equation the domain have not just 5 mesh and maybe have 5 maybe have mor than 5 mesh and when I want understand number of all mesh I must use function length(x) then length is variable some time is 5 point some time is mor than 5 point and when I want value variable at X=0.2 I can't understand number of mesh because the mesh is auto maybe the number mesh 3 is X=O.2 or maybe another number mesh is X=0.2.
How do i fix step at timerun.? for example I specific 5 point and I want show function length (x) just 5 mesh and not more than 5 point and I want 5 mesh and not more than 5 (just 5)

Answers (2)

Torsten
Torsten on 13 Nov 2015
Edited: Torsten on 13 Nov 2015

1 vote

From the documentation of bvp4c:
Use the function deval and the output sol of bvp4c to evaluate the solution at specific points xint in the interval [a,b].
sxint = deval(sol,xint)
Best wishes
Torsten.
Mostafa Mostafa
Mostafa Mostafa on 13 Nov 2015

0 votes

Thank you But the answer is not for me. We have only specific point at the my domain for example my domain is [0, 0.1, 0.2, 0.3,0.4] When solver bvp4c solve my equation the domain have not just 5 mesh and maybe have 5 maybe have mor than 5 mesh and when I want understand number of all mesh I must use function length(x) then length is variable some time is 5 point some time is mor than 5 point and when I want value variable at X=0.2 I can't understand number of mesh because the mesh is auto maybe the number mesh 3 is X=O.2 or maybe another number mesh is X=0.2.
How do i fix step at timerun.?I want specific forexample 5 point and I want 5 mesh and not more than 5

1 Comment

Torsten
Torsten on 13 Nov 2015
You can't limit the mesh bvp4c uses. But you can interpolate the values from your mesh to the mesh of bvp4c by using MATLAB's interp1.
Best wishes
Torsten.

Sign in to comment.

Tags

Asked:

on 13 Nov 2015

Edited:

on 14 Nov 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!