Please show us what you have tried and exactly where you are stuck.How can I numerically solve the below equation, assume I have K(z), the solution is in the [0,L] domain, the conditions are: A(0)=1, B(L)=1
1. dA/dz = -K(z)*A(z) -K(z)*B(z)
2. dB/dz = -K(z)*A(z) -K(z)*B(z)
There are, of course, many different numerical methods that can be used. I, personally, would divide the interval from 0 to L into N (some large number) sub intervals, 0 to L/N, L/N to 2L/N, 2L/N to 3L/N, etc.. Then write the differential equations as "difference equations", approximating the derivatives by difference quotients:How can I numerically solve the below equation, assume I have K(z), the solution is in the [0,L] domain, the conditions are: A(0)=1, B(L)=1
1. dA/dz = -K(z)*A(z) -K(z)*B(z)
2. dB/dz = -K(z)*A(z) -K(z)*B(z)