[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 127 KB, 419x600, 1266171338100.jpg [View same] [iqdb] [saucenao] [google]
2352465 No.2352465 [Reply] [Original]

Help with Matlab anyone?

I'm doing the double pendulum simulation and I've been trying to render a poincare map for it for ages.
I have 4 variables of the system:
Theta1, theta2, dttheta1 and dttheta2 (Being the angular velocity of course)
The code is running with the values being calculated with ode45 but I can't seem to be able to print them to a txt file while running it.

Any help?

>> No.2352486

Source?

>> No.2352741

bump

>> No.2352771

No need to print them while it's running. The output of ode45 is a complete trajectory. Just take that vector and save it

>> No.2352775
File: 476 KB, 391x392, magbasin3.jpg [View same] [iqdb] [saucenao] [google]
2352775

>pendulum

>> No.2353085

>>2352771
How do I do that?

>> No.2353142

>>2352771
this
>>2353085
fuck, you're worthless. "help ode45". the output is [T,Y]=ode45(arguments).

>mfw morons do nonlinear differential equations, try to create manifold diagrams, but don't understand how the fuck simple matlab shit works.

>> No.2353190
File: 66 KB, 600x401, pendulum-band-photo1-large_1207168210202.jpg [View same] [iqdb] [saucenao] [google]
2353190

Pendulum

>> No.2353225

>>2353142
Oh shut up, I don't know matlab.

>> No.2353924

>>2353142
Okay, so I used the [T, Y] command.
Where does the output show?
I really am a noob, sorry.

>> No.2353935
File: 13 KB, 300x390, 1204846064498.jpg [View same] [iqdb] [saucenao] [google]
2353935

>>2353190
>Pendulum
Holy shit, there's 6 members in Pendulum?!

I guess they need the extra man power to make songs THAT shit

>> No.2353947

Okay I have

[T, Y]=ode45(@dp_eq,[0 duration], ivp);
With
ivp=[theta1; dttheta1; theta2; dttheta2; g; m1; m2; l1; l2];
Where the first four are the only variables

Now how do I plot theta1 vs. dttheta1?

>> No.2354072

>>2353935
who the fuck listens to pendulum?

>> No.2354400

>>2354072
Me.

>> No.2354748

>>2353947
From what I can tell here it should be
Subplot(111); Plot(Y(:,1),Y(:,3));