Plotting multi-variable symbolic function assuming variables are constant
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Michal Walko
am 3 Mär. 2019
Beantwortet: Walter Roberson
am 3 Mär. 2019
Hi,
Is it possible to plot a symbolic function that has many different variables assuming you know all of them except for your independent variable are constant?
Also, is it possible to assert things such as the range of one symbolic variable is between 0 and another variable?
An example:
If we wanted to plot something like a ball getting launched in the air and falling, we would have certain initial conditions but the peak of the ball's trajectory could be calculated symbolically. All variables except time would be constant, such as our gravitational acceleration or initial velocity.
Is such a thing possible in MATLAB as a single function?
I'm aware that fplot can do this for less-complex functions.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 3 Mär. 2019
Evaluate the symbolic function with constants in the appropriate locations and using a symbolic variable in the position of your independent variable(s). The result will be a symbolic expression, which you can fplot() (one variable) or fsurf() (two variables).
It is possible to, for example,
syms w h positive
assume(w >= 0 & w <= 2*h)
However, if you use vpasolve() then vpasolve() might ignore the constraint. If you use solve() then if solve ends up taking roots then it would typically not check to be sure the roots fit the constraints. So although you can inform MATLAB of the constraint, it will not necessarily pay attention.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!