Plotting multi-variable symbolic function assuming variables are constant
8 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Walter Roberson
2019 年 3 月 3 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!