How to solve the problem?

1 visualizzazione (ultimi 30 giorni)
Roy ovijit
Roy ovijit il 25 Apr 2021
Risposto: Alan Stevens il 25 Apr 2021
I got my solution(poisson's equation). and I wanted to draw 3D plot of this solution. but I want to keep (b -equation parameter)as a constant . i did it. is it wrong or right?. i got my curve but it seems,it didn"t start by following initial condition.. how can I do that? here,is my code and equation. ( i'm new here. if any mistake,plz consider it)
x=0:.01:2;
y=0:.01:2;
b=0.5;[X, Y]=meshgrid(x, y);
uxy=zeros(size(X));
for a=1:2
m=a^2;
pn=(16*m*sinh(pi*Y/2*a).*cos(pi*X/2*a))/(pi^3*sinh(pi*b/2));
uxy=(m- X.^2)/2-pn;
end
surf(X, Y,uxy)

Risposta accettata

Alan Stevens
Alan Stevens il 25 Apr 2021
Like this?
x=0:.1:2;
y=0:.1:2;
b=0.5;[X, Y]=meshgrid(x, y);
uxy=zeros(size(X));
for a=1:2
m=a^2;
pn=(16*m*sinh(pi*Y/2*a).*cos(pi*X/2*a))/(pi^3*sinh(pi*b/2));
uxy=(m- X.^2)/2-pn;
figure
surf(X, Y,uxy)
end

Più risposte (0)

Categorie

Scopri di più su Animation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by