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

조회 수: 3 (최근 30일)
Jamie Al
Jamie Al 2021년 4월 27일
답변: Jamie Al 2021년 4월 27일
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일
Sorry, I just editted the post.

댓글을 달려면 로그인하십시오.

채택된 답변

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에서 Operators and Elementary Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by