How to plot Error function of complex numbers

조회 수: 16 (최근 30일)
HAREKRISHNA MANDAL
HAREKRISHNA MANDAL 2017년 8월 23일
댓글: Dilip Jose 2020년 2월 5일
Dear sir how have plotted for complex function taking omega=pi/2, M=0.5

채택된 답변

John BG
John BG 2017년 8월 24일
Hi Harekrishna Mandal
Although MATLAB standard functions erf and erfc only work with real inputs, there is the MATLAB implementation of erfc(z) z Complex, by S. Abrarov, available here
fadf.m Attached to this answer for convenience.
I reach the following plots for a time interval of [0 10] dt=0.01 and sample theta=1
clear all;close all;clc;
M=.4;w=pi/2;
dt=0.01;t1=0;t2=10;t=[t1:dt:t2];
theta=1; % sample value
p7_1=.25*exp(-1j*w*t)*exp(theta*(M-1j*w)^.5).*fadf((M-1j*w).^.5+.5*theta./(t).^.5);
p7_2=.25*exp(-1j*w*t)*exp(-theta*(M-1j*w)^.5).*fadf(-(M-1j*w).^.5+.5*theta./(t).^.5);
p7_3=.25*exp(1j*w*t)*exp(theta*(M+1j*w)^.5).*fadf((M+1j*w).^.5+.5*theta./(t).^.5);
p7_4=.25*exp(1j*w*t)*exp(-theta*(M+1j*w)^.5).*fadf(-(M+1j*w).^.5+.5*theta./(t).^.5);
p7=p7_1+p7_2+p7_3+p7_4;
abs_p7=abs(p7);arg_p7=angle(p7);
re_p7=real(p7);im_p7=imag(p7);
figure(1);plot(t,abs_p7,t,arg_p7);grid on;legend('|p7|','ang(p7)');
figure(2);plot(t,re_p7,t,im_p7);grid on;legend('re(p7)','im(p7)');
.
.
.
if you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance
John BG
  댓글 수: 5
Dilip Jose
Dilip Jose 2020년 2월 5일
sir ...for my problem symbolic variables exist in fadf....error..while compiling....
Example:-how plot this ...pls help me out
% velocity profile code
syms z
dt=0.01;t1=0;t2=5;t=(t1:dt:t2);
u=0.2;
s1=z;
w=0.5;
M=1;
m=((M+(2*1i*w))*u);
k=(fadf(z./(2*(t).^.5)+(M+(2*1i*w))*u).^.5);
re_k=real(k);im_k=imag(k);
plot(t,re_k,t,im_k)
Dilip Jose
Dilip Jose 2020년 2월 5일
sir pls reply

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2017년 8월 24일
The Symbolic Toolbox is happy to take erfc() of a complex number. After that it is just a matter of putting together the formulas, and deciding which representation one wishes to use for complex plots.
One plot method not mentioned in the link I posted first, is to draw in 3D, putting t on the x axis, real() of the expression on the y axis, and imag() of the expression on the z axis.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by