Error with pdeCoefficient PDE toolbox
8 次查看(过去 30 天)
显示 更早的评论
I am following this Matlab example to code my system of PDE (reequire PDE toolbox)
syms u1(x,y) u2(x,y)
pdeeq = [-laplacian(u1) + u2; -D*laplacian(u2) - pres];
symCoeffs = pdeCoefficients(pdeeq,[u1 u2],'Symbolic',true)
But if Try my Equation, I get an error and I cannot understand why. Any clue?
syms u1(t,x) u2(t,x)
pdeeq = [diff(u1,t) -laplacian(u1) + u2 == 0; diff(u2,t) -laplacian(u2) -u1 ==0];
symCoeffs = pdeCoefficients(pdeeq,[u1 u2],'Symbolic',true)
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2.
Error in sym/privsubsasgn (line 1229)
L_tilde2 = builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);
Error in sym/cat>catMany (line 42)
y = privsubsasgn(y,arrays{k},subs{:});
Error in sym/cat (line 25)
ySym = catMany(dim, args);
Error in sym/vertcat (line 19)
ySym = cat(1,args{:});
Error in untitled (line 7)
pdeeq = [diff(u1,t) -laplacian(u1) + u2 == 0; diff(u2,t) -laplacian(u2) -u1 ==0];
0 个评论
回答(1 个)
Pratyush Roy
2022-2-16
Hi Edoardo,
As a workaround, you can try removing the equality operator and express the equations as a function of the variables. You can also express the equations in terms of the variables x and y instead of using t.
The script below might be helpful:
syms u1(x,y) u2(x,y)
pdeeq = [diff(u1,x)-laplacian(u1) + u2; diff(u2,y)-laplacian(u2)-u1*x];
symCoeffs = pdeCoefficients(pdeeq,[u1 u2],'Symbolic',true)
Hope this helps!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geometry and Mesh 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!