Warning: Imaginary parts of complex X and/or Y arguments ignored.

3 次查看(过去 30 天)
I keep getting this error messgae when plotting some quantaties. My code points out that U_T is a cmplex double which is not true. So, I am not sure what is the problem, I know it happens in Line and in function C2P but I do not see how
gamma = 1.4;
sigmma = 1.0;
CFL = 0.1;
tend = 0.125;
N_max = 10000;
dx = 0.001;
L = 1;
x = 0:dx:L;
N = length(x);
rho1 = 1.0;
p1 = 1.0;
u1 = 0.0;
v1 = 0.0;
w1 = 0.0;
Bx1 = 0.0;
By1 = 0.0;
Bz1 = 0.0;
rho5 = 0.125;
p5 = 0.1;
u5 = 0.0;
v5 = 0.0;
w5 = 0.0;
Bx5 = 0.0;
By5 = 0.0;
Bz5 = 0.0;
VL = [rho1; u1; v1; w1; p1; Bx1; By1; Bz1];
VR = [rho5; u5; v5; w5; p5; Bx5; By5; Bz5];
I will attach my functions in case you wanna give it a run. But can someone help me understand the problem better. Thanks
  2 个评论
the cyclist
the cyclist 2021-4-27
I did try to run your code, but it errored at the line
[U_T, t] = MacCormack(U_T, gamma, t, dx, CFL, sigmma); % error here
Unrecognized function or variable 'MacCormack'

请先登录,再进行评论。

采纳的回答

Jamie Al
Jamie Al 2021-4-27
Thanks, but I found the error was a negative sign in a rooted term that needed an abs function to solve it.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Gamma Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by