[英]solving differential equation using matlab
I have a question and just need you to tell me the steps I have to do.我有一个问题,只需要你告诉我我必须做的步骤。 I have an equation with boundary conditions.the question is how can I find f(x)?
我有一个带有边界条件的方程。问题是我怎样才能找到 f(x)? I don't want to use the predefined Matlab.Please just show me the steps I need to solve this problem.
我不想使用预定义的 Matlab。请告诉我解决此问题所需的步骤。 Thanks...
谢谢...
Simply you can use symbolic math toolbox in MATLAB:只需在 MATLAB 中使用符号数学工具箱:
syms f(x) % Define symbolic function
F = dsolve(diff(f,2) + diff(f,1) + 200*f == 0);
% Find C1 and C2 constants
syms C1 C2 L
BC_eq(1) = subs(F, x, 0) - 0;
BC_eq(2) = subs(F, x, L) - 100;
C_val = solve(BC_eq, [C1, C2]);
% Substitude C' values in F
F_final = subs(F, {C1, C2}, {C_val.C1, C_val.C2})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.