I want to plot region for z numbers that satisfy D<10^-4.

조회 수: 2 (최근 30일)
Leia
Leia 2022년 6월 8일
댓글: Torsten 2022년 6월 10일
How do I plot the region showing z=x+iy values that make the difference between a polynomial and an exponential function less than 10^-4?
For example;
syms z
[x,y]=meshgrid(-6:.1:2,-6:.1:6);
z=x+1i*y;
R = - 0.0000000000000042786173933199698996786792332228*z.^16 + 0.000000000000093679201874795131075154866430805*z.^15 ...
- 0.0000000000018102462775238750488561630646573*z.^14 + 0.000000000070607888835529581094992975687635*z.^13 ...
- 0.00000000047430380749604348847250198255397*z.^12 + 0.0000000060302178555555310479780219749732*z.^11 ...
- 0.00000014850754796722791834393401507891*z.^10 - 0.0000011975088237244406931082370289037*z.^9 ...
- 0.00000486020688657407415163842024264*z.^8 + 0.000027465820312500018146735337769556*z.^7 ...
+ 0.0010023328993055556912781216101668*z.^6 + 0.0080891927083333337897961540664676*z.^5 ...
+ 0.041666666666666667576168711195926*z.^4 + 0.16666666666666666756898545265065*z.^3 + 0.5*z.^2 + 1.0*z + 1.0;
T = exp(z);
D = R-T;
I want to plot region for z numbers that satisfy D<10^-4.
How can I do that? I would be appreciate if you help.

채택된 답변

Torsten
Torsten 2022년 6월 8일
편집: Torsten 2022년 6월 8일
R1 = @(x,y)- 0.0000000000000042786173933199698996786792332228*(x+1i*y).^16 + 0.000000000000093679201874795131075154866430805*(x+1i*y).^15 ...
- 0.0000000000018102462775238750488561630646573*(x+1i*y).^14 + 0.000000000070607888835529581094992975687635*(x+1i*y).^13 ...
- 0.00000000047430380749604348847250198255397*(x+1i*y).^12 + 0.0000000060302178555555310479780219749732*(x+1i*y).^11 ...
- 0.00000014850754796722791834393401507891*(x+1i*y).^10 - 0.0000011975088237244406931082370289037*(x+1i*y).^9 ...
- 0.00000486020688657407415163842024264*(x+1i*y).^8 + 0.000027465820312500018146735337769556*(x+1i*y).^7 ...
+ 0.0010023328993055556912781216101668*(x+1i*y).^6 + 0.0080891927083333337897961540664676*(x+1i*y).^5 ...
+ 0.041666666666666667576168711195926*(x+1i*y).^4 + 0.16666666666666666756898545265065*(x+1i*y).^3 + 0.5*(x+1i*y).^2 + 1.0*(x+1i*y) + 1.0;
R2 = @(x,y) sum((x+1i*y).^(0:16)./factorial(0:16));
T = @(x,y) exp(x+1i*y);
fun1 = @(x,y)norm(R1(x,y)-T(x,y))-1e-4;
fun2 = @(x,y)norm(R2(x,y)-T(x,y))-1e-4;
fimplicit(fun1)
Warning: Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input arguments.
hold on
fimplicit(fun2)
Warning: Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input arguments.
  댓글 수: 4
Leia
Leia 2022년 6월 10일
This polynomial have found as an approximate solution to a differential equation by a spectral numerical method.
Torsten
Torsten 2022년 6월 10일
And the differential equation has exp(z) as solution ?

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

추가 답변 (0개)

카테고리

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