How to Implement 3rd order equation in matlab script?
显示 更早的评论
I want to Implement this equation in matlab but I am not getting how to do it. Can anyone help me with this? psi1,psi2 and K1 are dependent on theta.

1 个评论
If both θ and Ψ are independent variables, then i is a function of two variables that produces a surface.
For example:
L = 160*membrane(1,100);
f = figure;
ax = axes;
s = surface(L); grid on
s.EdgeColor = 'none';
view(3)
ax.XLim = [1 201];
ax.YLim = [1 201];
ax.ZLim = [-53.4 160];
ax.CameraPosition = [-145.5 -229.7 283.6];
ax.CameraTarget = [77.4 60.2 63.9];
ax.CameraUpVector = [0 0 1];
ax.CameraViewAngle = 36.7;
l1 = light;
l1.Position = [160 400 80];
l1.Style = 'local';
l1.Color = [0 0.8 0.8];
l2 = light;
l2.Position = [.5 -1 .4];
l2.Color = [0.8 0.8 0];
s.FaceColor = [0.9 0.2 0.2];
xlabel('\theta', 'fontsize', 16), ylabel('\Psi', 'fontsize', 16), zlabel('i', 'fontsize', 16)
采纳的回答
更多回答(1 个)
If
and
are functions of θ, and θ is the independent variable, then what exactly is Ψ? How does it look like on a graph? Can you sketch it?
The i equation is not an issue, but it depends on m and n, and they are merely binary signals, consisting of only 1's and 0's arranged in some order. Technically, they are just Heaviside step functions that switch when the conditions are met.
See example for m:
theta = linspace(-1, 1, 2001);
Psi = theta;
Psi1 = sin(2*pi*Psi);
plot(theta, Psi, theta, Psi1), grid on
xlabel('\theta', 'fontsize', 16)
legend('\Psi', '\Psi_{1}', 'fontsize', 16, 'location', 'east')
m = 1/2*(sign(Psi - Psi1) + 1); % the math of Heaviside step function
plot(theta, m, 'linewidth', 2), grid on, ylim([-0.5 1.5])
xlabel('\theta', 'fontsize', 16)
ylabel('m', 'fontsize', 16)
I think you get the idea for now. But the real Ψ does not necessarily behave like a straight line.
类别
在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





