# Can someone help me solve this different equation on matlab?

1 view (last 30 days)
Commented: Torsten on 18 Feb 2024
Hi everyone, I am trying to solve the following equation: 1/r * d/dr(r*dS/dr) + c1(S) - c2(S) = 0 I am trying to solve to find the value of “S”, r is the radius, and c1 and c2 are properties with values depending on S, how can I solve this on matlab? I tried using bvp4c but I probably put the wrong ode and wrong initial guesses so it wasn’t converging

Star Strider on 18 Feb 2024
Perhaps this —
% 1/r * d/dr(r*dS/dr) + c1 - c2
syms r S(r) c1 c2 S0 DS0
Eqn = 1/r * diff(r*diff(S),r) + c1 - c2
Eqn(r) =
S = dsolve(Eqn, S(0) == S0)
S =
.
Edited: Jad on 18 Feb 2024
Thank you everyone for the comments, Sam, the problem actually is related to plasma physics, i am trying to solve the Elenbaas Heller equation, which is the energy balance all function of what we call the heat flux, denoted as “S”. Basically, the differential equation I am trying to solve is the following: 1/r * d/dr(r*dS/dr) + sigma(S)*E^2 - 4*pi*epsilon(S) = 0 E is the electric field which is given (i’ll actually have to use a for loop to solve for several E values to draw a graph, but it is given not calculated), sigma(S) is the electric conductivity function of S, and epsilon(S) is a radiation parameter also function of S. r is the radius of the plasma, and i need to solve the differential equation to find the heat flux “S”
I know boundary conditions: S(r=0)=0 and dS(r=rmax)/dr=0
Torsten on 18 Feb 2024
It would be easiest if you include your attempt where you (unsuccessfully) used "bvp4c".