Solve symbolic equation system

There is a symbolic equation system like this and wonder if any one could help me out by solving this equation system symbolically:
  • 4 equations with 4 unknown variables [u ̂ , v ̂, w ̂, p ̂ ]. (u^, v^, w^, p^ are function of "r", namely, u(r), v(r), w(r), p(r))
  • All other symbolic parameters are known variables, i.e., A, r, m, alpha, U(r), V(r), W(r) ).
Here are the equations:
Objective :
  1. Combine the 4 equations into 1 single equation in terms of u^ only, namely, cancel out v ̂, w ̂, p ̂ .
  2. Find expressions of v ̂, w ̂, p ̂ in terms of u^ : i.e., find expression of v^ in termed of u^, v^=f (u^). Same for expressions of w^ and p^, in terms of u^.
Here is a short program I made and I know it is not even close to the answer:
clc
clear
syms U(r) V(r) W(r) u(r) v(r) w(r) p(r) A r m alpha
% f(u, v, w, p)
eqn1=A*u+diff(U,r)*v+alpha*p==0; % f(u, v, p)=0
eqn2=-A*v-2*W/r*w+diff(p,r)==0; % f( v, w, p)=0
eqn3=(diff(W,r)+W/r)*v+A*w+m/r*p==0; % f( v, w, p)=0
eqn4=alpha*u+v/r+diff(v,r)+m/r*w==0; % f(u, v, w )=0
solve([eqn1,eqn2,eqn3,eqn4],[v w p])
The above program doesn solve for "v" w" "p" in terms of "u". I wondered is there anyway to do it? I really appreciate your time and help.

 Accepted Answer

That is a series of ODE. You will not be able to solve it with solve(). You could try it with
dsolve([eqn1, eqn2, eqn3, eqn4])
but the reality is that you will get back emptiness.
There is a trivial solution with u, v, r, and p all being constant 0s. Other than that there does not appear to be any closed form solutions.
Any time you have an unknown function involved U(r), V(r), W(r) then you are not going to get a closed form solution except possibly trivial solutions (like the constant zeros.)

5 Comments

Hi Walter, thank you so much for the explanations and helping me out. It definitely makes sense.
Here is a follow-up question:
If we know U(r) is constant number (namely, "partial U partial r" in the eqn(a) is zero), then I could reduce 4 equations into 1 single ODE in terms of u^ by hand (by canceling v^, w^ and p^).
is it possible to use MATLAB program to do this?
syms pr vr wr
temp = subs([eqn1(r), eqn2(r), eqn3(r), eqn4(r)], [p(r), v(r), w(r)],[pr,vr,wr])
sol = solve(temp(1:3), [pr,vr,wr]);
single_ode = subs(temp(4), sol)
Hi Walter,
Thank you so much. I never thought it could rewrite the equations like this. It is awesome and open my mind!
There is just a smal problem: I run the code you wrote for me, and the results are like this:
By comparing with the equation derived by hand (the picture attached in the last message), the above equation is missing the terms of du(r)/dr, and du^2(r)/dr^2. Do you know what happens by any chance?
Why would du/dr appear in the final equation? You do not have du/dr anywhere in the original equations.
syms U(r) V(r) W(r) u(r) v(r) w(r) p(r) A r m alpha
eqn1=A*u+diff(U,r)*v+alpha*p==0;
eqn2=-A*v-2*W/r*w+diff(p,r)==0;
eqn3=(diff(W,r)+W/r)*v+A*w+m/r*p==0;
eqn4=alpha*u+v/r+diff(v,r)+m/r*w==0;
syms pr vr wr
temp = subs([eqn1(r); eqn2(r); eqn3(r); eqn4(r)], [p(r), v(r), w(r)],[pr,vr,wr])
temp = 
PR = solve(temp(1),pr)
PR = 
temp2 = subs(temp(2:end), pr, PR)
temp2 = 
VR = solve(temp2(1),vr)
VR = 
temp3 = subs(temp2(2:end), vr, VR)
temp3 = 
WR = solve(temp3(1), wr)
WR = 
single_ode = subs(temp3(2:end), wr, WR)
single_ode = 
None of p, v, w are differentiated, so I do not see any reason why following the steps would introduce du/dr ?
I really appreciate your patience and explaning to me step by step. I think it's because the missing dpdr in eqn(b). Here is how I derived the final ODE by hand:
(Background information: U(r), V(r), W(r) are actually three component of velocity, to make the equations easier to solve at begining, we assume U(r)=constant, namely, d(U(r))/dr=0. )
This reduced eqn(a) to:
Actually, from eqn(b) and (c), we could get expression of v, w in terms of p:
Finally, substitute v, w, p in terms of u into the eqn(d), the final single ODE was obtained:
(My guess to the missing dudr happened when substitute v(r) w(r) p(r) with vr wr pr. It's a great way to simplify the equation, but somehow it makes the third term "dpdr=0" for eqn(b), and thus missing dudr and du^2dr^2.
Do you think is there any other way to fix this problem?

Sign in to comment.

More Answers (0)

Asked:

on 26 Feb 2021

Commented:

on 2 Mar 2021

Community Treasure Hunt

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

Start Hunting!