How to solve differential equation

2 Ansichten (letzte 30 Tage)
Christopher Fallqvist
Christopher Fallqvist am 7 Jun. 2017
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 Kommentare
Torsten
Torsten am 7 Jun. 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 am 7 Jun. 2017
Sorry for misleading you with my last answer: I ment between -xa and x.
Best regards
Christopher

Melden Sie sich an, um zu kommentieren.

Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by