
limits are too large
조회 수: 9 (최근 30일)
이전 댓글 표시
i have parametrized surface equation T(u,v)=e^(u^2+v^2) i + ln(2*v) j + tan(5*u) k . I used this code to plot it in 3D but it gives error 'limits are too large '. can yu help me pls.
clc; clear all ;
M = 100 ; N = 100 ;
uinf = 100 ;
u = linspace(0,uinf,M) ;
v = linspace(0,2*pi,N) ;
[U V] = meshgrid(u,v) ;
X = exp(U.^2+V.^2) ;
Y = log(2.*V) ;
Z = tan(5*U) ;
surf(X,Y,Z) ;
댓글 수: 0
채택된 답변
Image Analyst
2019년 4월 21일
Try this:
clc;
clear all;
M = 100;
N = 100;
u = linspace(0,.1,M);
v = linspace(0,.2,N);
[U, V] = meshgrid(u,v);
X = exp(U.^2+V.^2);
Y = log(2.*V);
Z = tan(5*U);
surf(X,Y,Z, 'EdgeColor', 'none');
xlabel('X');
ylabel('Y');
zlabel('Z');

추가 답변 (2개)
Walter Roberson
2019년 4월 20일
X contains values up to +infinity . Y contains values as smal as -infinity . surf() cannot draw with X and Y coordinates that large.
Your u is as large as 100 and your v is as large as 2*pi, so U^2+V^2 is as large as 10000+4*pi^2 . You take exp() of that, and that overflows. It is a number that is approximately 10^451.
댓글 수: 0
dpb
2019년 4월 20일
K>> format short
K>> sum(X(:)>1E100)/numel(X)
ans =
0.8499
K>> sum(X(:)>1E200)/numel(X)
ans =
0.7848
K>> sum(X(:)>1E300)/numel(X)
ans =
0.7383
K>> sum(X(:)>1E301)/numel(X)
ans =
0.7371
K>> sum(X(:)>1E302)/numel(X)
ans =
0.7362
K>> sum(X(:)>1E305)/numel(X)
ans =
0.7344
K>> sum(X(:)>1E307)/numel(X)
ans =
0.7334
K>> sum(isinf(X(:)))/numel(X)
ans =
0.7329
K>> sum(isfinite(X(:)))/numel(X)
ans =
0.2671
K>>
Your X value is "blowing up" beyond limits of what can hold in double precision...pare down the upper limits of u,v to something reasonable.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!