I'd like to draw a graph of mechanical vibration with a matlap....
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hac Li
am 17 Nov. 2023
Beantwortet: Sam Chak
am 18 Nov. 2023
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1542872/image.png)
2 Kommentare
Dyuman Joshi
am 17 Nov. 2023
The question says "All of your codes constructed by your own algorithm".
So, what have you tried yet?
John D'Errico
am 18 Nov. 2023
Homework is assigned to you, so that you will learn by doing. If you do nothing, then why should we do your work and thinking for you?
Akzeptierte Antwort
Sam Chak
am 18 Nov. 2023
Hi @Hac Li
Your teacher won't approve this code as it utilizes the MATLAB built-in ODE solver. However, you can compare the results with your own algorithm. By 'own algorithm,' I mean that you may need to devise a new solver algorithm. You can take inspiration from Dr. Alan C. Hindmarsh, who developed several ODE packages. He is the creator of the Livermore Solver for Ordinary Differential Equations, known as LSODE().
% MATLAB built-in ODE solver
F = ode;
F.Parameters = 10;
F.InitialValue = [1; 0];
F.ODEFcn = @(t, y, p) [ y(2);
- 0.5*y(2) - 200*y(1) + 1*cos(2*pi/p*t)];
F.Solver = "ode78";
S = solve(F, 0, 30);
% Plotting the graph
plot(S.Time, S.Solution(1,:)), grid on
xlabel('Time')
0 Kommentare
Weitere Antworten (1)
Sulaymon Eshkabilov
am 17 Nov. 2023
An initial step will be looking at the Runge-Kutta method Runge-Kutta and its implementation in MATLAB - writing a code like THIS ONE.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Assembly 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!