How to solve a second degree derivative with another variable

(M)'' + N*M= 0;
Is it possible to solve the above equation if N is not a constant ?

16 件のコメント

Birdman
Birdman 2018 年 1 月 31 日
By not a constant, you mean it is dependent on a variable? Like N(x)?
Dereje
Dereje 2018 年 1 月 31 日
Yes M is dependent on t and N is dependent on x for example.
Torsten
Torsten 2018 年 1 月 31 日
And x varies with t ?
Jan
Jan 2018 年 1 月 31 日
Do you want to solve this symbolically or numerically?
Dereje
Dereje 2018 年 1 月 31 日
x and t are not dependent
Dereje
Dereje 2018 年 1 月 31 日
Numerically may be
Jan
Jan 2018 年 1 月 31 日
Maybe? Please decide this clearly.
Post more details by editing the question. Write down explicitly, what you want to solve, not just the rough formulation with the two characters N and M, but the real functions you have. Convert the 2nd order equation to a system of 1st order equations.
Torsten
Torsten 2018 年 1 月 31 日
If x does not depend on t, then N is constant.
John D'Errico
John D'Errico 2018 年 1 月 31 日
This is not a question about MATLAB at all, but simple mathematics. As such, there is no reason to post it on MATLAB Answers. Worse, it is very unclear, even after several responses by you in the comments as to what the real problem is.
However I'll point out that if you have a differential equation in the form posed, where both M(t) and N(t) are unknown functions, then no, a single differential equation is insufficient to infer the relations M(t) AND N(t).
If N depends on another variable x, then again, you CANNOT predict the relationship N(x) if that relationship is unknown.
If however, N(x) is a known function, then for ANY value of x, just predict N(x), and THEN solve the ODE, which is now a constant coefficient ODE, and in this example trivial to solve.
Dereje
Dereje 2018 年 1 月 31 日
But N is NOT a constant, if it is, it would be simple for me that the equation becomes harmonic and the solution for a source with an initial M0 is something like : M0cos(Nt)+sin(Nt)/N.
Dereje
Dereje 2018 年 1 月 31 日
Numerically I was not sure about the solution for the equation, that is why I said maybe. But in both ways it would be very helpful for me.
Torsten
Torsten 2018 年 1 月 31 日
If N does not depend on t (or another quantity that depends on t), what does it depend on if it's not constant ?
Dereje
Dereje 2018 年 1 月 31 日
This is N:
zval= [2 3 5 7 10 15 20 25 30 40 50 60 70 80 90 100 125 150 160 175 200 225 250 275 300 325 350 375 400];
rho1 = [17.2731684 17.1649375 21.43455647 22.4140625 23.86332207 24.3746967 24.70487685 24.6003125 24.8933125 25.42772826 26.03220776 26.439625 26.8151875 26.86830797 27.1949375 27.34406944 27.5551875 27.728625 27.23423729 27.88542857 27.752249049 28.1025 28.2415 28.37 28.05366667 28.6565 28.7755 28.898 29.013];
rho0=29;
g=9.8;
zvala=400-zval;
zvalue=fliplr(zvala);
rho2=fliplr(rho1);
rho3=smoothdata(rho2,'lowess',6);
rho=interp1(zvalue,rho3,z);
rho4=interp1(zvalue,rho3,z+0.1);
N=(-g./rho0).*(rho4-rho);
Here is I used ODE to calculate M
%if
function parameters=rhs(z,v)
alpha=0.099;
dV= 2*alpha*v(2);
dM= (v(1).*v(3))./(2*v(2)^3);
dF= -N.*v(1);
parameters=[dV;dM;dF];
end
Dereje
Dereje 2018 年 1 月 31 日
Here is I want a time derivative of M. And N is an external data which depend on the input data above.
Torsten
Torsten 2018 年 2 月 1 日
Form what you wrote above, I suspect that both M and N only depend on z and a variable t is not involved. Thus your equation would read
M''(z)+N(z)*M(z)=0
Is this correct ?
Best wishes
Torsten.
Dereje
Dereje 2018 年 2 月 1 日
Like you said M which is a momentum depends on z(depth). And N is a density profile which varies on Z and it's calculation is like I put is above. Now I wanted to get a result of M (Momentum) when it varies with time not z. The original equation is: d(F)/d(t)=-N*N*M and d(M)/d(t) =F Now combining the two gives (M)''(with dt) + N*NM=0;

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

タグ

質問済み:

2018 年 1 月 31 日

コメント済み:

2018 年 2 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by