Category: Matlab
Category Archives: Matlab
4th order partial differentiation equation or matrix form to create 3D vase shape…
I have a 3D matrix with 8x8x8 (x,y,z).so i got 56 points n 16 points for boundary.At first i use a formula of finite difference approximation to the 4th order operator given by
[ 1 ;
1 -4 1 ;
1 -8 20 -8 1 ;
1 -4 1 ;
1 ].
And the boundary when u=0, 0.5cos(v). u=1,0.2cos(v) which v=0:2*pi/8:2*pi. And tangency condition is x(-1,j)=x(1,j)-2hg(j).
h=1/8; X(0,v)=(-0.5cos v,-0.5sin v,-0.5);X(1,v)=(-1cos v,-1sin v,0)
After i form al the matrix,still cannot get the 3D smooth vase shape which is with many colors.i dont know what wrong with my programming in Matlab.
If there is a possibility how its done, that would help me a lot.Thanks for the idea and comments..I have a 3D matrix with 8x8x8 (x,y,z).so i got 56 points n 16 points for boundary.At first i use a formula of finite difference approximation to the 4th order operator given by
[ 1 ;
1 -4 1 ;
1 -8 20 -8 1 ;
1 -4 1 ;
1 ].
And the boundary when u=0, 0.5cos(v). u=1,0.2cos(v) which v=0:2*pi/8:2*pi. And tangency condition is x(-1,j)=x(1,j)-2hg(j).
h=1/8; X(0,v)=(-0.5cos v,-0.5sin v,-0.5);X(1,v)=(-1cos v,-1sin v,0)
After i form al the matrix,still cannot get the 3D smooth vase shape which is with many colors.i dont know what wrong with my programming in Matlab.
If there is a possibility how its done, that would help me a lot.Thanks for the idea and comments.. I have a 3D matrix with 8x8x8 (x,y,z).so i got 56 points n 16 points for boundary.At first i use a formula of finite difference approximation to the 4th order operator given by
[ 1 ;
1 -4 1 ;
1 -8 20 -8 1 ;
1 -4 1 ;
1 ].
And the boundary when u=0, 0.5cos(v). u=1,0.2cos(v) which v=0:2*pi/8:2*pi. And tangency condition is x(-1,j)=x(1,j)-2hg(j).
h=1/8; X(0,v)=(-0.5cos v,-0.5sin v,-0.5);X(1,v)=(-1cos v,-1sin v,0)
After i form al the matrix,still cannot get the 3D smooth vase shape which is with many colors.i dont know what wrong with my programming in Matlab.
If there is a possibility how its done, that would help me a lot.Thanks for the idea and comments.. 4th order partial differentiation equation, 3d matrix, 3d plots MATLAB Answers — New Questions
打开matlab时出现错误:无法与所需的Mathworks服务通信(错误5201),在尝试官网的解决方案后仍然无法解决
尝试为什么我会收到错误 5201 – 无法访问运行 MATLAB 所需的服务?- MATLAB 答案 – MATLAB Central — Why do I receive Error 5201 – Unable to access services required to run MATLAB? – MATLAB Answers – MATLAB Central (mathworks.com)后仍然报错5201尝试为什么我会收到错误 5201 – 无法访问运行 MATLAB 所需的服务?- MATLAB 答案 – MATLAB Central — Why do I receive Error 5201 – Unable to access services required to run MATLAB? – MATLAB Answers – MATLAB Central (mathworks.com)后仍然报错5201 尝试为什么我会收到错误 5201 – 无法访问运行 MATLAB 所需的服务?- MATLAB 答案 – MATLAB Central — Why do I receive Error 5201 – Unable to access services required to run MATLAB? – MATLAB Answers – MATLAB Central (mathworks.com)后仍然报错5201 open MATLAB Answers — New Questions
why am I getting this difference in the plotting?
I have a system of equations:
This system satisfies a relation
where is an initial condition.
For I plotted the relation y in two ways:
First way by solving the system numerically using ode45 with RelTol 1e-12 and AbsTol 1e-15 and by having the solution for x I plotted y.
Second way by solving the equation again with ode45 with Reltol 1e-9 and Abstol 1e-12 and then defining y=… and plotting it.
However, the plots are very different and I don’t understand the reason why:
Here is the plot by first method:
Here is the plot by second method:
Help is appreciated!I have a system of equations:
This system satisfies a relation
where is an initial condition.
For I plotted the relation y in two ways:
First way by solving the system numerically using ode45 with RelTol 1e-12 and AbsTol 1e-15 and by having the solution for x I plotted y.
Second way by solving the equation again with ode45 with Reltol 1e-9 and Abstol 1e-12 and then defining y=… and plotting it.
However, the plots are very different and I don’t understand the reason why:
Here is the plot by first method:
Here is the plot by second method:
Help is appreciated! I have a system of equations:
This system satisfies a relation
where is an initial condition.
For I plotted the relation y in two ways:
First way by solving the system numerically using ode45 with RelTol 1e-12 and AbsTol 1e-15 and by having the solution for x I plotted y.
Second way by solving the equation again with ode45 with Reltol 1e-9 and Abstol 1e-12 and then defining y=… and plotting it.
However, the plots are very different and I don’t understand the reason why:
Here is the plot by first method:
Here is the plot by second method:
Help is appreciated! plot, figure, ode45, differential equations, matlab MATLAB Answers — New Questions
Why I am I not able to edit appdesigner in Ubuntu?
When I was following the initial tutorial of app designer, I happened to edit the slider word to amplitude but I couldn’t do it. Later I found that I cannot edit anything except drag and drop of components in canvas. Please help me as I need to finish designing a UI soon.
Thanks, Vinayak BhatteWhen I was following the initial tutorial of app designer, I happened to edit the slider word to amplitude but I couldn’t do it. Later I found that I cannot edit anything except drag and drop of components in canvas. Please help me as I need to finish designing a UI soon.
Thanks, Vinayak Bhatte When I was following the initial tutorial of app designer, I happened to edit the slider word to amplitude but I couldn’t do it. Later I found that I cannot edit anything except drag and drop of components in canvas. Please help me as I need to finish designing a UI soon.
Thanks, Vinayak Bhatte edit, appdesigner, ubuntu, linux MATLAB Answers — New Questions
To create (Heat Recovery Steam Generator) HRSG Simulink Model
Hi, so I desired to create HRSG model for simulation purposes (one of the objectives for Final Year Project (FYP), unfortunately since I have a novice background in the mechanical field ( I’m in electrical engineering field), I have no idea where /how to start. Could anyone give me some pointers what info should I look for/ or suggest any open sources / materials of HRSG simulink models to kickstart my project?Hi, so I desired to create HRSG model for simulation purposes (one of the objectives for Final Year Project (FYP), unfortunately since I have a novice background in the mechanical field ( I’m in electrical engineering field), I have no idea where /how to start. Could anyone give me some pointers what info should I look for/ or suggest any open sources / materials of HRSG simulink models to kickstart my project? Hi, so I desired to create HRSG model for simulation purposes (one of the objectives for Final Year Project (FYP), unfortunately since I have a novice background in the mechanical field ( I’m in electrical engineering field), I have no idea where /how to start. Could anyone give me some pointers what info should I look for/ or suggest any open sources / materials of HRSG simulink models to kickstart my project? hrsg, whrb, ccgt, energy recovery heat exchanger, heat exchanger, simulink, mechanical MATLAB Answers — New Questions
Crash Matlab: Simulation initialization very slow – Re-evaluating bus selectors step lasts forever
Following a crash of Matlab, my simulink model is now taking ages to start : the simulation step "Re-evaluating bus selectors: Started" lasts more than 10 minutes while it was super fast previsouly. Is anyone knowing what Simulink is doing during this step? Any idea for a potential fix? (clearing some projects files which may be corrupted?)
ThxFollowing a crash of Matlab, my simulink model is now taking ages to start : the simulation step "Re-evaluating bus selectors: Started" lasts more than 10 minutes while it was super fast previsouly. Is anyone knowing what Simulink is doing during this step? Any idea for a potential fix? (clearing some projects files which may be corrupted?)
Thx Following a crash of Matlab, my simulink model is now taking ages to start : the simulation step "Re-evaluating bus selectors: Started" lasts more than 10 minutes while it was super fast previsouly. Is anyone knowing what Simulink is doing during this step? Any idea for a potential fix? (clearing some projects files which may be corrupted?)
Thx crash, slow simulink simulation init MATLAB Answers — New Questions
How to read road network data off a map in MATLAB?
Hello everyone,
I am working on Electric vehicle charging station location and plannimng problem. The idea is, that given any city map, we should be able to plan and size the Electric vehicle charging stations locations on a map. For the same, I want to be able to input the city map via google, OpenStreet etc, and my code should be able to read the road network details, like nodes, distance, width, unidirectional or bidirectional road etc.
To be honest, I have made zero progress in that. Using geoplot function, I can read the location, and I can also see the road layout, but Im not able to get anything more out of it.
I already read the document on roadprops,but it isnt useful. I figured its something to do with image processing.
Any help or an example or links would be appreciatedHello everyone,
I am working on Electric vehicle charging station location and plannimng problem. The idea is, that given any city map, we should be able to plan and size the Electric vehicle charging stations locations on a map. For the same, I want to be able to input the city map via google, OpenStreet etc, and my code should be able to read the road network details, like nodes, distance, width, unidirectional or bidirectional road etc.
To be honest, I have made zero progress in that. Using geoplot function, I can read the location, and I can also see the road layout, but Im not able to get anything more out of it.
I already read the document on roadprops,but it isnt useful. I figured its something to do with image processing.
Any help or an example or links would be appreciated Hello everyone,
I am working on Electric vehicle charging station location and plannimng problem. The idea is, that given any city map, we should be able to plan and size the Electric vehicle charging stations locations on a map. For the same, I want to be able to input the city map via google, OpenStreet etc, and my code should be able to read the road network details, like nodes, distance, width, unidirectional or bidirectional road etc.
To be honest, I have made zero progress in that. Using geoplot function, I can read the location, and I can also see the road layout, but Im not able to get anything more out of it.
I already read the document on roadprops,but it isnt useful. I figured its something to do with image processing.
Any help or an example or links would be appreciated image processing, maps, road MATLAB Answers — New Questions
Count unique vector in a sequence
Hello,
I have a sequence of 16 column vectors v_n with dimension 4×1: [ v_1 v_2 … v_16 ]
How can I count the number of different vectors in this sequence?
ThanksHello,
I have a sequence of 16 column vectors v_n with dimension 4×1: [ v_1 v_2 … v_16 ]
How can I count the number of different vectors in this sequence?
Thanks Hello,
I have a sequence of 16 column vectors v_n with dimension 4×1: [ v_1 v_2 … v_16 ]
How can I count the number of different vectors in this sequence?
Thanks unique MATLAB Answers — New Questions
No effect is observed when I try to use StartVector in eigs to improve numerical efficiency
I test the efficiency of using a good StartVector in eigs.
The code is quite simple.
First, I use eigs to figure out the eigenvector v1,
then I use this eigenvector v1 as the StartVector to run eigs again.
I expect that much less time might be needed now.
Nevertheless,
the time cost shows no improvement at all.
My code is as follows
———————————————————————-
format long
n = 3000;
A = rand(n,n);
A = A + A’;
tic
[v1,eta1]=eigs(@(vec)test_eigs(vec,A),n,1,’lm’,’Display’,0,’IsFunctionSymmetric’,0,’MaxIterations’,300);
toc
StartVector = v1;
tic
[v2,eta2]=eigs(@(vec)test_eigs(vec,A),n,1,’lm’,’Display’,0,’IsFunctionSymmetric’,0,’MaxIterations’,300,’StartVector’,StartVector);
toc
eta1
eta2
function vec1 = test_eigs(vec0,A)
vec1 = A * vec0;
end
————————————————————————————
The output is as follows
~~~~~~~~~~~~~~~~~~~~~~
Elapsed time is 0.069811 seconds.
Elapsed time is 0.066047 seconds.
eta1 =
3.000980119229400e+03
eta2 =
3.000980119229400e+03
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So my question is,
is there anything wrong in my understanding about StartVector in eigs?
Any suggestion or comment would be greatly appreciated.I test the efficiency of using a good StartVector in eigs.
The code is quite simple.
First, I use eigs to figure out the eigenvector v1,
then I use this eigenvector v1 as the StartVector to run eigs again.
I expect that much less time might be needed now.
Nevertheless,
the time cost shows no improvement at all.
My code is as follows
———————————————————————-
format long
n = 3000;
A = rand(n,n);
A = A + A’;
tic
[v1,eta1]=eigs(@(vec)test_eigs(vec,A),n,1,’lm’,’Display’,0,’IsFunctionSymmetric’,0,’MaxIterations’,300);
toc
StartVector = v1;
tic
[v2,eta2]=eigs(@(vec)test_eigs(vec,A),n,1,’lm’,’Display’,0,’IsFunctionSymmetric’,0,’MaxIterations’,300,’StartVector’,StartVector);
toc
eta1
eta2
function vec1 = test_eigs(vec0,A)
vec1 = A * vec0;
end
————————————————————————————
The output is as follows
~~~~~~~~~~~~~~~~~~~~~~
Elapsed time is 0.069811 seconds.
Elapsed time is 0.066047 seconds.
eta1 =
3.000980119229400e+03
eta2 =
3.000980119229400e+03
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So my question is,
is there anything wrong in my understanding about StartVector in eigs?
Any suggestion or comment would be greatly appreciated. I test the efficiency of using a good StartVector in eigs.
The code is quite simple.
First, I use eigs to figure out the eigenvector v1,
then I use this eigenvector v1 as the StartVector to run eigs again.
I expect that much less time might be needed now.
Nevertheless,
the time cost shows no improvement at all.
My code is as follows
———————————————————————-
format long
n = 3000;
A = rand(n,n);
A = A + A’;
tic
[v1,eta1]=eigs(@(vec)test_eigs(vec,A),n,1,’lm’,’Display’,0,’IsFunctionSymmetric’,0,’MaxIterations’,300);
toc
StartVector = v1;
tic
[v2,eta2]=eigs(@(vec)test_eigs(vec,A),n,1,’lm’,’Display’,0,’IsFunctionSymmetric’,0,’MaxIterations’,300,’StartVector’,StartVector);
toc
eta1
eta2
function vec1 = test_eigs(vec0,A)
vec1 = A * vec0;
end
————————————————————————————
The output is as follows
~~~~~~~~~~~~~~~~~~~~~~
Elapsed time is 0.069811 seconds.
Elapsed time is 0.066047 seconds.
eta1 =
3.000980119229400e+03
eta2 =
3.000980119229400e+03
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So my question is,
is there anything wrong in my understanding about StartVector in eigs?
Any suggestion or comment would be greatly appreciated. eigs MATLAB Answers — New Questions
Random numbers from array
Suppose I have the following array A=[2,1,5,6,20,55,6,9,100,1000,325,2301] which contains distinct numbers
I want to select for example four elements from the array randomly and then delete them from the original array. For example if the selected numbers were 20,2,9,325 so the new array R=[20,2,9,325] and A=the remaining elements.Suppose I have the following array A=[2,1,5,6,20,55,6,9,100,1000,325,2301] which contains distinct numbers
I want to select for example four elements from the array randomly and then delete them from the original array. For example if the selected numbers were 20,2,9,325 so the new array R=[20,2,9,325] and A=the remaining elements. Suppose I have the following array A=[2,1,5,6,20,55,6,9,100,1000,325,2301] which contains distinct numbers
I want to select for example four elements from the array randomly and then delete them from the original array. For example if the selected numbers were 20,2,9,325 so the new array R=[20,2,9,325] and A=the remaining elements. random num, random numbers; array operations MATLAB Answers — New Questions