limits are too large
69 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kuatra Patil
el 20 de Abr. de 2019
Comentada: Kuatra Patil
el 21 de Abr. de 2019
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 comentarios
Respuesta aceptada
Image Analyst
el 21 de Abr. de 2019
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');
Más respuestas (2)
Walter Roberson
el 20 de Abr. de 2019
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 comentarios
dpb
el 20 de Abr. de 2019
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 comentarios
Ver también
Categorías
Más información sobre Cartesian Coordinate System Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!