The programs above are in three Matlab .m files, i.e.
- simulate_algorithm.m
- adaptive_algorithm.m
- simu_plot.m
⚠️ Save the A and B matrix of the UAV indata.mat
asA_LONG
andB_LONG
respectively.
In the Matlab environment, type the following command at the command window.
simulate_algorithm
The function ode45 in simulate_algorithm.m
calls the function adaptive_algorithm
for each time step.
The data generated by the programs is saved in the file simulation_data.mat
as the numerical solution to those differential equations to describe the dynamic system.
Use simu_plot
to plot the results of simulation. The simulation results are showed in the following
figures.
![image](https://private-user-images.githubusercontent.com/44803250/266912971-b0a81138-e756-4401-9b56-bc879f176bb4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNzQ0NTEsIm5iZiI6MTczOTI3NDE1MSwicGF0aCI6Ii80NDgwMzI1MC8yNjY5MTI5NzEtYjBhODExMzgtZTc1Ni00NDAxLTliNTYtYmM4NzlmMTc2YmI0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDExNDIzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ3OGNiYWY0OTZiZDBhODA0MTEwY2E5MmQ5MDQxOThhYmVmZGUzM2U0ODNlY2U3OTc3Y2FhODBjMmNlYzUxMjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5IEqsQcbn5aHsVnzTC7BQRESAjxVDQSrEsDGN5LcADY)
![image](https://private-user-images.githubusercontent.com/44803250/266913078-242c3fbb-6bf7-42fd-a317-08d5afbbd20a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNzQ0NTEsIm5iZiI6MTczOTI3NDE1MSwicGF0aCI6Ii80NDgwMzI1MC8yNjY5MTMwNzgtMjQyYzNmYmItNmJmNy00MmZkLWEzMTctMDhkNWFmYmJkMjBhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDExNDIzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ4NjQ1NTRlMjQzZmRhODgzNzU3MDViNTFjZjgyMWY4ZWNlN2EwZTc1MGEwZmY2YmJhMTA3MTBiNjE1ZmEzYjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pNwj4_6ytKIEF_ifLepUpP7XdCNgDQ264YfV5u_sQ9Y)
A non-smooth reference forward velocity trajectory command used to demonstrate tracking performance.