Home Implicit function plotting with parameter

Implicit function plotting with parameter

Sanjeev Maurya
1#
Sanjeev Maurya Published in 2018-02-14 09:19:06Z
 suppose i have a equation like below, i want to plot between x and y with a=0.000000000142 2*cos(sqrt(3).*y.*a) + 4*cos((sqrt(3).*y.*a)/2).*cos((3.*x.*a)/2) - 1  i want to plot it with respect to 'x' and 'y'. but i did't get anything. i tried a code as, syms x y a = 0.000000000142; h = @(x,y) 3.*x.*x*a*a + 9.*y.*y*a*a + (9*x.*x.*y.*y*a*a*a*a)./4; fimplicit(h,[-1 1 -1 1])  another code i tried is as, first i make a function as function [graphene] = disper(x,y) graphene = 2*cos(sqrt(3).*y.*a) + 4*cos((sqrt(3).*y.*a)/2).*cos((3.*x.*a)/2)- 1; a=0.124; end  and then i call function ezplot as, ezplot('disper(x,y)', [-10 10 -10 10]); 
il_raffa
2#
 Assuming you want to evaluate the function in the (x,y) interval x=(-1,1) and y(-1,1) you can define a grid of X and Y values using the functin meshgrid Edit Updated the call to surf (ref. to the comment from Hunter Jiang) a=0.000000000142 X=[-1:.1:1]; Y=X; [x,y]=meshgrid(X,Y); z=2*cos(sqrt(3).*y.*a) + 4*cos((sqrt(3).*y.*a)/2).*cos((3.*x.*a)/2) - 1; %surf(z) surf(x,y,z)  Then you can use the function surf to plot the results. Hope this helps, Qapla'