How to solve differential equation

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
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
Christopher Fallqvist el 7 de Jun. de 2017
Yes, you are right Torsten. Thanks.
Christopher
Torsten
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
Christopher Fallqvist el 7 de Jun. de 2017
Sorry for misleading you with my last answer: I ment between -xa and x.
Best regards
Christopher

Iniciar sesión para comentar.

Respuestas (1)

Torsten
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
Christopher Fallqvist el 8 de Jun. de 2017
Thank you!
I will try this and see if I solve the problem. Thanks again.
Best regards
Christopher

Iniciar sesión para comentar.

Categorías

Más información sobre Numerical Integration and Differential Equations en Centro de ayuda y File Exchange.

Preguntada:

el 7 de Jun. de 2017

Comentada:

el 8 de Jun. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by