Hi, I'm trying to solve a system of 2 ODE with boundary conditions.
The integration variable is r, which is the sferical coordinate (radius of a sphere). At the end of the simulation I should get the values of A and B as a functions of r, where the maximum value of r is 1.
k,c,a,b are constants.
The system is as follows:
Equations:
BCs:
I converted the system to first order one, as follows:
Equations:
BCs:
Y3(0)=Y4(0)=0
Y1(1)=a
Y2(1)=b
How can I solve it?
Thank you!

 Réponse acceptée

Divija Aleti
Divija Aleti le 23 Avr 2021

0 votes

Hi Elia,
The following link gives an example of how to solve a system of two first-order differential equations with boundary conditions. Similarly, you can solve for your converted system of four first order differential equations.
Hope this helps!
Regards,
Divija

5 commentaires

Elia Paini
Elia Paini le 23 Avr 2021
Thanks! However, my system is a bit different because BCs are present, while in your link the focus is on initial conditions
Elia Paini
Elia Paini le 23 Avr 2021
I think the only way is to solve with bvp4c...or may I adapt your system?
Divija Aleti
Divija Aleti le 23 Avr 2021
Modifié(e) : Divija Aleti le 23 Avr 2021
You can solve in the same way shown in the example, just by replacing 't' in the example, with 'r', and giving your four boundary conditions.
Elia Paini
Elia Paini le 23 Avr 2021
Ok, thank you!!
Elia Paini
Elia Paini le 24 Avr 2021
I tried to use the way you suggested me, but Matlab can't find a solution. The message is as follows:
Warning: Unable to find symbolic solution.
I think that, because the complexity of the system, bvp4c must be used. In this way, results are correct.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by