How to find P(x,y) with diff

I am trying to solve this diff equation
u=a*x+b
v=-a*y+c*x
p=1
-dP/dy=(u*dv/dx+v*dv/dy)*p
-dP/dx=(u*du/dx+v*du/dy)*p
I want to find P(x,y) but i can not find
My code is below and i think it is absolutely wrong
syms a b c u v w x y z p Py(y) Px(x)
u=a*x+b
v=-a*y+c*x
eq=p*(u*diff(v,x)+v*diff(v,y))==-diff(Py,y)
Py(y)=dsolve(eq)
eq2=p*(u*diff(u,x)+v*diff(u,y))==-diff(Px,x)
Px(x)=dsolve(eq2)

6 Comments

The symbolic toolbox in MATLAB is designed to work for ODEs and cannot be used to directly used to solve PDEs.
Then how can i solve this with pde's
VBBV
VBBV on 9 Sep 2020
Edited: VBBV on 9 Sep 2020
This is what i get ... I think you forgot initial condition for p=1; in your code
%if true
% code
%end
syms a b c u v w x y z p Py(y) Px(x)
u=a*x+b
v=-a*y+c*x;
p=1;% initial value missing
eq=p*(u*diff(v,x)+v*diff(v,y))==-diff(Py,y)
Py(y)=dsolve(eq)
eq2=p*(u*diff(u,x)+v*diff(u,y))==-diff(Px,x)
Px(x)=dsolve(eq2)
u =
b + a*x
eq(y) =
a*(a*y - c*x) + c*(b + a*x) == -diff(Py(y), y)
Py(y) =
C1 - (a^2*y^2)/2 - b*c*y
eq2(x) =
a*(b + a*x) == -diff(Px(x), x)
Px(x) =
C1 - (a*x*(2*b + a*x))/2
You are right but it does not find P(x,y) . I want to find the real P(x,y) without C1
To find P(x,y) without an arbitrary constant you need a boundary/initial condition e.g. P(0,0) = something.

Sign in to comment.

Answers (0)

Asked:

on 9 Sep 2020

Commented:

on 9 Sep 2020

Community Treasure Hunt

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

Start Hunting!