Symbolic Integration of two functions that are the gradient of a function
2 次查看(过去 30 天)
显示 更早的评论
Is it possible to get matlab to do a symbolic integration of a gradient where you know that each term is dependent only on one variable?
I'm trying to get Matlab to do the following:
syms P(r,z) rho g omega P_atm
ode1 = diff(P,z) == rho * g
ode2 = diff(P,r) == rho * omega^2 / r
ode_total = ode1 + ode2
cond = P(0,0) = P_atm
soln(r,z) = dsolve(ode_total, cond);
Essentially, I'm trying to do the following:
Given the following pressure gradient in two dimensions (or three, where
), solve for the pressure as a function of r and z [and θ]:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271494/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271495/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271496/image.png)
using the relation:
and boundary condition: ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271498/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271497/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271498/image.png)
How do I code the above process to result in the following solution (or is it even possible)?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271499/image.png)
As you might have guessed, these equations are derived from navier-stokes.
0 个评论
回答(1 个)
Deepak Meena
2021-1-22
Hi Neil,
I think on the line no 7 you meant :
cond = P(0,0) == P_atm
Now coming to your question dsolve is used to solve differential equation with one independent variable.
To Solve partial differntial equation I advised you to use pdepe()
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!