Specifying du/dx in pde toolbox error
조회 수: 5 (최근 30일)
이전 댓글 표시
I am trying to solve an elliptic PDE but it has a first order partial derivative w.r.t x, but in PDE specification, it has to be specified as f. But i don't know how to do that.
Instead, I tried to solve much simpler approach, and then I'll try to implement it to PDE I want to solve. I'm trying to solve an ODE using PDE toolbox (although it is so unefficient, but I hope it works).
Suppose I want to solve : u'' + u' + u = 0, with BC : u(0) = 5, u(1) = -0.2.
So I drew a rectangle with length 1, arbitrary width (in my case, I used 0.4 width).
and boundary conditions I used are : left = Dirichlet B.C., h = 1, r = 5; right = Dirichlet, h = 1, r = -0.2. up and bottom, Neumann = g = q = 0.
(PDE Specification) Elliptic type, c= -1, a = -1, and f = -ux ( I want to specify du/dx here).
When I run, I get this error : "Expression evaluates to wrong size. Must be scalar or row vector. In a system case, pass first or second row; for example u(2,:). In expression: '-ux' when evaluating pde coefficients."
I want to ask about how can I specify du/dx in PDE coefficient?
Thanks in advance.
댓글 수: 0
답변 (1개)
Bill Greene
2012년 11월 13일
Hi,
Everything you have done is correct. But, because of the ux term in f, you also have to check the "Use nonlinear solver" box in the Solve/Parameters dialog. It is unfortunate that the error message is not very helpful in identifying this problem!
Bill
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Boundary Conditions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!