How to define an ODE when there are some parameters are function of dependent variable?

Hi,
I have this ODE, but I cannot figure out how to define it in MuPad or even in other symbolic ways:
d/dx[D(y)*dy/dx] = R(y)
Where D and R are functions of y. I did not see any example in documents about such situations. In the final analytical solution terms like D(y'')dy'' may appear, so, maybe it is not possible to define such ODEs in MuPad (?).
I appreciate any help in advance.
EDITED: functions D(y) and R(y) are "unknown";they are just a function of y, but their functionality is not defined.

 Accepted Answer

d/dx[D*dy/dx] = dD/dy*(dy/dx)^2 + D*d^2y/dx^2,
thus you have to solve the system
y1'=y2
y2'=(R(y1)-dD(y1)/dy1*(y2)^2)/D(y1)
This should be possible with every tool capable of solving ODEs.
Best wishes
Torsten.

6 Comments

Dear Torsten,
Thanks, yes I think this should resolve the problem.
Appreciate your help.
By the way, How you write this as a script in MATLAB? Especially terms of R(y1) and dD(y1)/dy1?
Thanks in advance,
function R=fun1(y)
R=...;
function dDdy=fun2(y)
dDdy=...;
Best wishes
Torsten.
Dear Torsten,
Maybe I could not explain myself well, but what I meant is that function R= fun1(y) is "unknown". Therefore, one could not define R(y) or D(y). It seems to me that the right way to define such problems is using funcenv in MuPad (not sure,just a thought).
What do you mean by "the functions R and D are unknown" ?
You don't have a formula to calculate R and D depending on y ?
How else can R and D be evaluated ?
Best wishes
Torsten.
A simpler alternative to write your ODE as a system is
D(y1)*y1' = y2
y2' = R(y1)
I think your question was about obtaining a symbolic solution.
But without explicit expressions for D and R this will be hard, I guess.
Best wishes
Torsten.

Sign in to comment.

More Answers (0)

Asked:

on 11 Aug 2016

Commented:

on 16 Aug 2016

Community Treasure Hunt

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

Start Hunting!