Error using odeset (line 231) Unrecognized property name 'mass_matr​ix_without​_tld'. Error in my_ode_sol​ver_withou​t_tld (line 8) opts = odeset('ma​ss_matrix_​without_tl​d',@(t,y)

조회 수: 2 (최근 30일)
function Y = mass_matrix_without_tld(t,y)
% Mass matrix function
Y = zeros(2,2);
Y(1,1) = 1;
Y(2,2) = 1;
end
clc;
clear all;
%% To run mass spring damper system
tspan = 0:0.1:20;
y = [0 0];
opts = odeset('mass_matrix_without_tld',@(t,y) mass_matrix_without_tld(t,y));
%% Solve using ode45
[tsol,ysol] = ode45(@(t,y)my_ode_without_tld(t,y), tspan, y, opts);
%% plotting
plot(tsol,ysol(:,1))
xlabel('time(sec)')
ylabel('displacement(m)')
grid on
title('Displacement response of structure')
figure
plot(tsol,ysol(:,2))
xlabel('time(sec)')
ylabel('velocity(m/s)')
grid on
title('Velocity response of structure')

답변 (1개)

Torsten
Torsten 2022년 3월 29일
편집: Torsten 2022년 3월 29일
Because the property
'mass_matrix_without_tld'
does not exist for the ODE solvers.
Maybe you mean the existing property
'Mass'
?

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by