开发者

sequence of poisson' equations

I want to solve the sequence of poisson equations

Δ u = f(k)

for different values of k.

I tried

for k=1:10
开发者_开发百科f='x+y+k'
u(k)=assempde('problg',p,e,t,c,a,f);
end

It returns the error

Undefined function or variable 'k'.

Infinitely grateful for any help!


You might try replacing the second line with:

f=['x+y+' num2str(k)];

I could not test it as I don't have the PDE toolbox. Hope this helps.

A.

PS: If you have to solve for a lot of k values, there are ways to solve this pde in one shot for all values of k in a given interval. You would get as result a function of three variables: u(x,y,k) (who said k is a parameter and not a variable). The good point is that the memory cost and computational time would still scale like the 2D Poisson, you never solve/store things on a 3D mesh (with k being the third dimension). If you're interested in those emerging methods, its called: Proper Generalized Decomposition (PGD), you might find some recent papers on these.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜