I was wondering on how I could plot this curve :
I tried both 'fplot' and 'plot' but I kept getting this : 'Input must be a function handle or symbolic function. '. If I use 'fimplicit3' I get an empty graph.

댓글 수: 7

Torsten
Torsten 2023년 5월 27일
x3, x4 and t are three independent variables in your implicit equation. There is no such thing as x3(t) and x4(t). This would only be the case if you had a second equation.
Edoardo Cioffi
Edoardo Cioffi 2023년 5월 27일
편집: Edoardo Cioffi 2023년 5월 27일
x3=-(1/w^2*b)*exp(-g*t)*cos(delta*t)-(g/w^2*b)*exp(-g*t)*sin(delta*t)+(1/w^2*b);
Unrecognized function or variable 'w'.
x4=diff(x3,t);
spiral=(x3-(1/w^2*b))^2+((x4+g*(x3-(1/w^2*b)))/delta)^2-(1/w^4*b^2)*(1+(g^2/delta^2))*exp(-2*g*t)==0;
interval=[-5 5 -5 5 0 10]
figure
f
I let t be a symbolic variable.
implicit3(spiral,interval)
Torsten
Torsten 2023년 5월 27일
편집: Torsten 2023년 5월 27일
If you prescribe x3 and x4 as functions of t, then you won't have to use implicit3, but "fzero" or "fsolve" since the only independent variable in your equation is t, and you also will get only a few separate solutions for t, not a curve.
Edoardo Cioffi
Edoardo Cioffi 2023년 5월 27일
I'm sorry but the curve I want to plot it is kind of a spiral/ellipse,isn't it? I don't need particular solutions.
Torsten
Torsten 2023년 5월 27일
편집: Torsten 2023년 5월 27일
To plot a curve, you need an equation with two independent variables, e.g.
x^2 + y^2 - 1 = 0
Here, x and y are the independent variables, and the result is a curve (the circle with radius 1).
What is your equation, what are the x and y in there and what are the numerical values of possible additional parameters ?
Edoardo Cioffi
Edoardo Cioffi 2023년 5월 27일
I solved a second order differential equation where the solutions of the characteristic polynomial are complex. Basically x3(t) and x4(t) are the state of position and velocity. I wanted to draw the phase plane and with some algebra you get the equation I wrote at the beginning. The values of the parameters can be all the positive numbers.
Torsten
Torsten 2023년 5월 27일
You might use plot3(t,x3,x4) or something similar after getting numerical arrays from the solution of your 2nd order ODE, but to do so, you don't need the equation from above.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

질문:

2023년 5월 27일

댓글:

2023년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by