How to solve a second degree derivative with another variable
2 次查看(过去 30 天)
显示 更早的评论
Dereje
2018-1-31
(M)'' + N*M= 0;
Is it possible to solve the above equation if N is not a constant ?
16 个评论
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.
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
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
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
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
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
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
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
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)