Please help me someone! How to run for 3D?

clc
clear all
syms k k1 k2 x y
v=0.14;
L=100;
h=2;
t=5.95;
g=0.0098;
eta0=2;
w=sqrt(g*k*tanh(k*h));
A = i*k1*(50/pi)^2*(exp(i*100*k1)-1);
B = i*k2*(100/pi)^2*(exp(i*50*k2)+exp(i*150*k2));
C = i*k2*(100/pi)^2*(exp(-i*150*k2)+exp(-i*50*k2));
D = ((sin(w*t))/(w*cosh(k*h)))*((eta0*v)/(2*L));
E = (1-exp(-i*100*k1))/(i*k1);
F = (exp(-i*100*k1))/(1-((50*k1)/pi)^2);
G = (exp(i*150*k2)-exp(i*50*k2))/(i*k2);
H = 1/(1-(100*k2/pi)^2);
I = (4*sin(50*k2))/k2;
J = (exp(-i*50*k2)-exp(-i*150*k2))/(i*k2);
zeta_ = D*(E*A-F*A)*(G*B-H*B+I+J*C-H*C);
IFT1 = ifourier(zeta_,k1,x)
IFT = ifourier(IFT1,k2,y)
%For figure
xvals = 0:100;
yvals = linspace(-200,200,101);
[X,Y] = meshgrid(xvals, yvals);
Zsym = subs(IFT, {x, y}, {X, Y});
Z = double(Zsym);
surf(X,Y,Z)

13 Commenti

How to run for 3D??
Yes Sir, Please help me. I cannot it for figure.
Hello everyone please help me.
soe - I think you need to clarify what you mean by run it for 3D. What does that mean to you?
soe min aung
soe min aung il 7 Mar 2020
Modificato: soe min aung il 7 Mar 2020
Thank you sir, I want to get 3D figure by using matlab for this code. But I did not get 3D figure in this code for me. So I need help to you all. Please check or edit my code for 3D figure.
Some of your equations use k but you do not substitute a numeric value for k.
In a comment now deleted, a range of k values was given.
At the moment you have x and y coordinates and a formula for z that depends upon k. That is three independent variables (x, y, k) and one dependent variable (z). That requires a 4 dimensional plot, which is not easy to make sense out of, and the question asked for a 3d plot.
k=(2*pi)/400;
Thank you sir, please run me.
Zsym = subs(IFT, {x, y, k}, {X, Y, 2*pi/400});
As you said, I didn't get the figure when I run it. Please check or edit code. Help me sir,
clc
clear all
syms k k1 k2 x y
v=0.14;
L=100;
h=2;
t=5.95;
g=0.0098;
eta0=2;
w=sqrt(g*k*tanh(k*h));
A = i*k1*(50/pi)^2*(exp(i*100*k1)-1);
B = i*k2*(100/pi)^2*(exp(i*50*k2)+exp(i*150*k2));
C = i*k2*(100/pi)^2*(exp(-i*150*k2)+exp(-i*50*k2));
D = ((sin(w*t))/(w*cosh(k*h)))*((eta0*v)/(2*L));
E = (1-exp(-i*100*k1))/(i*k1);
F = (exp(-i*100*k1))/(1-((50*k1)/pi)^2);
G = (exp(i*150*k2)-exp(i*50*k2))/(i*k2);
H = 1/(1-(100*k2/pi)^2);
I = (4*sin(50*k2))/k2;
J = (exp(-i*50*k2)-exp(-i*150*k2))/(i*k2);
zeta_ = D*((E*A)-(F*A))*((G*B)-(H*B)+I+(J*C)-(H*C));
IFT1 = ifourier(zeta_,k1,x)
IFT = ifourier(IFT1,k2,y)
% For figure
xvals = 0:100;
yvals = linspace(-200,200,101);
[X,Y] = meshgrid(xvals, yvals);
Zsym = subs(IFT, {x, y, k}, {X, Y, 2*pi/400});
Z = double(Zsym);
surf(X,Y,Z)
Hello someone,
subplot(1,3,1)
surf(X, Y, real(Z))
title real
subplot(1,3,2)
surf(X, Y, imag(Z))
title imaginary
subplot(1,3,3)
surf(X, Y, abs(Z))
title abs
soe min aung
soe min aung il 9 Mar 2020
Modificato: soe min aung il 9 Mar 2020
By your advice, I have received a figure.Thank you so much for your kindness.

Accedi per commentare.

Risposte (0)

Categorie

Tag

Richiesto:

il 5 Mar 2020

Modificato:

il 9 Mar 2020

Community Treasure Hunt

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

Start Hunting!

Translated by