Derivative of a function that cannot be simplified.

1 visualizzazione (ultimi 30 giorni)
Sometimes, when we are dealing with problems concerning physics, economics or probability, we are able to understand in a clear fashion the relationship among the variables (acceleration, distance, speed, pressure, coefficient of drag, ...), but not always the resulting function can be put in a simple form, like this: y= ax + e^(3/x). In other cases, isolating the dependent variable on the left side of the symbol = is impossible, as the formula is like the following one: (e^3^x)+2y-e^(2x/4y)+5x*y^x=0. Lots of software (like demos, that can be used online and is free) can easily plot the second function written above. But when it comes to plotting the derivative, all of the the online 2d plotters that I have used so far are useless. I have never used Matlab, so I ask you if it can solve the kind of problem described above.
Thank you in advance for your kind support!

Risposte (1)

John D'Errico
John D'Errico il 3 Ago 2017
It is not that the example relation "cannot be simplified".
It is an implicit problem, where you cannot write y as a function of x.
I would point out that even your example relation has some ambiguities.
You write this:
(e^3^x)+2y-e^(2x/4y)+5x*y^x=0
Please use unambiguous forms. And it helps if you use operators.
But by e^3^x, do you mean (e^3)^x, or do you mean e^(3^x)?
Next, the expression e^x is represented in MATLAB as exp(x).
Finally, you have:
e^(2x/4y)
I assume you intended it as
exp((2*x)/(4*y))
In fact, standard order of operations would have that be interpreted as
exp(((2*x)/4)*y)
My point is, if you want an answer, then you need to be clear. Use standard syntax. Obey the order of operations. I know that here you just wrote out some random expression, without thinking about it.
As to your general question, you can always differentiate it with respect to x. You will probably be left with a relation that involves x, y, and dy/dx, so a rather nasty nonlinear differential equation. Then you need to solve that differential equation, almost certainly a numerical solution is all that will be available. There are ODE tools in MATLAB.

Categorie

Scopri di più su Programming in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by