Invalid Initial Conditions Error
조회 수: 21 (최근 30일)
이전 댓글 표시
I keep getting an invalid initial condition error and I don't have enough experience using MATLAB to properly debug.
Running this code,
syms x(t) y(t) z(t) Dx Dy Dz Dx_i Dy_i Dz_i;
Dx = dsolve(diff(x, t) == x);
Dy = dsolve(diff(y, t) == y);
Dz = dsolve(diff(z, t) == z);
Dx_i = diff(x(0)) == 0;
Dy_i = diff(y(0)) == 0;
Dz_i = diff(z(0)) == 0;
cond = [x(0) == 1, y(0) == -1, z(0) == 1, Dx_i, Dy_i, Dz_i];
disp('Exercise 1c')
[x(t), y(t), z(t)] = dsolve([diff(x, t, 2) == 1*Dx - x - y, diff(y, t, 2) == -x - 1*Dy - y - 1*Dz, diff(z ,t ,2) == -9*z], cond)
As per as I am able to in regards to this questions,

I keep getting the error,
Error using mupadengine/feval_internal
Invalid initial conditions.
Error in dsolve>mupadDsolve (line 334)
T = feval_internal(symengine,'symobj::dsolve',sys,x,options);
Error in dsolve (line 203)
sol = mupadDsolve(args, options);
Error in Systems_of_Equations (line 20)
[x(t), y(t), z(t)] = dsolve([diff(x, t, 2) == 1*Dx - x - y, ...
댓글 수: 0
답변 (1개)
Suresh Maddina
2020년 12월 16일
Hi, it is my understanding that you are trying to solve the system of differential equations in (c) (equation on the above image) using the initial conditions in (d)
The dsolve is incorrectly used with Dx, Dy, Dz terms. The initial conditions Dx, Dy, Dz are incorrectly defined. You may try the following
syms x(t) y(t) z(t) Dx_i Dy_i Dz_i;
Dx_i = diff(x, t);
Dy_i = diff(y, t);
Dz_i = diff(z, t);
cond = [x(0) == 1, y(0) == -1, z(0) == 1, Dx_i(0)==0, Dy_i(0)==0, Dz_i(0)==0];
[x(t), y(t), z(t)] = dsolve([diff(x, t, 2) == 1*diff(x,t) - x - y, diff(y, t, 2) == -x - 1*diff(y,t) - y - 1*diff(z,t), diff(z ,t ,2) == -9*z], cond)
Please refer to the dsolve examples here https://www.mathworks.com/help/symbolic/dsolve.html#bve5m8o-4
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!