Specifying du/dx in pde toolbox error

1 visualización (últimos 30 días)
Taniadi
Taniadi el 10 de Nov. de 2012
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.

Respuestas (1)

Bill Greene
Bill Greene el 13 de Nov. de 2012
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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by