Plotting an implicit curve

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 comentarios

Torsten
Torsten el 27 de Mayo de 2023
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 el 27 de Mayo de 2023
Editada: Edoardo Cioffi el 27 de Mayo de 2023
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 el 27 de Mayo de 2023
Editada: Torsten el 27 de Mayo de 2023
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 el 27 de Mayo de 2023
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 el 27 de Mayo de 2023
Editada: Torsten el 27 de Mayo de 2023
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 el 27 de Mayo de 2023
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 el 27 de Mayo de 2023
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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 27 de Mayo de 2023

Comentada:

el 27 de Mayo de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by