Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/Looking for linear system Ax=0 precision improvements

Looking for linear system Ax=0 precision improvements

PuTI / 2025-03-06
Looking for linear system Ax=0  precision improvements
Matlab News

Hi, I’m solving a system of equations .
x=null(A);
The problem is that due to a very wide range of values in the A matrix () the roundoff error result in inacceptably large relative errors in the solution. How can I improve this numerical resolution? The matrix is relatively small (30×30) so speed is not a big limitation. Also all the large values are on the same colums.

Edit2: clarifying the question and objectives
To clarify my issue, my understanding is that null sort of ends up minimising .
Its limited double precision and even if you plug in the exact solution, i can only hope to have about
A*x <= length(x)*eps(max(A.*x’))
When i plot A*x, I get something closer to
A*x = length(x)*eps(max(A.*x’,[],’all’))
This is probably to be expected as minimisation of "distributes the error" over all components equally?
In my case, I care about relative errors of individual coordinates . I want them to be small and at least know when a value is smaller than engine precision.
Can I be more precise in calculating the small value at the cost of the larger ones if necessary, and how up to what threshold I can trust this value?
A good improvement was proposed:
s = max(abs(A),[],1); %rescaling
x = null(A./s)./(s’);
This is better but not quite sufficient and I stil miss the key aspect of knowing what value is below reasonaly accurate. I initially used x>eps(1) to check for that. This was wrong but my following attemps were not any better.

—– Edit: Correcting the question following Matt’s advice. —–
I benchmark the relative error over each element of the solution , with .
relative_error = abs((A*x)./(vecnorm(A)’.*x));

I have a kinda dirty solution using a combination of rescaling, null(), and fsolve(). You can see below the result for four different approaches.

x1 = null(A);
x1 = x1/sum(x1(:,1));

s = max(abs(A),[],1); %rescaling
x2 = null(A./s)./(s’);
x2 = x2/sum(x2(:,1));

x3 = fsolve(@(y) A*y,x2,optimoptions(‘fsolve’,’Display’,’off’));
x3=x3/sum(x3);

precision = length(A)*eps(max(abs(A.*(x2′)),[],2));
x4 = fsolve(@(y) A*y./max(abs(x2),precision),x2,optimoptions(‘fsolve’,’Display’,’off’));
x4 = x4/sum(x4);

figure
hold on
plot(x4,’k–‘)
relative_error = abs((A*x1)./(vecnorm(A)’.*x1));
plot(relative_error)
relative_error = abs((A*x2)./(vecnorm(A)’.*x2));
plot(relative_error)
relative_error = abs((A*x3)./(vecnorm(A)’.*x3));
plot(relative_error)
relative_error = abs((A*x4)./(vecnorm(A)’.*x4));
plot(relative_error)
set(gca,’Yscale’,’log’)
legend({‘x_4′,’err 1′,’err 2′,’err 3′,’err 4’})

The method is probably a bit slow and dirty but the relative error reached is close to eps.Hi, I’m solving a system of equations .
x=null(A);
The problem is that due to a very wide range of values in the A matrix () the roundoff error result in inacceptably large relative errors in the solution. How can I improve this numerical resolution? The matrix is relatively small (30×30) so speed is not a big limitation. Also all the large values are on the same colums.

Edit2: clarifying the question and objectives
To clarify my issue, my understanding is that null sort of ends up minimising .
Its limited double precision and even if you plug in the exact solution, i can only hope to have about
A*x <= length(x)*eps(max(A.*x’))
When i plot A*x, I get something closer to
A*x = length(x)*eps(max(A.*x’,[],’all’))
This is probably to be expected as minimisation of "distributes the error" over all components equally?
In my case, I care about relative errors of individual coordinates . I want them to be small and at least know when a value is smaller than engine precision.
Can I be more precise in calculating the small value at the cost of the larger ones if necessary, and how up to what threshold I can trust this value?
A good improvement was proposed:
s = max(abs(A),[],1); %rescaling
x = null(A./s)./(s’);
This is better but not quite sufficient and I stil miss the key aspect of knowing what value is below reasonaly accurate. I initially used x>eps(1) to check for that. This was wrong but my following attemps were not any better.

—– Edit: Correcting the question following Matt’s advice. —–
I benchmark the relative error over each element of the solution , with .
relative_error = abs((A*x)./(vecnorm(A)’.*x));

I have a kinda dirty solution using a combination of rescaling, null(), and fsolve(). You can see below the result for four different approaches.

x1 = null(A);
x1 = x1/sum(x1(:,1));

s = max(abs(A),[],1); %rescaling
x2 = null(A./s)./(s’);
x2 = x2/sum(x2(:,1));

x3 = fsolve(@(y) A*y,x2,optimoptions(‘fsolve’,’Display’,’off’));
x3=x3/sum(x3);

precision = length(A)*eps(max(abs(A.*(x2′)),[],2));
x4 = fsolve(@(y) A*y./max(abs(x2),precision),x2,optimoptions(‘fsolve’,’Display’,’off’));
x4 = x4/sum(x4);

figure
hold on
plot(x4,’k–‘)
relative_error = abs((A*x1)./(vecnorm(A)’.*x1));
plot(relative_error)
relative_error = abs((A*x2)./(vecnorm(A)’.*x2));
plot(relative_error)
relative_error = abs((A*x3)./(vecnorm(A)’.*x3));
plot(relative_error)
relative_error = abs((A*x4)./(vecnorm(A)’.*x4));
plot(relative_error)
set(gca,’Yscale’,’log’)
legend({‘x_4′,’err 1′,’err 2′,’err 3′,’err 4’})

The method is probably a bit slow and dirty but the relative error reached is close to eps. Hi, I’m solving a system of equations .
x=null(A);
The problem is that due to a very wide range of values in the A matrix () the roundoff error result in inacceptably large relative errors in the solution. How can I improve this numerical resolution? The matrix is relatively small (30×30) so speed is not a big limitation. Also all the large values are on the same colums.

Edit2: clarifying the question and objectives
To clarify my issue, my understanding is that null sort of ends up minimising .
Its limited double precision and even if you plug in the exact solution, i can only hope to have about
A*x <= length(x)*eps(max(A.*x’))
When i plot A*x, I get something closer to
A*x = length(x)*eps(max(A.*x’,[],’all’))
This is probably to be expected as minimisation of "distributes the error" over all components equally?
In my case, I care about relative errors of individual coordinates . I want them to be small and at least know when a value is smaller than engine precision.
Can I be more precise in calculating the small value at the cost of the larger ones if necessary, and how up to what threshold I can trust this value?
A good improvement was proposed:
s = max(abs(A),[],1); %rescaling
x = null(A./s)./(s’);
This is better but not quite sufficient and I stil miss the key aspect of knowing what value is below reasonaly accurate. I initially used x>eps(1) to check for that. This was wrong but my following attemps were not any better.

—– Edit: Correcting the question following Matt’s advice. —–
I benchmark the relative error over each element of the solution , with .
relative_error = abs((A*x)./(vecnorm(A)’.*x));

I have a kinda dirty solution using a combination of rescaling, null(), and fsolve(). You can see below the result for four different approaches.

x1 = null(A);
x1 = x1/sum(x1(:,1));

s = max(abs(A),[],1); %rescaling
x2 = null(A./s)./(s’);
x2 = x2/sum(x2(:,1));

x3 = fsolve(@(y) A*y,x2,optimoptions(‘fsolve’,’Display’,’off’));
x3=x3/sum(x3);

precision = length(A)*eps(max(abs(A.*(x2′)),[],2));
x4 = fsolve(@(y) A*y./max(abs(x2),precision),x2,optimoptions(‘fsolve’,’Display’,’off’));
x4 = x4/sum(x4);

figure
hold on
plot(x4,’k–‘)
relative_error = abs((A*x1)./(vecnorm(A)’.*x1));
plot(relative_error)
relative_error = abs((A*x2)./(vecnorm(A)’.*x2));
plot(relative_error)
relative_error = abs((A*x3)./(vecnorm(A)’.*x3));
plot(relative_error)
relative_error = abs((A*x4)./(vecnorm(A)’.*x4));
plot(relative_error)
set(gca,’Yscale’,’log’)
legend({‘x_4′,’err 1′,’err 2′,’err 3′,’err 4’})

The method is probably a bit slow and dirty but the relative error reached is close to eps. equation, roundoff MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

Import PyTorch LSTM Model into Matlab
2025-05-14

Import PyTorch LSTM Model into Matlab

appdesigner – disruptive help popups
2025-05-14

appdesigner – disruptive help popups

What are the signs that my parameter estimator is on the right track before convergence?
2025-05-14

What are the signs that my parameter estimator is on the right track before convergence?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss