Category: Matlab
Category Archives: Matlab
How to code double pendulum by using rk4
Please help me with this problem.
It has to satisfy these conditions below.
Simulate the motion of the double pendulum for the following two initial conditions and observe the difference in motion (butterfly effect)
Initial conditions 1: Initial angles theta=pi/2, omg=pi/2 (initial speeds are all 0)
Initial conditions 2: Initial angles theta=pi/2, omg=pi/2+0.001 (initial speeds are all 0)
Precautions 1: Use RK4
Precautions 2: fps should be 30 frames per second
Precautions 3: Calculate by changing dt=1/30/50, 1/30/100, 1/30/200, 1/30/400, etc. and find a reliable size of dt
Precautions 4: Simulate 25 seconds of exercisePlease help me with this problem.
It has to satisfy these conditions below.
Simulate the motion of the double pendulum for the following two initial conditions and observe the difference in motion (butterfly effect)
Initial conditions 1: Initial angles theta=pi/2, omg=pi/2 (initial speeds are all 0)
Initial conditions 2: Initial angles theta=pi/2, omg=pi/2+0.001 (initial speeds are all 0)
Precautions 1: Use RK4
Precautions 2: fps should be 30 frames per second
Precautions 3: Calculate by changing dt=1/30/50, 1/30/100, 1/30/200, 1/30/400, etc. and find a reliable size of dt
Precautions 4: Simulate 25 seconds of exercise Please help me with this problem.
It has to satisfy these conditions below.
Simulate the motion of the double pendulum for the following two initial conditions and observe the difference in motion (butterfly effect)
Initial conditions 1: Initial angles theta=pi/2, omg=pi/2 (initial speeds are all 0)
Initial conditions 2: Initial angles theta=pi/2, omg=pi/2+0.001 (initial speeds are all 0)
Precautions 1: Use RK4
Precautions 2: fps should be 30 frames per second
Precautions 3: Calculate by changing dt=1/30/50, 1/30/100, 1/30/200, 1/30/400, etc. and find a reliable size of dt
Precautions 4: Simulate 25 seconds of exercise double pendulum, rk4, matlab MATLAB Answers — New Questions
How to process the data that have same row name
Hello. Currently I am doing a testing codes. But then, I found a loop problem which is too challenging for me since I am already facing it more than ten times (I am still a newbie). Below is my coding. My goals is to process the raw data and extract the features as stated in the code. Basically the problem that I am facing is that:
Error using tabular/vertcat Duplicate table row name: ‘2004.03.15.12.0’.
Error in Third_Test (line 55) Time_feature_matrix1 = [Time_feature_matrix1; df];
The file is too big so with that I share my link to GDrive: https://drive.google.com/drive/folders/1MltnJyAUh1BJpoPdNpqOUiHfhdbGF4wV?usp=drive_link
Here the Code:
% Initialize empty tables for each bearing
Time_feature_matrix1 = table();
Time_feature_matrix2 = table();
Time_feature_matrix3 = table();
Time_feature_matrix4 = table();
% Specify the test set and bearing numbers
test_set = 3;
bearing_numbers = [1, 2, 3, 4];
% Set the path to the directory containing the data files
path = ‘file directory’;
% Get list of files in the directory
files = dir(fullfile(path, ‘*’));
% Loop through the files in the directory
for j = 1:length(files)
filename = files(j).name;
if files(j).isdir % Skip directories
continue;
end
file_path = fullfile(path, filename); % Full path of the file
dataset = readtable(file_path, ‘Delimiter’, ‘t’, ‘FileType’, ‘text’); % Read the dataset
% Loop through each bearing number
for j = 1:length(bearing_numbers)
bearing_no = bearing_numbers(j);
% Extract the bearing data
bearing_data = dataset{:, bearing_no};
% Calculate features
feature_matrix = [
max(bearing_data), % Max
min(bearing_data), % Min
mean(bearing_data), % Mean
std(bearing_data, 1), % Std
sqrt(mean(bearing_data.^2)), % RMS
compute_skewness(bearing_data), % Skewness
compute_kurtosis(bearing_data), % Kurtosis
max(bearing_data) / sqrt(mean(bearing_data.^2)), % CrestFactor
sqrt(mean(bearing_data.^2)) / mean(bearing_data) % FormFactor
];
df = array2table(feature_matrix.’); % Transpose for correct orientation
df.Properties.VariableNames = {‘Max’, ‘Min’, ‘Mean’, ‘Std’, ‘RMS’, ‘Skewness’, ‘Kurtosis’, ‘CrestFactor’, ‘FormFactor’};
df.Properties.RowNames = {[filename(1:end-4)]}; % Append bearing number
df.Properties.RowNames = {rowName};
% Append the table to the corresponding bearing’s feature matrix
switch bearing_no
case 1
if ~ismember(rowName, Time_feature_matrix1.Properties.RowNames)
Time_feature_matrix1 = [Time_feature_matrix1; df];
end
case 2
if ~ismember(rowName, Time_feature_matrix2.Properties.RowNames)
Time_feature_matrix2 = [Time_feature_matrix2; df];
end
case 3
if ~ismember(rowName, Time_feature_matrix3.Properties.RowNames)
Time_feature_matrix3 = [Time_feature_matrix3; df];
end
case 4
if ~ismember(rowName, Time_feature_matrix4.Properties.RowNames)
Time_feature_matrix4 = [Time_feature_matrix4; df];
end
% case 1
% Time_feature_matrix1 = [Time_feature_matrix1; df];
% case 2
% Time_feature_matrix2 = [Time_feature_matrix2; df];
% case 3
% Time_feature_matrix3 = [Time_feature_matrix3; df];
% case 4
% Time_feature_matrix4 = [Time_feature_matrix4; df];
end
end
end
% Define function to compute skewness
function skewness = compute_skewness(x)
n = length(x);
third_moment = sum((x – mean(x)).^3) / n;
s_3 = std(x, 1)^3;
skewness = third_moment / s_3;
end
% Define function to compute kurtosis
function kurtosis = compute_kurtosis(x)
n = length(x);
fourth_moment = sum((x – mean(x)).^4) / n;
s_4 = std(x, 1)^4;
kurtosis = fourth_moment / s_4 – 3;
endHello. Currently I am doing a testing codes. But then, I found a loop problem which is too challenging for me since I am already facing it more than ten times (I am still a newbie). Below is my coding. My goals is to process the raw data and extract the features as stated in the code. Basically the problem that I am facing is that:
Error using tabular/vertcat Duplicate table row name: ‘2004.03.15.12.0’.
Error in Third_Test (line 55) Time_feature_matrix1 = [Time_feature_matrix1; df];
The file is too big so with that I share my link to GDrive: https://drive.google.com/drive/folders/1MltnJyAUh1BJpoPdNpqOUiHfhdbGF4wV?usp=drive_link
Here the Code:
% Initialize empty tables for each bearing
Time_feature_matrix1 = table();
Time_feature_matrix2 = table();
Time_feature_matrix3 = table();
Time_feature_matrix4 = table();
% Specify the test set and bearing numbers
test_set = 3;
bearing_numbers = [1, 2, 3, 4];
% Set the path to the directory containing the data files
path = ‘file directory’;
% Get list of files in the directory
files = dir(fullfile(path, ‘*’));
% Loop through the files in the directory
for j = 1:length(files)
filename = files(j).name;
if files(j).isdir % Skip directories
continue;
end
file_path = fullfile(path, filename); % Full path of the file
dataset = readtable(file_path, ‘Delimiter’, ‘t’, ‘FileType’, ‘text’); % Read the dataset
% Loop through each bearing number
for j = 1:length(bearing_numbers)
bearing_no = bearing_numbers(j);
% Extract the bearing data
bearing_data = dataset{:, bearing_no};
% Calculate features
feature_matrix = [
max(bearing_data), % Max
min(bearing_data), % Min
mean(bearing_data), % Mean
std(bearing_data, 1), % Std
sqrt(mean(bearing_data.^2)), % RMS
compute_skewness(bearing_data), % Skewness
compute_kurtosis(bearing_data), % Kurtosis
max(bearing_data) / sqrt(mean(bearing_data.^2)), % CrestFactor
sqrt(mean(bearing_data.^2)) / mean(bearing_data) % FormFactor
];
df = array2table(feature_matrix.’); % Transpose for correct orientation
df.Properties.VariableNames = {‘Max’, ‘Min’, ‘Mean’, ‘Std’, ‘RMS’, ‘Skewness’, ‘Kurtosis’, ‘CrestFactor’, ‘FormFactor’};
df.Properties.RowNames = {[filename(1:end-4)]}; % Append bearing number
df.Properties.RowNames = {rowName};
% Append the table to the corresponding bearing’s feature matrix
switch bearing_no
case 1
if ~ismember(rowName, Time_feature_matrix1.Properties.RowNames)
Time_feature_matrix1 = [Time_feature_matrix1; df];
end
case 2
if ~ismember(rowName, Time_feature_matrix2.Properties.RowNames)
Time_feature_matrix2 = [Time_feature_matrix2; df];
end
case 3
if ~ismember(rowName, Time_feature_matrix3.Properties.RowNames)
Time_feature_matrix3 = [Time_feature_matrix3; df];
end
case 4
if ~ismember(rowName, Time_feature_matrix4.Properties.RowNames)
Time_feature_matrix4 = [Time_feature_matrix4; df];
end
% case 1
% Time_feature_matrix1 = [Time_feature_matrix1; df];
% case 2
% Time_feature_matrix2 = [Time_feature_matrix2; df];
% case 3
% Time_feature_matrix3 = [Time_feature_matrix3; df];
% case 4
% Time_feature_matrix4 = [Time_feature_matrix4; df];
end
end
end
% Define function to compute skewness
function skewness = compute_skewness(x)
n = length(x);
third_moment = sum((x – mean(x)).^3) / n;
s_3 = std(x, 1)^3;
skewness = third_moment / s_3;
end
% Define function to compute kurtosis
function kurtosis = compute_kurtosis(x)
n = length(x);
fourth_moment = sum((x – mean(x)).^4) / n;
s_4 = std(x, 1)^4;
kurtosis = fourth_moment / s_4 – 3;
end Hello. Currently I am doing a testing codes. But then, I found a loop problem which is too challenging for me since I am already facing it more than ten times (I am still a newbie). Below is my coding. My goals is to process the raw data and extract the features as stated in the code. Basically the problem that I am facing is that:
Error using tabular/vertcat Duplicate table row name: ‘2004.03.15.12.0’.
Error in Third_Test (line 55) Time_feature_matrix1 = [Time_feature_matrix1; df];
The file is too big so with that I share my link to GDrive: https://drive.google.com/drive/folders/1MltnJyAUh1BJpoPdNpqOUiHfhdbGF4wV?usp=drive_link
Here the Code:
% Initialize empty tables for each bearing
Time_feature_matrix1 = table();
Time_feature_matrix2 = table();
Time_feature_matrix3 = table();
Time_feature_matrix4 = table();
% Specify the test set and bearing numbers
test_set = 3;
bearing_numbers = [1, 2, 3, 4];
% Set the path to the directory containing the data files
path = ‘file directory’;
% Get list of files in the directory
files = dir(fullfile(path, ‘*’));
% Loop through the files in the directory
for j = 1:length(files)
filename = files(j).name;
if files(j).isdir % Skip directories
continue;
end
file_path = fullfile(path, filename); % Full path of the file
dataset = readtable(file_path, ‘Delimiter’, ‘t’, ‘FileType’, ‘text’); % Read the dataset
% Loop through each bearing number
for j = 1:length(bearing_numbers)
bearing_no = bearing_numbers(j);
% Extract the bearing data
bearing_data = dataset{:, bearing_no};
% Calculate features
feature_matrix = [
max(bearing_data), % Max
min(bearing_data), % Min
mean(bearing_data), % Mean
std(bearing_data, 1), % Std
sqrt(mean(bearing_data.^2)), % RMS
compute_skewness(bearing_data), % Skewness
compute_kurtosis(bearing_data), % Kurtosis
max(bearing_data) / sqrt(mean(bearing_data.^2)), % CrestFactor
sqrt(mean(bearing_data.^2)) / mean(bearing_data) % FormFactor
];
df = array2table(feature_matrix.’); % Transpose for correct orientation
df.Properties.VariableNames = {‘Max’, ‘Min’, ‘Mean’, ‘Std’, ‘RMS’, ‘Skewness’, ‘Kurtosis’, ‘CrestFactor’, ‘FormFactor’};
df.Properties.RowNames = {[filename(1:end-4)]}; % Append bearing number
df.Properties.RowNames = {rowName};
% Append the table to the corresponding bearing’s feature matrix
switch bearing_no
case 1
if ~ismember(rowName, Time_feature_matrix1.Properties.RowNames)
Time_feature_matrix1 = [Time_feature_matrix1; df];
end
case 2
if ~ismember(rowName, Time_feature_matrix2.Properties.RowNames)
Time_feature_matrix2 = [Time_feature_matrix2; df];
end
case 3
if ~ismember(rowName, Time_feature_matrix3.Properties.RowNames)
Time_feature_matrix3 = [Time_feature_matrix3; df];
end
case 4
if ~ismember(rowName, Time_feature_matrix4.Properties.RowNames)
Time_feature_matrix4 = [Time_feature_matrix4; df];
end
% case 1
% Time_feature_matrix1 = [Time_feature_matrix1; df];
% case 2
% Time_feature_matrix2 = [Time_feature_matrix2; df];
% case 3
% Time_feature_matrix3 = [Time_feature_matrix3; df];
% case 4
% Time_feature_matrix4 = [Time_feature_matrix4; df];
end
end
end
% Define function to compute skewness
function skewness = compute_skewness(x)
n = length(x);
third_moment = sum((x – mean(x)).^3) / n;
s_3 = std(x, 1)^3;
skewness = third_moment / s_3;
end
% Define function to compute kurtosis
function kurtosis = compute_kurtosis(x)
n = length(x);
fourth_moment = sum((x – mean(x)).^4) / n;
s_4 = std(x, 1)^4;
kurtosis = fourth_moment / s_4 – 3;
end data processing MATLAB Answers — New Questions
How to speed up feature extraction task using GoogleNet?
I have some queries related to the speed of pretrained networks used for feature extraction.
Query 1:
I am using pre-trained network Googlenet (installed from MATLAB Add-Ons) for feature extraction from images. Right now, I am able to extract features from 5 frames in one second. If I do not have option to enhance the computational power of my machine (on which I am performing feature extraction), how can I increase the speed of feature extraction using the same network (means how can I be able to extract features from, say 20 or 30 frames per second).
Query 2:
What are the different factors that determine the speed of pre-trained networks for feature extraction? Can anyone please elaborate this one?
If my queries are not clear, feel free to comment.I have some queries related to the speed of pretrained networks used for feature extraction.
Query 1:
I am using pre-trained network Googlenet (installed from MATLAB Add-Ons) for feature extraction from images. Right now, I am able to extract features from 5 frames in one second. If I do not have option to enhance the computational power of my machine (on which I am performing feature extraction), how can I increase the speed of feature extraction using the same network (means how can I be able to extract features from, say 20 or 30 frames per second).
Query 2:
What are the different factors that determine the speed of pre-trained networks for feature extraction? Can anyone please elaborate this one?
If my queries are not clear, feel free to comment. I have some queries related to the speed of pretrained networks used for feature extraction.
Query 1:
I am using pre-trained network Googlenet (installed from MATLAB Add-Ons) for feature extraction from images. Right now, I am able to extract features from 5 frames in one second. If I do not have option to enhance the computational power of my machine (on which I am performing feature extraction), how can I increase the speed of feature extraction using the same network (means how can I be able to extract features from, say 20 or 30 frames per second).
Query 2:
What are the different factors that determine the speed of pre-trained networks for feature extraction? Can anyone please elaborate this one?
If my queries are not clear, feel free to comment. deep learning, pre-trained networks, googlenet, machine learning, feature extraction, speed of neural networks MATLAB Answers — New Questions
MATLAB Coder crashes when opened in Ubuntu 18.04
Whenever I try to open the matlab coder from MATLAB, the MATLAB will crash and gives this error
Gtk-Message: 12:36:13.523: Failed to load module "overlay-scrollbar"
[0527/123639.510619:ERROR:gl_utils.cc(319)] [.WebGL-0x25dc130]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
I am using MATLAB R2022b, the Ubuntu version is 18.04.6 and the GNU version is gcc 11.4. Can somebody help explain this error?Whenever I try to open the matlab coder from MATLAB, the MATLAB will crash and gives this error
Gtk-Message: 12:36:13.523: Failed to load module "overlay-scrollbar"
[0527/123639.510619:ERROR:gl_utils.cc(319)] [.WebGL-0x25dc130]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
I am using MATLAB R2022b, the Ubuntu version is 18.04.6 and the GNU version is gcc 11.4. Can somebody help explain this error? Whenever I try to open the matlab coder from MATLAB, the MATLAB will crash and gives this error
Gtk-Message: 12:36:13.523: Failed to load module "overlay-scrollbar"
[0527/123639.510619:ERROR:gl_utils.cc(319)] [.WebGL-0x25dc130]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
I am using MATLAB R2022b, the Ubuntu version is 18.04.6 and the GNU version is gcc 11.4. Can somebody help explain this error? matlab coder, crash, ubuntu 18.04, matlab r2022b MATLAB Answers — New Questions
Multiple Regression and Intercept
% Load the data from the Excel file
data = readtable(‘데이터(최종).xlsx’, ‘Sheet’, ‘Sheet5’);
% Define the dependent variable
y = data.Arrive;
% Define the independent variables
X = [data.Price_m, data.Volme, data.Relative_y, data.Relative_m, …
data.mine, data.debt, data.Quin, data.Cpi, data.Rate, data.Depo, …
data.Bull, data.Sale, data.Move, data.Sub];
% Add a column of ones to the independent variables matrix for the intercept
X = [ones(size(X, 1), 1), X];
% Perform the multiple linear regression
[b, ~, ~, ~, stats] = regress(y, X);
% Display the results
disp(‘Regression Coefficients:’);
disp(b);
disp(‘R-squared:’);
disp(stats(1));
disp(‘F-statistic:’);
disp(stats(2));
disp(‘p-value:’);
disp(stats(3));
disp(‘Error Variance:’);
disp(stats(4));
I’m going to proceed with a multilinear regression analysis with the data string called Arrive as the dependent variable, and the result is as follows. Is it ok…?
disp(stats(4));
Regression Coefficients:
1.0e+06 *
4.1453
-0.0190
0.0040
-0.0960
-0.6115
-0.0022
-0.0140
0.0259
0.0070
-0.0602
-0.0196
-0.0003
-0.0000
0.0000
0.0000
R-squared:
0.3997
F-statistic:
4.5189
p-value:
3.5809e-06
Error Variance:
3.8687e+09% Load the data from the Excel file
data = readtable(‘데이터(최종).xlsx’, ‘Sheet’, ‘Sheet5’);
% Define the dependent variable
y = data.Arrive;
% Define the independent variables
X = [data.Price_m, data.Volme, data.Relative_y, data.Relative_m, …
data.mine, data.debt, data.Quin, data.Cpi, data.Rate, data.Depo, …
data.Bull, data.Sale, data.Move, data.Sub];
% Add a column of ones to the independent variables matrix for the intercept
X = [ones(size(X, 1), 1), X];
% Perform the multiple linear regression
[b, ~, ~, ~, stats] = regress(y, X);
% Display the results
disp(‘Regression Coefficients:’);
disp(b);
disp(‘R-squared:’);
disp(stats(1));
disp(‘F-statistic:’);
disp(stats(2));
disp(‘p-value:’);
disp(stats(3));
disp(‘Error Variance:’);
disp(stats(4));
I’m going to proceed with a multilinear regression analysis with the data string called Arrive as the dependent variable, and the result is as follows. Is it ok…?
disp(stats(4));
Regression Coefficients:
1.0e+06 *
4.1453
-0.0190
0.0040
-0.0960
-0.6115
-0.0022
-0.0140
0.0259
0.0070
-0.0602
-0.0196
-0.0003
-0.0000
0.0000
0.0000
R-squared:
0.3997
F-statistic:
4.5189
p-value:
3.5809e-06
Error Variance:
3.8687e+09 % Load the data from the Excel file
data = readtable(‘데이터(최종).xlsx’, ‘Sheet’, ‘Sheet5’);
% Define the dependent variable
y = data.Arrive;
% Define the independent variables
X = [data.Price_m, data.Volme, data.Relative_y, data.Relative_m, …
data.mine, data.debt, data.Quin, data.Cpi, data.Rate, data.Depo, …
data.Bull, data.Sale, data.Move, data.Sub];
% Add a column of ones to the independent variables matrix for the intercept
X = [ones(size(X, 1), 1), X];
% Perform the multiple linear regression
[b, ~, ~, ~, stats] = regress(y, X);
% Display the results
disp(‘Regression Coefficients:’);
disp(b);
disp(‘R-squared:’);
disp(stats(1));
disp(‘F-statistic:’);
disp(stats(2));
disp(‘p-value:’);
disp(stats(3));
disp(‘Error Variance:’);
disp(stats(4));
I’m going to proceed with a multilinear regression analysis with the data string called Arrive as the dependent variable, and the result is as follows. Is it ok…?
disp(stats(4));
Regression Coefficients:
1.0e+06 *
4.1453
-0.0190
0.0040
-0.0960
-0.6115
-0.0022
-0.0140
0.0259
0.0070
-0.0602
-0.0196
-0.0003
-0.0000
0.0000
0.0000
R-squared:
0.3997
F-statistic:
4.5189
p-value:
3.5809e-06
Error Variance:
3.8687e+09 regression, multiple, intercept MATLAB Answers — New Questions
What is the difference between Transfer Function Model and Process Model
Estimating Transfer Function Models for a Heat Exchanger – MATLAB & Simulink Example (mathworks.com)
In this Example, it use transfer function with a time delay as model to do the estimation(section"Transfer Function Estimation from an Initial System"). Next section "Process Model Estimation", it improve the estimation by using a process model.
However, the two models have the same structure, why do them conduct a different result ?Estimating Transfer Function Models for a Heat Exchanger – MATLAB & Simulink Example (mathworks.com)
In this Example, it use transfer function with a time delay as model to do the estimation(section"Transfer Function Estimation from an Initial System"). Next section "Process Model Estimation", it improve the estimation by using a process model.
However, the two models have the same structure, why do them conduct a different result ? Estimating Transfer Function Models for a Heat Exchanger – MATLAB & Simulink Example (mathworks.com)
In this Example, it use transfer function with a time delay as model to do the estimation(section"Transfer Function Estimation from an Initial System"). Next section "Process Model Estimation", it improve the estimation by using a process model.
However, the two models have the same structure, why do them conduct a different result ? system identification, model, transfer function, process function MATLAB Answers — New Questions
Creating ID using year and event number
Hi,
I have a set of cyclone data that I am trying to preprocess before I can do some stats on it. In order to do this i need to create a unique id for each system using the year it happened and which event in the year it was. In the sample data i have attached, every time Var1 returns to 1, a new system is registered. So Var1(1:3) should have id 1990S1, Var1(4:5) should be 1990S2, Var(6:7) should be 1990S3 and so forth. I want to create a column of Id and put it in Col1 of my time table so that it easy for me to use ‘varfun’ to do the stats.
Thanks in advanceHi,
I have a set of cyclone data that I am trying to preprocess before I can do some stats on it. In order to do this i need to create a unique id for each system using the year it happened and which event in the year it was. In the sample data i have attached, every time Var1 returns to 1, a new system is registered. So Var1(1:3) should have id 1990S1, Var1(4:5) should be 1990S2, Var(6:7) should be 1990S3 and so forth. I want to create a column of Id and put it in Col1 of my time table so that it easy for me to use ‘varfun’ to do the stats.
Thanks in advance Hi,
I have a set of cyclone data that I am trying to preprocess before I can do some stats on it. In order to do this i need to create a unique id for each system using the year it happened and which event in the year it was. In the sample data i have attached, every time Var1 returns to 1, a new system is registered. So Var1(1:3) should have id 1990S1, Var1(4:5) should be 1990S2, Var(6:7) should be 1990S3 and so forth. I want to create a column of Id and put it in Col1 of my time table so that it easy for me to use ‘varfun’ to do the stats.
Thanks in advance timetable MATLAB Answers — New Questions
Looking for a System Identification Course
I have struggled getting good results from the System Identification toolbox for years. Does anyone know of a course I can take in System Identification online over the course of a semester or in person over the course of a week?
I have several books I am reading right now along with Ljung’s book. I still find the material complex enough that I could use a course.I have struggled getting good results from the System Identification toolbox for years. Does anyone know of a course I can take in System Identification online over the course of a semester or in person over the course of a week?
I have several books I am reading right now along with Ljung’s book. I still find the material complex enough that I could use a course. I have struggled getting good results from the System Identification toolbox for years. Does anyone know of a course I can take in System Identification online over the course of a semester or in person over the course of a week?
I have several books I am reading right now along with Ljung’s book. I still find the material complex enough that I could use a course. system identification, sysid, sys_id MATLAB Answers — New Questions
The code below runs nonstop, and the results are not shown. why is that?
syms J1 J5 J6 J7 Jm T1 T2 T3 T4 T5 T6 Tm
%Jm = 1000; %5077.12;
Js = 301.32;
Je = 7;%330.136;
A2 = 449200;
A4 = 519000;
Fms = 0.305;
Fm1 = 0.45;
Fme = 0.245;
F1s = 0.610;
F1m = 0.389;
eps = 0.85;
Te = 215;
K1 = 60; %solar cell
L1 = 0.2e-3; %solar cell
R1 = 0.6e-4;
K2 = 15; %solar panel
L2 = 0.03; %solar panel
F5e = 0.1;
F5s = 0.03;
Fem = 0.1;
Fe5 = 0.01;
S0 = -Jm + eps*5.67e-8*Tm^4 + ((1-eps)*5*1360);
S1 = -(5.67e-8*Tm^4 – Jm)*(A2*eps)/(1-eps) + (Jm – Js)*(A2*Fms) + (Jm – J1)*(A2*Fm1) + (Jm – Je)*(A2*Fme);%J1
S2 = -(5.67e-8*T1^4 – J1)*(A4*eps)/(1-eps) + (J1 – Js)*(A4*F1s) + (J1 – Jm)*(A4*F1m);%T1
S3 = -(5.67e-8*T1^4 – J1)*(A4*eps)/(1-eps) + (T1-T2)*K1*A4/L1;%T2
S4 = -(T1 – T2)*K1/L1 + (T2-T3)/R1;
S5 = -(T2-T3)/R1 + (T3-T4)/L2*K2;
S6 = -(T3 – T4)/L2*K2 + (5.67e-8*T4^4 – J6)*A4*eps/(1-eps);
S7 = -(5.67e-8*T4^4 – J6)*eps/(1-eps) + (J6 – J7);
S8 = -(J6-J7) + (5.67e-8*T5^4 – J7)*eps/(1-eps) – 185.95;
S9 = -(5.67e-8*T5^4 – J7)*eps/(1-eps) + (T5 – T6)*K2/L2;
S10 = -(5.67e-8*T6^4 – J5)*eps/(1-eps) + (J5 – Je)*F5e + (J5 – J1)*F5s;
S11 = -(5.67e-8*Te^4 – Je)*eps/(1-eps) + (Je – Jm)*Fem + (Je- J5)*Fe5;
S = [S0,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11];
vars = [J1, J5, J6, J7, Jm, T1, T2, T3, T4, T5, T6, Tm];
sol = solve(S, vars);
T1_val = real(double(sol.T1(1)))
T2_val = real(double(sol.T2(1)))
T3_val = real(double(sol.T3(1)))
T4_val = real(double(sol.T4(1)))
T5_val = real(double(sol.T5(1)))
T6_val = real(double(sol.T6(1)))syms J1 J5 J6 J7 Jm T1 T2 T3 T4 T5 T6 Tm
%Jm = 1000; %5077.12;
Js = 301.32;
Je = 7;%330.136;
A2 = 449200;
A4 = 519000;
Fms = 0.305;
Fm1 = 0.45;
Fme = 0.245;
F1s = 0.610;
F1m = 0.389;
eps = 0.85;
Te = 215;
K1 = 60; %solar cell
L1 = 0.2e-3; %solar cell
R1 = 0.6e-4;
K2 = 15; %solar panel
L2 = 0.03; %solar panel
F5e = 0.1;
F5s = 0.03;
Fem = 0.1;
Fe5 = 0.01;
S0 = -Jm + eps*5.67e-8*Tm^4 + ((1-eps)*5*1360);
S1 = -(5.67e-8*Tm^4 – Jm)*(A2*eps)/(1-eps) + (Jm – Js)*(A2*Fms) + (Jm – J1)*(A2*Fm1) + (Jm – Je)*(A2*Fme);%J1
S2 = -(5.67e-8*T1^4 – J1)*(A4*eps)/(1-eps) + (J1 – Js)*(A4*F1s) + (J1 – Jm)*(A4*F1m);%T1
S3 = -(5.67e-8*T1^4 – J1)*(A4*eps)/(1-eps) + (T1-T2)*K1*A4/L1;%T2
S4 = -(T1 – T2)*K1/L1 + (T2-T3)/R1;
S5 = -(T2-T3)/R1 + (T3-T4)/L2*K2;
S6 = -(T3 – T4)/L2*K2 + (5.67e-8*T4^4 – J6)*A4*eps/(1-eps);
S7 = -(5.67e-8*T4^4 – J6)*eps/(1-eps) + (J6 – J7);
S8 = -(J6-J7) + (5.67e-8*T5^4 – J7)*eps/(1-eps) – 185.95;
S9 = -(5.67e-8*T5^4 – J7)*eps/(1-eps) + (T5 – T6)*K2/L2;
S10 = -(5.67e-8*T6^4 – J5)*eps/(1-eps) + (J5 – Je)*F5e + (J5 – J1)*F5s;
S11 = -(5.67e-8*Te^4 – Je)*eps/(1-eps) + (Je – Jm)*Fem + (Je- J5)*Fe5;
S = [S0,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11];
vars = [J1, J5, J6, J7, Jm, T1, T2, T3, T4, T5, T6, Tm];
sol = solve(S, vars);
T1_val = real(double(sol.T1(1)))
T2_val = real(double(sol.T2(1)))
T3_val = real(double(sol.T3(1)))
T4_val = real(double(sol.T4(1)))
T5_val = real(double(sol.T5(1)))
T6_val = real(double(sol.T6(1))) syms J1 J5 J6 J7 Jm T1 T2 T3 T4 T5 T6 Tm
%Jm = 1000; %5077.12;
Js = 301.32;
Je = 7;%330.136;
A2 = 449200;
A4 = 519000;
Fms = 0.305;
Fm1 = 0.45;
Fme = 0.245;
F1s = 0.610;
F1m = 0.389;
eps = 0.85;
Te = 215;
K1 = 60; %solar cell
L1 = 0.2e-3; %solar cell
R1 = 0.6e-4;
K2 = 15; %solar panel
L2 = 0.03; %solar panel
F5e = 0.1;
F5s = 0.03;
Fem = 0.1;
Fe5 = 0.01;
S0 = -Jm + eps*5.67e-8*Tm^4 + ((1-eps)*5*1360);
S1 = -(5.67e-8*Tm^4 – Jm)*(A2*eps)/(1-eps) + (Jm – Js)*(A2*Fms) + (Jm – J1)*(A2*Fm1) + (Jm – Je)*(A2*Fme);%J1
S2 = -(5.67e-8*T1^4 – J1)*(A4*eps)/(1-eps) + (J1 – Js)*(A4*F1s) + (J1 – Jm)*(A4*F1m);%T1
S3 = -(5.67e-8*T1^4 – J1)*(A4*eps)/(1-eps) + (T1-T2)*K1*A4/L1;%T2
S4 = -(T1 – T2)*K1/L1 + (T2-T3)/R1;
S5 = -(T2-T3)/R1 + (T3-T4)/L2*K2;
S6 = -(T3 – T4)/L2*K2 + (5.67e-8*T4^4 – J6)*A4*eps/(1-eps);
S7 = -(5.67e-8*T4^4 – J6)*eps/(1-eps) + (J6 – J7);
S8 = -(J6-J7) + (5.67e-8*T5^4 – J7)*eps/(1-eps) – 185.95;
S9 = -(5.67e-8*T5^4 – J7)*eps/(1-eps) + (T5 – T6)*K2/L2;
S10 = -(5.67e-8*T6^4 – J5)*eps/(1-eps) + (J5 – Je)*F5e + (J5 – J1)*F5s;
S11 = -(5.67e-8*Te^4 – Je)*eps/(1-eps) + (Je – Jm)*Fem + (Je- J5)*Fe5;
S = [S0,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11];
vars = [J1, J5, J6, J7, Jm, T1, T2, T3, T4, T5, T6, Tm];
sol = solve(S, vars);
T1_val = real(double(sol.T1(1)))
T2_val = real(double(sol.T2(1)))
T3_val = real(double(sol.T3(1)))
T4_val = real(double(sol.T4(1)))
T5_val = real(double(sol.T5(1)))
T6_val = real(double(sol.T6(1))) code run MATLAB Answers — New Questions
Does anyone know how to convert a .blf file (Canalyzer) into matlab structure?
Hi,
Does anyone know how to convert a .blf file (Canalyzer) into matlab structure?
Thank you in advanceHi,
Does anyone know how to convert a .blf file (Canalyzer) into matlab structure?
Thank you in advance Hi,
Does anyone know how to convert a .blf file (Canalyzer) into matlab structure?
Thank you in advance blf, canalyser, convert MATLAB Answers — New Questions
how to solve this second differential equation mx”+cx’+kx+kx^3=f0cos(wt)(I am stuck)
What is wrong in my code?
function Xdot=num_for(t,X)
m=100; k=1000; c=160;
ze=c/(2*sqrt(k*m));
wn=sqrt(k/m);
w=5; F=160; f=F/m;
y0=[0.01;0.1];
y1=y0.^2;
f=[0; f*cos(w*t)];
A=[0 1;-wn*wn-k/m*y1 -2*ze*wn];
Xdot=A*X+f;
end
Tspan=[0 10];
y0=[0.01;0.1];
[t,y]=ode45(@num_for,Tspan,y0);
figure
plot(t,y(:,1))What is wrong in my code?
function Xdot=num_for(t,X)
m=100; k=1000; c=160;
ze=c/(2*sqrt(k*m));
wn=sqrt(k/m);
w=5; F=160; f=F/m;
y0=[0.01;0.1];
y1=y0.^2;
f=[0; f*cos(w*t)];
A=[0 1;-wn*wn-k/m*y1 -2*ze*wn];
Xdot=A*X+f;
end
Tspan=[0 10];
y0=[0.01;0.1];
[t,y]=ode45(@num_for,Tspan,y0);
figure
plot(t,y(:,1)) What is wrong in my code?
function Xdot=num_for(t,X)
m=100; k=1000; c=160;
ze=c/(2*sqrt(k*m));
wn=sqrt(k/m);
w=5; F=160; f=F/m;
y0=[0.01;0.1];
y1=y0.^2;
f=[0; f*cos(w*t)];
A=[0 1;-wn*wn-k/m*y1 -2*ze*wn];
Xdot=A*X+f;
end
Tspan=[0 10];
y0=[0.01;0.1];
[t,y]=ode45(@num_for,Tspan,y0);
figure
plot(t,y(:,1)) differential equations MATLAB Answers — New Questions
Transformation matrix for 3D frame element
Hi! I have constructed the local matrices K and M(12×12 matrices) for my frame elements in 3D, but I dont know how to continue to the global system with transformation matrix. I found a lot about 2D problems but in 3D I dont know how to build the matrix in matlab or anything else. If someone knows how to do it, please give me some help. Thank you!!Hi! I have constructed the local matrices K and M(12×12 matrices) for my frame elements in 3D, but I dont know how to continue to the global system with transformation matrix. I found a lot about 2D problems but in 3D I dont know how to build the matrix in matlab or anything else. If someone knows how to do it, please give me some help. Thank you!! Hi! I have constructed the local matrices K and M(12×12 matrices) for my frame elements in 3D, but I dont know how to continue to the global system with transformation matrix. I found a lot about 2D problems but in 3D I dont know how to build the matrix in matlab or anything else. If someone knows how to do it, please give me some help. Thank you!! finite element, transformation matrix, 3d structural MATLAB Answers — New Questions
Solving a system of non linear equations with several solver (choose) adjusting the number of equations
Hi all,
I have a certain equation (analytic expression) defined by parameters and some measurements (right side of my equation) and I want to write down a system of equations specifying the number of equations (that can be adjusted). I want to solve the system choosing different solvers possibly, like lsqnonlin or other funcitons within the optimization toolbox. How can I achieve this?
Thanks in advance for your answer.Hi all,
I have a certain equation (analytic expression) defined by parameters and some measurements (right side of my equation) and I want to write down a system of equations specifying the number of equations (that can be adjusted). I want to solve the system choosing different solvers possibly, like lsqnonlin or other funcitons within the optimization toolbox. How can I achieve this?
Thanks in advance for your answer. Hi all,
I have a certain equation (analytic expression) defined by parameters and some measurements (right side of my equation) and I want to write down a system of equations specifying the number of equations (that can be adjusted). I want to solve the system choosing different solvers possibly, like lsqnonlin or other funcitons within the optimization toolbox. How can I achieve this?
Thanks in advance for your answer. systemofequations, lsqnonlin, variables MATLAB Answers — New Questions
Equally spaced points along a nonlinear path
I have a path linear by parts that I need to equally divide with points. How do I do that?I have a path linear by parts that I need to equally divide with points. How do I do that? I have a path linear by parts that I need to equally divide with points. How do I do that? linspace MATLAB Answers — New Questions
I need to solve very precisely an ODE once so I don’t have to solve it $N^2$ times
I have an ODE like with initial condition . Now, I need to solve this ODE times ($N^2$ being the size of a square matrix) where, in each point of the matrix, I have a different initial condition and a different final time I need to calculate. However, the function is monotone, and if I consider as initial condition the lowest value it can take, if I solve once the ODE very precisely I should be able to get all the desired values at once, without having to solve $N^2 $ times the same ODE. My question is: since the times I’ll need to evaluate the solution on are in general real, as well as the different initial conditions, is there a way to do it?I have an ODE like with initial condition . Now, I need to solve this ODE times ($N^2$ being the size of a square matrix) where, in each point of the matrix, I have a different initial condition and a different final time I need to calculate. However, the function is monotone, and if I consider as initial condition the lowest value it can take, if I solve once the ODE very precisely I should be able to get all the desired values at once, without having to solve $N^2 $ times the same ODE. My question is: since the times I’ll need to evaluate the solution on are in general real, as well as the different initial conditions, is there a way to do it? I have an ODE like with initial condition . Now, I need to solve this ODE times ($N^2$ being the size of a square matrix) where, in each point of the matrix, I have a different initial condition and a different final time I need to calculate. However, the function is monotone, and if I consider as initial condition the lowest value it can take, if I solve once the ODE very precisely I should be able to get all the desired values at once, without having to solve $N^2 $ times the same ODE. My question is: since the times I’ll need to evaluate the solution on are in general real, as well as the different initial conditions, is there a way to do it? ode MATLAB Answers — New Questions
How to correct set conditions and params of PDE?
Dear members of community! I have a important problem with PDE Toolbox initialization coeffs and conditions.
I try to solve heat equation and compare exact solution and PINN solution looks like Solve Poisson Equation on Unit Disk Using Physics-Informed Neural Networks – MATLAB & Simulink (mathworks.com) . But, first I should correct create mesh and for obtain solution (numerical solution).
Problem formulation:
Consider the next mathematical problem: heat equation with initial and boundary conditions – modes with exacerbation. Let we have specific auomdel heat equation
satisfies boundary an initial conditions:
Automodel general solution of this problem is:
where is solution of ODE problem:
The solutions of this problem for is
Matlab code:
Create the PDE model and include the geometry.
model = createpde;
R1 = [3,4,0,1,1,0,0,0,10,10]’;
g = decsg(R1);
geometryFromEdges(model,g);
pdegplot(model,EdgeLabels="on")
axis equal
grid on
Define constants of PDE and initial and boundary equations:
k0 = 1; % Adjust as necessary
sigma = 2; % Adjust as necessary
A0 = 2; % Adjust as necessary
T = 0.5; % Adjust as necessary
n = 2; % Adjust as necessary
% Initial conditions
setInitialConditions(model,0);
% Boundary conditions
applyBoundaryCondition(model, ‘dirichlet’, ‘Edge’, 1, ‘u’, @(region,state) A0 * (T – state.time)^n);
% PDE coefficients
specifyCoefficients(model, ‘m’, 0, ‘d’, 1, ‘c’, @(region, state) k0 * state.u.^sigma, ‘a’, 0, ‘f’, 0);
% Generate mesh
generateMesh(model, ‘Hmax’, 0.1);
Try to obatin numerical solution:
% Solve the PDE
tlist = linspace(0, T, 50);
result = solvepde(model, tlist);
u = result.NodalSolution;
I understand, that obtainded numerical solution is not correct, and training PINN using this meshes and PDE coeffs non coorrect step os obtain solution:
Is not correct solution.
My problem:
How to correct set intial and boundary conditions, and create geometric dash for solve this PDE?Dear members of community! I have a important problem with PDE Toolbox initialization coeffs and conditions.
I try to solve heat equation and compare exact solution and PINN solution looks like Solve Poisson Equation on Unit Disk Using Physics-Informed Neural Networks – MATLAB & Simulink (mathworks.com) . But, first I should correct create mesh and for obtain solution (numerical solution).
Problem formulation:
Consider the next mathematical problem: heat equation with initial and boundary conditions – modes with exacerbation. Let we have specific auomdel heat equation
satisfies boundary an initial conditions:
Automodel general solution of this problem is:
where is solution of ODE problem:
The solutions of this problem for is
Matlab code:
Create the PDE model and include the geometry.
model = createpde;
R1 = [3,4,0,1,1,0,0,0,10,10]’;
g = decsg(R1);
geometryFromEdges(model,g);
pdegplot(model,EdgeLabels="on")
axis equal
grid on
Define constants of PDE and initial and boundary equations:
k0 = 1; % Adjust as necessary
sigma = 2; % Adjust as necessary
A0 = 2; % Adjust as necessary
T = 0.5; % Adjust as necessary
n = 2; % Adjust as necessary
% Initial conditions
setInitialConditions(model,0);
% Boundary conditions
applyBoundaryCondition(model, ‘dirichlet’, ‘Edge’, 1, ‘u’, @(region,state) A0 * (T – state.time)^n);
% PDE coefficients
specifyCoefficients(model, ‘m’, 0, ‘d’, 1, ‘c’, @(region, state) k0 * state.u.^sigma, ‘a’, 0, ‘f’, 0);
% Generate mesh
generateMesh(model, ‘Hmax’, 0.1);
Try to obatin numerical solution:
% Solve the PDE
tlist = linspace(0, T, 50);
result = solvepde(model, tlist);
u = result.NodalSolution;
I understand, that obtainded numerical solution is not correct, and training PINN using this meshes and PDE coeffs non coorrect step os obtain solution:
Is not correct solution.
My problem:
How to correct set intial and boundary conditions, and create geometric dash for solve this PDE? Dear members of community! I have a important problem with PDE Toolbox initialization coeffs and conditions.
I try to solve heat equation and compare exact solution and PINN solution looks like Solve Poisson Equation on Unit Disk Using Physics-Informed Neural Networks – MATLAB & Simulink (mathworks.com) . But, first I should correct create mesh and for obtain solution (numerical solution).
Problem formulation:
Consider the next mathematical problem: heat equation with initial and boundary conditions – modes with exacerbation. Let we have specific auomdel heat equation
satisfies boundary an initial conditions:
Automodel general solution of this problem is:
where is solution of ODE problem:
The solutions of this problem for is
Matlab code:
Create the PDE model and include the geometry.
model = createpde;
R1 = [3,4,0,1,1,0,0,0,10,10]’;
g = decsg(R1);
geometryFromEdges(model,g);
pdegplot(model,EdgeLabels="on")
axis equal
grid on
Define constants of PDE and initial and boundary equations:
k0 = 1; % Adjust as necessary
sigma = 2; % Adjust as necessary
A0 = 2; % Adjust as necessary
T = 0.5; % Adjust as necessary
n = 2; % Adjust as necessary
% Initial conditions
setInitialConditions(model,0);
% Boundary conditions
applyBoundaryCondition(model, ‘dirichlet’, ‘Edge’, 1, ‘u’, @(region,state) A0 * (T – state.time)^n);
% PDE coefficients
specifyCoefficients(model, ‘m’, 0, ‘d’, 1, ‘c’, @(region, state) k0 * state.u.^sigma, ‘a’, 0, ‘f’, 0);
% Generate mesh
generateMesh(model, ‘Hmax’, 0.1);
Try to obatin numerical solution:
% Solve the PDE
tlist = linspace(0, T, 50);
result = solvepde(model, tlist);
u = result.NodalSolution;
I understand, that obtainded numerical solution is not correct, and training PINN using this meshes and PDE coeffs non coorrect step os obtain solution:
Is not correct solution.
My problem:
How to correct set intial and boundary conditions, and create geometric dash for solve this PDE? pde, pinn, neural network MATLAB Answers — New Questions
how to remove variables of a table with a zeros in it
I have a table, where there are several variables which has some zeros as well as few non zeros values. There are some variables which has all nonzero values. I want to remove the variables which has even a single zero in it.I have a table, where there are several variables which has some zeros as well as few non zeros values. There are some variables which has all nonzero values. I want to remove the variables which has even a single zero in it. I have a table, where there are several variables which has some zeros as well as few non zeros values. There are some variables which has all nonzero values. I want to remove the variables which has even a single zero in it. table, removing variables MATLAB Answers — New Questions
Smoothing or special techniques to resolve uncertain peaks are required!!
I need to find the local extremum point in this data and The photo above shows the data where we found the maxima.
However, the peaks have an irregular pattern. How can I make this data as smooth as a sin function?
Nothing like LPF or moving average filters helped me, please help me outI need to find the local extremum point in this data and The photo above shows the data where we found the maxima.
However, the peaks have an irregular pattern. How can I make this data as smooth as a sin function?
Nothing like LPF or moving average filters helped me, please help me out I need to find the local extremum point in this data and The photo above shows the data where we found the maxima.
However, the peaks have an irregular pattern. How can I make this data as smooth as a sin function?
Nothing like LPF or moving average filters helped me, please help me out smoothing, data preprocessing MATLAB Answers — New Questions
Different answers on different computers
I am trying to solve a question my professor posed on a simulation for my Linear Algebra and Geometry course and I get different answers depending on the pc used, I tried using MATLAB online and I got the same result I had on my installed version, a friend gets a different answer on his own PC but always consistent in the specific PCs. I understand this might have something to do with the ill conditioning of a system but the code is so brief and short, and I think the point of the question posed is that fact in the first place. The problem in question:
Let M be the matrix generated by the command magic(432), I the identity matrix and A = M + 10I. Let b be the right-hand side such that the solution of the linear system Ax = b is a vector with all elements equal to 1. Solve the linear system with the MATLAB command . Let Nr be the infinite norm of the residual b – Ax. Which is the order of Nr?"
The question is a multiple choice one and the choices are as follows:
10^-3
10^-8
10^-6
10^-1
10^-5
with 10^-8 being marked as the correct answer.
The code I used is this:
M = magic(432);
I = eye(432);
A = M + 10 * I;
x = ones(432,1);
b = A*x;
x_computed = Ab;
norm(b – A*x_computed,inf)
I do not understand what process I have to go through to stabilize this problem nor if I need to do so in the first place. Is this question just problematic with the way it is posed or is there an obvious solution to it that I as a begineer can not see?I am trying to solve a question my professor posed on a simulation for my Linear Algebra and Geometry course and I get different answers depending on the pc used, I tried using MATLAB online and I got the same result I had on my installed version, a friend gets a different answer on his own PC but always consistent in the specific PCs. I understand this might have something to do with the ill conditioning of a system but the code is so brief and short, and I think the point of the question posed is that fact in the first place. The problem in question:
Let M be the matrix generated by the command magic(432), I the identity matrix and A = M + 10I. Let b be the right-hand side such that the solution of the linear system Ax = b is a vector with all elements equal to 1. Solve the linear system with the MATLAB command . Let Nr be the infinite norm of the residual b – Ax. Which is the order of Nr?"
The question is a multiple choice one and the choices are as follows:
10^-3
10^-8
10^-6
10^-1
10^-5
with 10^-8 being marked as the correct answer.
The code I used is this:
M = magic(432);
I = eye(432);
A = M + 10 * I;
x = ones(432,1);
b = A*x;
x_computed = Ab;
norm(b – A*x_computed,inf)
I do not understand what process I have to go through to stabilize this problem nor if I need to do so in the first place. Is this question just problematic with the way it is posed or is there an obvious solution to it that I as a begineer can not see? I am trying to solve a question my professor posed on a simulation for my Linear Algebra and Geometry course and I get different answers depending on the pc used, I tried using MATLAB online and I got the same result I had on my installed version, a friend gets a different answer on his own PC but always consistent in the specific PCs. I understand this might have something to do with the ill conditioning of a system but the code is so brief and short, and I think the point of the question posed is that fact in the first place. The problem in question:
Let M be the matrix generated by the command magic(432), I the identity matrix and A = M + 10I. Let b be the right-hand side such that the solution of the linear system Ax = b is a vector with all elements equal to 1. Solve the linear system with the MATLAB command . Let Nr be the infinite norm of the residual b – Ax. Which is the order of Nr?"
The question is a multiple choice one and the choices are as follows:
10^-3
10^-8
10^-6
10^-1
10^-5
with 10^-8 being marked as the correct answer.
The code I used is this:
M = magic(432);
I = eye(432);
A = M + 10 * I;
x = ones(432,1);
b = A*x;
x_computed = Ab;
norm(b – A*x_computed,inf)
I do not understand what process I have to go through to stabilize this problem nor if I need to do so in the first place. Is this question just problematic with the way it is posed or is there an obvious solution to it that I as a begineer can not see? system, inconsistent answers MATLAB Answers — New Questions
How can I import 2D antenna radiation pattern into 2D cartesian coordinates environment?
Is there a way to get the radiation pattern’s x and y vertices (for instance) from available matlab antennas? Or any other kind of data which might be further used for plot(x,y) function?Is there a way to get the radiation pattern’s x and y vertices (for instance) from available matlab antennas? Or any other kind of data which might be further used for plot(x,y) function? Is there a way to get the radiation pattern’s x and y vertices (for instance) from available matlab antennas? Or any other kind of data which might be further used for plot(x,y) function? antenna, image processing MATLAB Answers — New Questions