How to solve differential equation
Mostrar comentarios más antiguos
Hello,
I have the following equations as seen below, and I need to get out p(x) and t(x). I understand that maybe Runge Kutta method should be used, but I do not se how I can solve it. I write "integrate" to show how the equation looks, not that I believe that matlab works that way.
Constants: Er, Es, pi, xa, xd, t1, R, my, vs.
b(x) = -(2/(pi*Er))*integrate[(p(s)*ln(abs((s+xa)/s-x))]ds; % integrate from -xa to xd
t(x) = t1 - (xa^2-x^2)/R + 2*b(x);
q(x) = my*p(x);
dp/dx = -(Es/t(x))*dt/dx+(vs/(1-vs))*2*q(x)/t(x);
It would be amazing if anyone could help me!
Best regards
Christopher
4 comentarios
Torsten
el 7 de Jun. de 2017
... and the differential equation for p is to be integrated from -xa to xd ?
... and you are sure that the integral in the expression for b(x) is to be taken between -xa and xd, not between -xa and x ?
Best wishes
Torsten.
Christopher Fallqvist
el 7 de Jun. de 2017
Torsten
el 7 de Jun. de 2017
So p is to be integrated between -xa and xd and the integral in the expression for b(x) is to be taken between -xa and xd, too ?
Best wishes
Torsten.
Christopher Fallqvist
el 7 de Jun. de 2017
Respuestas (1)
Torsten
el 7 de Jun. de 2017
0 votos
Choose a grid of stepsize deltax: -xa=x0<x1<x2<...<x_n=xb with x_(i+1)-x_i=deltax.
I suggest you use backward differencing for dp/dx and the trapezoidal rule for the integral.
You'll arrive at n nonlinear equations with unknowns p(x1),...,p(x_n).
The equations can be solved one after the other (sequentially) using MATLAB's "fzero".
Best wishes
Torsten.
1 comentario
Christopher Fallqvist
el 8 de Jun. de 2017
Categorías
Más información sobre Numerical Integration and Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!