Solve symbollically a 1st order ODE with non-constante coefficient - dsolve

2 views (last 30 days)
Hello, I am trying to solve the following ODE:
syms mu(z) theta u_o Kx Ky h z rho w
u_x = cos(theta)*u_o*(cos(Kx*z)+tan(Kx*h)*sin(Kx*z));
du_x = diff(u_x,z);
eqn1 = diff(mu(z)*du_x,z) == -rho*w^2*u_x;
dsolve(eqn1)
However I get the following error message:
Warning: Unknown functions not appearing in the system are ignored.
> In symengine
In mupadengine/evalin (line 102)
In mupadengine/feval (line 161)
In dsolve>mupadDsolve (line 336)
In dsolve (line 194)
In main (line 68)
Error using mupadengine/feval (line 166)
The number of arguments is incorrect.
Error in dsolve>mupadDsolve (line 336)
T = feval(symengine,'symobj::dsolve',sys,x,options);
Error in dsolve (line 194)
sol = mupadDsolve(args, options);
Error in main (line 68)
dsolve(eqn1)
I would understand a message saying it didn't find the explicit solution, but here I don't know what to make of it.
Does anyone know where this is coming from and what i could try to solve this ODE?
Thank you,
Nicolas

Accepted Answer

Star Strider
Star Strider on 10 Jan 2018
When I declare ‘u_x’ as ‘u_x(z)’, (in R2017b) I get:
syms mu(z) theta u_o Kx Ky h z rho w
u_x(z) = cos(theta)*u_o*(cos(Kx*z)+tan(Kx*h)*sin(Kx*z));
du_x = diff(u_x,z);
eqn1 = diff(mu(z)*du_x,z) == -rho*w^2*u_x;
desol = dsolve(eqn1)
desol =
(rho*w^2 + C2*exp(- log(exp(-Kx*h*2i)*exp(Kx*z*2i) - 1) + Kx*z*1i))/Kx^2
What result do you want?

More Answers (0)

Community Treasure Hunt

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

Start Hunting!