Tag Archives: matlab
‘raytrace’ function for LEO satellites
Hello!
I’ve been trying to use the function ‘raytrace’ to model the multipath propagation of a signal with a LEO satellite as a transmitter. I have a doubt regarding the ‘raytrace’ function itself:
I’ve noticed that for big tx-rx distances you need to set pm.AngularSeparation (which is the Average number of degrees between launched rays) to the minimal value to actually get some multipath. Still, for the case of LEO (for example, using a satellite flying at 400 km of altitude), the minimum angular separation you can put (= 0.05) does not give a multipath channel, and ‘raytrace’ only shows the Line-of-Sight even for a very dense urban scenario.
This doesn’t happen if the tx-rx distance is lower (I’ve tried with a very low altitude satellite, for example), and in fact the lower the distance the more multipath you get. This seems to happen not because of the different geometry but because of the limitation in pm.AngularSeparation.
Is there any way to solve this?
Thank you in advance,
GuillemHello!
I’ve been trying to use the function ‘raytrace’ to model the multipath propagation of a signal with a LEO satellite as a transmitter. I have a doubt regarding the ‘raytrace’ function itself:
I’ve noticed that for big tx-rx distances you need to set pm.AngularSeparation (which is the Average number of degrees between launched rays) to the minimal value to actually get some multipath. Still, for the case of LEO (for example, using a satellite flying at 400 km of altitude), the minimum angular separation you can put (= 0.05) does not give a multipath channel, and ‘raytrace’ only shows the Line-of-Sight even for a very dense urban scenario.
This doesn’t happen if the tx-rx distance is lower (I’ve tried with a very low altitude satellite, for example), and in fact the lower the distance the more multipath you get. This seems to happen not because of the different geometry but because of the limitation in pm.AngularSeparation.
Is there any way to solve this?
Thank you in advance,
Guillem Hello!
I’ve been trying to use the function ‘raytrace’ to model the multipath propagation of a signal with a LEO satellite as a transmitter. I have a doubt regarding the ‘raytrace’ function itself:
I’ve noticed that for big tx-rx distances you need to set pm.AngularSeparation (which is the Average number of degrees between launched rays) to the minimal value to actually get some multipath. Still, for the case of LEO (for example, using a satellite flying at 400 km of altitude), the minimum angular separation you can put (= 0.05) does not give a multipath channel, and ‘raytrace’ only shows the Line-of-Sight even for a very dense urban scenario.
This doesn’t happen if the tx-rx distance is lower (I’ve tried with a very low altitude satellite, for example), and in fact the lower the distance the more multipath you get. This seems to happen not because of the different geometry but because of the limitation in pm.AngularSeparation.
Is there any way to solve this?
Thank you in advance,
Guillem raytrace, ray, tracing, leo, multipath, reflection, matlab, satellite MATLAB Answers — New Questions
Strange display of 2D axes within panel in new MATLAB version
I’m upgrading from R2017b to R2024a and I’m experiencing strange results in 2D plotting in the new version. See below for examples of the strange results. I’ll provide some information about the code and include some of my observations. I’m hoping someone will recognize what is happening here and know of a solution for it.
I’m making use of the GUI Layout Toolbox. I created two uipanel objects, one for 2D and one for 3D plots, that are children of a uix.VBox object. Each uipanel has only an axes object as child. At any given time, either a 2D or a 3D plot is displayed. To switch from a 3D to a 2D plot, I remove the parent of the 3D uipanel and set the vbox as parent of the 2D uipanel. When plotting something new, I first reset the axes handle and delete its children.
Unfortunately I cannot make a MWE. I tried, but I don’t get the strange results. The cause might therefore be due to the complex implementation of surrounding code, which I cannot fully describe or incorporate in a MWE. However, if you need more specific information, just ask and I can relay my observations.
My observations are the following:
As soon as I interact with the plot, such as zooming or panning, the plot is updated and properly displayed.
The result is consistent for the same content, i.e. if I display a simple sine for a specific interval, I get the same strange result every time. If I change to a cosine, or change the interval, I get a different result.
If I do not do the unparenting/reparenting of the uipanels every time, I do not get a strange result. However, I’d like to keep this because the behaviour is nice, or at least it used to be.
The resetting of the axes handle also seems to play a role. If I place a debugger at the resetting, I see that the plot is as expected, then if I do a step (the resetting) then the plot is messed up, but in a different way than without debugging. I included an example of this as the last image.
After resetting an axes:I’m upgrading from R2017b to R2024a and I’m experiencing strange results in 2D plotting in the new version. See below for examples of the strange results. I’ll provide some information about the code and include some of my observations. I’m hoping someone will recognize what is happening here and know of a solution for it.
I’m making use of the GUI Layout Toolbox. I created two uipanel objects, one for 2D and one for 3D plots, that are children of a uix.VBox object. Each uipanel has only an axes object as child. At any given time, either a 2D or a 3D plot is displayed. To switch from a 3D to a 2D plot, I remove the parent of the 3D uipanel and set the vbox as parent of the 2D uipanel. When plotting something new, I first reset the axes handle and delete its children.
Unfortunately I cannot make a MWE. I tried, but I don’t get the strange results. The cause might therefore be due to the complex implementation of surrounding code, which I cannot fully describe or incorporate in a MWE. However, if you need more specific information, just ask and I can relay my observations.
My observations are the following:
As soon as I interact with the plot, such as zooming or panning, the plot is updated and properly displayed.
The result is consistent for the same content, i.e. if I display a simple sine for a specific interval, I get the same strange result every time. If I change to a cosine, or change the interval, I get a different result.
If I do not do the unparenting/reparenting of the uipanels every time, I do not get a strange result. However, I’d like to keep this because the behaviour is nice, or at least it used to be.
The resetting of the axes handle also seems to play a role. If I place a debugger at the resetting, I see that the plot is as expected, then if I do a step (the resetting) then the plot is messed up, but in a different way than without debugging. I included an example of this as the last image.
After resetting an axes: I’m upgrading from R2017b to R2024a and I’m experiencing strange results in 2D plotting in the new version. See below for examples of the strange results. I’ll provide some information about the code and include some of my observations. I’m hoping someone will recognize what is happening here and know of a solution for it.
I’m making use of the GUI Layout Toolbox. I created two uipanel objects, one for 2D and one for 3D plots, that are children of a uix.VBox object. Each uipanel has only an axes object as child. At any given time, either a 2D or a 3D plot is displayed. To switch from a 3D to a 2D plot, I remove the parent of the 3D uipanel and set the vbox as parent of the 2D uipanel. When plotting something new, I first reset the axes handle and delete its children.
Unfortunately I cannot make a MWE. I tried, but I don’t get the strange results. The cause might therefore be due to the complex implementation of surrounding code, which I cannot fully describe or incorporate in a MWE. However, if you need more specific information, just ask and I can relay my observations.
My observations are the following:
As soon as I interact with the plot, such as zooming or panning, the plot is updated and properly displayed.
The result is consistent for the same content, i.e. if I display a simple sine for a specific interval, I get the same strange result every time. If I change to a cosine, or change the interval, I get a different result.
If I do not do the unparenting/reparenting of the uipanels every time, I do not get a strange result. However, I’d like to keep this because the behaviour is nice, or at least it used to be.
The resetting of the axes handle also seems to play a role. If I place a debugger at the resetting, I see that the plot is as expected, then if I do a step (the resetting) then the plot is messed up, but in a different way than without debugging. I included an example of this as the last image.
After resetting an axes: axes, plot, plotting, figure MATLAB Answers — New Questions
issues about app design
hello, i have a following problem, the edit area of the code view seems frozened, it only force me to edit within the area which marked with white background, when i want edit to other area, no any respond, how to handle this.hello, i have a following problem, the edit area of the code view seems frozened, it only force me to edit within the area which marked with white background, when i want edit to other area, no any respond, how to handle this. hello, i have a following problem, the edit area of the code view seems frozened, it only force me to edit within the area which marked with white background, when i want edit to other area, no any respond, how to handle this. matlb, appdesigner MATLAB Answers — New Questions
GARCH (conditional variance models) for panel data?
I would like to run an ARCH-GARCH model for my unbalanced panel data (100 panels and monthly data from 1950 to 2020).
I have Matlab2018 and the Econometric toolbox. I found examples to use GARCH with time-series, but not with longitudinal (panel) data.
Can this be done with Matlab? May you direct me to a help-file for it? I don’t find it…
Thank you so much.I would like to run an ARCH-GARCH model for my unbalanced panel data (100 panels and monthly data from 1950 to 2020).
I have Matlab2018 and the Econometric toolbox. I found examples to use GARCH with time-series, but not with longitudinal (panel) data.
Can this be done with Matlab? May you direct me to a help-file for it? I don’t find it…
Thank you so much. I would like to run an ARCH-GARCH model for my unbalanced panel data (100 panels and monthly data from 1950 to 2020).
I have Matlab2018 and the Econometric toolbox. I found examples to use GARCH with time-series, but not with longitudinal (panel) data.
Can this be done with Matlab? May you direct me to a help-file for it? I don’t find it…
Thank you so much. garch, panel data MATLAB Answers — New Questions
How to set PointDataTip properties and set DataTipStyle
I want to make an interactive plot to select portions of a line graph. I want to use the datatip functionality to display X and Y coordinates, but not on the point in the graph. Instead I want this to be in the bottom right hand corner or any other position thast does not overlap with the lineplot.
I noticed that moving the cursor over any plot can procuce a number of datatip windows that won’t go away. I Found the remedy by using
delete(findall(fh,’Type’,’hggroup’));
Now I want to move the position of the datatip to a unused corner of the graph (and not get a multityde of datatips whenever I click on the graph).
I tried
dcm=datacursormode(figurehandle);
set( dcm, ‘DisplayStyle’, ‘window’)
This does not make a difference in the datatip window appearance of behaviour.
I tried
dth = findall( figurehandle,’Type’,’hggroup’); get( dth )
and found a promising attribute DataTipStyle: MarkerAndTip
I then searched the Help window and the website for possible v alues of this property and what it does and I found nothing! I used to be able to right click on a datatip and chnage the display style to ‘window’. This would be what I want, but I woul like to set it explicitly in the script to create the interactive graph.
How can I do this? (I am stil runnoing R2019a because the installation of R2020 was a disaster giving me errors on all graphics and help just stopped).I want to make an interactive plot to select portions of a line graph. I want to use the datatip functionality to display X and Y coordinates, but not on the point in the graph. Instead I want this to be in the bottom right hand corner or any other position thast does not overlap with the lineplot.
I noticed that moving the cursor over any plot can procuce a number of datatip windows that won’t go away. I Found the remedy by using
delete(findall(fh,’Type’,’hggroup’));
Now I want to move the position of the datatip to a unused corner of the graph (and not get a multityde of datatips whenever I click on the graph).
I tried
dcm=datacursormode(figurehandle);
set( dcm, ‘DisplayStyle’, ‘window’)
This does not make a difference in the datatip window appearance of behaviour.
I tried
dth = findall( figurehandle,’Type’,’hggroup’); get( dth )
and found a promising attribute DataTipStyle: MarkerAndTip
I then searched the Help window and the website for possible v alues of this property and what it does and I found nothing! I used to be able to right click on a datatip and chnage the display style to ‘window’. This would be what I want, but I woul like to set it explicitly in the script to create the interactive graph.
How can I do this? (I am stil runnoing R2019a because the installation of R2020 was a disaster giving me errors on all graphics and help just stopped). I want to make an interactive plot to select portions of a line graph. I want to use the datatip functionality to display X and Y coordinates, but not on the point in the graph. Instead I want this to be in the bottom right hand corner or any other position thast does not overlap with the lineplot.
I noticed that moving the cursor over any plot can procuce a number of datatip windows that won’t go away. I Found the remedy by using
delete(findall(fh,’Type’,’hggroup’));
Now I want to move the position of the datatip to a unused corner of the graph (and not get a multityde of datatips whenever I click on the graph).
I tried
dcm=datacursormode(figurehandle);
set( dcm, ‘DisplayStyle’, ‘window’)
This does not make a difference in the datatip window appearance of behaviour.
I tried
dth = findall( figurehandle,’Type’,’hggroup’); get( dth )
and found a promising attribute DataTipStyle: MarkerAndTip
I then searched the Help window and the website for possible v alues of this property and what it does and I found nothing! I used to be able to right click on a datatip and chnage the display style to ‘window’. This would be what I want, but I woul like to set it explicitly in the script to create the interactive graph.
How can I do this? (I am stil runnoing R2019a because the installation of R2020 was a disaster giving me errors on all graphics and help just stopped). datatip properties MATLAB Answers — New Questions
Why am I getting the following error while trying to generate an S-Function from a submodel?
It appears to me that the compiler fails to generate the following file. I unfortunately do not understand the underlying issue.It appears to me that the compiler fails to generate the following file. I unfortunately do not understand the underlying issue. It appears to me that the compiler fails to generate the following file. I unfortunately do not understand the underlying issue. code generation MATLAB Answers — New Questions
Getting Frequency and amplitude from input velocity and output velocity
I am interested on getting the frequency responce (bode plot) from a physical system (complex spring-mass-damper system). Essentially my goal is to gather matrixes of velocity vs time of the input and the velocity vs time of the output and then I want to generate the frequency vs time graph of and the amplitude vs time graph which can be used to create a bode plot.
I am familiar with the FFT function which I use frequently; however, the input frequency would not be constant in this data set and the frequency may change over a range of 0-100 Hz. I thought about applying the FFT function to small sets of the data (say split the data into 100 sections and determine the average frequency and amplitude of that section) to estimate it.
I believe you can fit a transfer function to the data based on the input and output data in the time domain but I have not sucessfully done that yet. Furthmore, I want to descretly do this to pick up things in the physical system which do not always follow the ideal bode plot (for example if there is another point of resonance in the system from poor construction or something)
I can also "brute force it" by writing a function to determine the data I am looking for based on the period between peaks and the amplitude of the peaks however I do not like this method very much.
I am hoping that there is a function in matlab which is able to continiously determine the freqnency and amplitude of a data set and plot it.
Here is a mathmatical example of way I am trying to do but I want to do it discretly with data from accelerometers:
Here is the input signal: v = sin(2*pi*t^2) where t is time. In this case, the frequency plot would be f = t, or constlantly increasing at a constant rate. What I am trying to get is essently "f = t" based on a descrete set of data of sin(2*pi*t^2). Of course the rate of change of freqnecy would not be constant and may be irratic.
Thanks and let me know if you need any more information!I am interested on getting the frequency responce (bode plot) from a physical system (complex spring-mass-damper system). Essentially my goal is to gather matrixes of velocity vs time of the input and the velocity vs time of the output and then I want to generate the frequency vs time graph of and the amplitude vs time graph which can be used to create a bode plot.
I am familiar with the FFT function which I use frequently; however, the input frequency would not be constant in this data set and the frequency may change over a range of 0-100 Hz. I thought about applying the FFT function to small sets of the data (say split the data into 100 sections and determine the average frequency and amplitude of that section) to estimate it.
I believe you can fit a transfer function to the data based on the input and output data in the time domain but I have not sucessfully done that yet. Furthmore, I want to descretly do this to pick up things in the physical system which do not always follow the ideal bode plot (for example if there is another point of resonance in the system from poor construction or something)
I can also "brute force it" by writing a function to determine the data I am looking for based on the period between peaks and the amplitude of the peaks however I do not like this method very much.
I am hoping that there is a function in matlab which is able to continiously determine the freqnency and amplitude of a data set and plot it.
Here is a mathmatical example of way I am trying to do but I want to do it discretly with data from accelerometers:
Here is the input signal: v = sin(2*pi*t^2) where t is time. In this case, the frequency plot would be f = t, or constlantly increasing at a constant rate. What I am trying to get is essently "f = t" based on a descrete set of data of sin(2*pi*t^2). Of course the rate of change of freqnecy would not be constant and may be irratic.
Thanks and let me know if you need any more information! I am interested on getting the frequency responce (bode plot) from a physical system (complex spring-mass-damper system). Essentially my goal is to gather matrixes of velocity vs time of the input and the velocity vs time of the output and then I want to generate the frequency vs time graph of and the amplitude vs time graph which can be used to create a bode plot.
I am familiar with the FFT function which I use frequently; however, the input frequency would not be constant in this data set and the frequency may change over a range of 0-100 Hz. I thought about applying the FFT function to small sets of the data (say split the data into 100 sections and determine the average frequency and amplitude of that section) to estimate it.
I believe you can fit a transfer function to the data based on the input and output data in the time domain but I have not sucessfully done that yet. Furthmore, I want to descretly do this to pick up things in the physical system which do not always follow the ideal bode plot (for example if there is another point of resonance in the system from poor construction or something)
I can also "brute force it" by writing a function to determine the data I am looking for based on the period between peaks and the amplitude of the peaks however I do not like this method very much.
I am hoping that there is a function in matlab which is able to continiously determine the freqnency and amplitude of a data set and plot it.
Here is a mathmatical example of way I am trying to do but I want to do it discretly with data from accelerometers:
Here is the input signal: v = sin(2*pi*t^2) where t is time. In this case, the frequency plot would be f = t, or constlantly increasing at a constant rate. What I am trying to get is essently "f = t" based on a descrete set of data of sin(2*pi*t^2). Of course the rate of change of freqnecy would not be constant and may be irratic.
Thanks and let me know if you need any more information! varying freqnecy, fft, descrete data MATLAB Answers — New Questions
bvp4c problem with fewer boundary value than variable
In my problem i have 11 varaible of y but only 9 boundary conditions what can i do here? Another additional problem is equation 3 and 4 both contain θ₂ and φ₂ how do i write y9′ and y11′ for them? in my code i took one of the constant as zero. I also tried taking some other boundary condition (f” and f”)=0 to solve it but solution is unstable.
clc;clear;
work=0;
nnn=0;
aa=.5;
bb=10;
cc=30;
name=’B’;
sol=main(aa,bb,cc,name);
function sol1=main(aa,bb,cc,name)
sol=jobs(aa);
% sol1=jobs(bb);
% sol2=jobs(cc);
figure(‘Name’,name)
hold on
subplot(2,2,1)
plotting(2,"Pimary Velocity(F’)",sol,cc)%,sol1,sol2,aa,bb,
subplot(2,2,2)
plotting(5,"Secondary Velocity(G)",sol,cc)
subplot(2,2,3)
plotting(8,"Concentation 1 (Xi)",sol,cc)
subplot(2,2,4)
plotting(10,"Temparature(Theta)",sol,cc)
xlim([0 3.2])
hold off
sol1=sol;
end
function plotting(line,titles,sol,aa)%,sol1,sol2,aa,bb,cc
hold on
grid on
a=plot(sol.x,sol.y(line,:),’r’);
% b=plot(sol1.x,sol1.y(line,:),’g’);
% c=plot(sol2.x,sol2.y(line,:),’b’);
xline(0);
yline(0);
% legend([a; b; c],{num2str(aa); num2str(bb) ;num2str(cc)})
title(titles)
hold off
end
function out=jobs(VARABLE)
RC=.1;FW=.5;
M=0.5;BI =1.5;BE = 1.5;AE = 1+BE*BI;R=0.6;GR=8;
GM=6;PR=.71;EC=0.3; S = 0.5;S0 = 1;K=.5;SC=.6;
D = 2;GAMMA = 1;EPS = .8;ST = 5;STT= .5;
NEBLA = 2;LAMB=.8;short=AE^2+BE^2;XX=1+D;W1=1.5;CP=1.5;DF=.8;n=.01;
sol1 = bvpinit(linspace(0,1,500),[1 1 1 1 1 0 0 0 0 0 1]);
sol = bvp4c(@bvp2d, @bc2d, sol1);
sol1=bvpinit(sol,[0 10]);
sol = bvp4c(@bvp2d, @bc2d, sol1);
% sol1=bvpinit(sol,[0 2]);
% sol = bvp4c(@bvp2d, @bc2d, sol1);
out=sol;
function yvector =bvp2d(~,y)
% if y(1)==0
% y(1)=0.01;
% end
yy4=(-y(4)-y(3)*y(1)-W1*(2*y(4)*y(2)+y(3)^2)+K*y(2)+(M/(AE^2+BE^2))*…
(AE*y(2)+BE*y(5))+R*y(5)-GAMMA*y(2)^2+GM*y(10)+GR*y(8))/(-W1*y(1));
yy7=(-y(1)*y(6)-y(7)-2*W1*y(2)*y(7)+K*y(5)-(M/short)*(AE*y(5)+…
BE*y(2))+R*y(2)+GAMMA*y(5)^2)/(W1*y(1));
% yy11=(y(1)*y(9)-y(1)*y(11)*DF*SC+(EC/CP)*(y(3)^2+y(6)^2)+…
% (M*EC)/short*(y(2)^2+y(5)^2)+RC-DF*SC*(y(10)+1))/(1/PR-DF*S0*SC);
% yy9=(y(1)*y(9)+EC/CP*(y(3)^2+y(6)^2)+M*EC/short*(y(2)^2+y(5)^2))/(-PR);
% yy11=(-y(1)*y(11)-S0*yy9-RC*y(10))*SC;
yy11=(-y(1)*y(11)+RC*y(10))*SC;
yy9=(y(1)*y(9)+EC/CP*(y(3)^2+y(6)^2)+M*EC/short*(y(2)^2+y(5)^2)+DF*yy11)/(-PR);
yvector=[y(2);y(3);y(4);yy4;y(6);y(7);yy7;y(9);yy9;y(11);yy11];
end
function residual=bc2d(y0,yinf)
residual=[y0(1)-FW;y0(2)-1;y0(5);y0(8)-1;y0(10)-1;yinf(3);yinf(4);
yinf(2);yinf(5);yinf(8);yinf(10)];
end
endIn my problem i have 11 varaible of y but only 9 boundary conditions what can i do here? Another additional problem is equation 3 and 4 both contain θ₂ and φ₂ how do i write y9′ and y11′ for them? in my code i took one of the constant as zero. I also tried taking some other boundary condition (f” and f”)=0 to solve it but solution is unstable.
clc;clear;
work=0;
nnn=0;
aa=.5;
bb=10;
cc=30;
name=’B’;
sol=main(aa,bb,cc,name);
function sol1=main(aa,bb,cc,name)
sol=jobs(aa);
% sol1=jobs(bb);
% sol2=jobs(cc);
figure(‘Name’,name)
hold on
subplot(2,2,1)
plotting(2,"Pimary Velocity(F’)",sol,cc)%,sol1,sol2,aa,bb,
subplot(2,2,2)
plotting(5,"Secondary Velocity(G)",sol,cc)
subplot(2,2,3)
plotting(8,"Concentation 1 (Xi)",sol,cc)
subplot(2,2,4)
plotting(10,"Temparature(Theta)",sol,cc)
xlim([0 3.2])
hold off
sol1=sol;
end
function plotting(line,titles,sol,aa)%,sol1,sol2,aa,bb,cc
hold on
grid on
a=plot(sol.x,sol.y(line,:),’r’);
% b=plot(sol1.x,sol1.y(line,:),’g’);
% c=plot(sol2.x,sol2.y(line,:),’b’);
xline(0);
yline(0);
% legend([a; b; c],{num2str(aa); num2str(bb) ;num2str(cc)})
title(titles)
hold off
end
function out=jobs(VARABLE)
RC=.1;FW=.5;
M=0.5;BI =1.5;BE = 1.5;AE = 1+BE*BI;R=0.6;GR=8;
GM=6;PR=.71;EC=0.3; S = 0.5;S0 = 1;K=.5;SC=.6;
D = 2;GAMMA = 1;EPS = .8;ST = 5;STT= .5;
NEBLA = 2;LAMB=.8;short=AE^2+BE^2;XX=1+D;W1=1.5;CP=1.5;DF=.8;n=.01;
sol1 = bvpinit(linspace(0,1,500),[1 1 1 1 1 0 0 0 0 0 1]);
sol = bvp4c(@bvp2d, @bc2d, sol1);
sol1=bvpinit(sol,[0 10]);
sol = bvp4c(@bvp2d, @bc2d, sol1);
% sol1=bvpinit(sol,[0 2]);
% sol = bvp4c(@bvp2d, @bc2d, sol1);
out=sol;
function yvector =bvp2d(~,y)
% if y(1)==0
% y(1)=0.01;
% end
yy4=(-y(4)-y(3)*y(1)-W1*(2*y(4)*y(2)+y(3)^2)+K*y(2)+(M/(AE^2+BE^2))*…
(AE*y(2)+BE*y(5))+R*y(5)-GAMMA*y(2)^2+GM*y(10)+GR*y(8))/(-W1*y(1));
yy7=(-y(1)*y(6)-y(7)-2*W1*y(2)*y(7)+K*y(5)-(M/short)*(AE*y(5)+…
BE*y(2))+R*y(2)+GAMMA*y(5)^2)/(W1*y(1));
% yy11=(y(1)*y(9)-y(1)*y(11)*DF*SC+(EC/CP)*(y(3)^2+y(6)^2)+…
% (M*EC)/short*(y(2)^2+y(5)^2)+RC-DF*SC*(y(10)+1))/(1/PR-DF*S0*SC);
% yy9=(y(1)*y(9)+EC/CP*(y(3)^2+y(6)^2)+M*EC/short*(y(2)^2+y(5)^2))/(-PR);
% yy11=(-y(1)*y(11)-S0*yy9-RC*y(10))*SC;
yy11=(-y(1)*y(11)+RC*y(10))*SC;
yy9=(y(1)*y(9)+EC/CP*(y(3)^2+y(6)^2)+M*EC/short*(y(2)^2+y(5)^2)+DF*yy11)/(-PR);
yvector=[y(2);y(3);y(4);yy4;y(6);y(7);yy7;y(9);yy9;y(11);yy11];
end
function residual=bc2d(y0,yinf)
residual=[y0(1)-FW;y0(2)-1;y0(5);y0(8)-1;y0(10)-1;yinf(3);yinf(4);
yinf(2);yinf(5);yinf(8);yinf(10)];
end
end In my problem i have 11 varaible of y but only 9 boundary conditions what can i do here? Another additional problem is equation 3 and 4 both contain θ₂ and φ₂ how do i write y9′ and y11′ for them? in my code i took one of the constant as zero. I also tried taking some other boundary condition (f” and f”)=0 to solve it but solution is unstable.
clc;clear;
work=0;
nnn=0;
aa=.5;
bb=10;
cc=30;
name=’B’;
sol=main(aa,bb,cc,name);
function sol1=main(aa,bb,cc,name)
sol=jobs(aa);
% sol1=jobs(bb);
% sol2=jobs(cc);
figure(‘Name’,name)
hold on
subplot(2,2,1)
plotting(2,"Pimary Velocity(F’)",sol,cc)%,sol1,sol2,aa,bb,
subplot(2,2,2)
plotting(5,"Secondary Velocity(G)",sol,cc)
subplot(2,2,3)
plotting(8,"Concentation 1 (Xi)",sol,cc)
subplot(2,2,4)
plotting(10,"Temparature(Theta)",sol,cc)
xlim([0 3.2])
hold off
sol1=sol;
end
function plotting(line,titles,sol,aa)%,sol1,sol2,aa,bb,cc
hold on
grid on
a=plot(sol.x,sol.y(line,:),’r’);
% b=plot(sol1.x,sol1.y(line,:),’g’);
% c=plot(sol2.x,sol2.y(line,:),’b’);
xline(0);
yline(0);
% legend([a; b; c],{num2str(aa); num2str(bb) ;num2str(cc)})
title(titles)
hold off
end
function out=jobs(VARABLE)
RC=.1;FW=.5;
M=0.5;BI =1.5;BE = 1.5;AE = 1+BE*BI;R=0.6;GR=8;
GM=6;PR=.71;EC=0.3; S = 0.5;S0 = 1;K=.5;SC=.6;
D = 2;GAMMA = 1;EPS = .8;ST = 5;STT= .5;
NEBLA = 2;LAMB=.8;short=AE^2+BE^2;XX=1+D;W1=1.5;CP=1.5;DF=.8;n=.01;
sol1 = bvpinit(linspace(0,1,500),[1 1 1 1 1 0 0 0 0 0 1]);
sol = bvp4c(@bvp2d, @bc2d, sol1);
sol1=bvpinit(sol,[0 10]);
sol = bvp4c(@bvp2d, @bc2d, sol1);
% sol1=bvpinit(sol,[0 2]);
% sol = bvp4c(@bvp2d, @bc2d, sol1);
out=sol;
function yvector =bvp2d(~,y)
% if y(1)==0
% y(1)=0.01;
% end
yy4=(-y(4)-y(3)*y(1)-W1*(2*y(4)*y(2)+y(3)^2)+K*y(2)+(M/(AE^2+BE^2))*…
(AE*y(2)+BE*y(5))+R*y(5)-GAMMA*y(2)^2+GM*y(10)+GR*y(8))/(-W1*y(1));
yy7=(-y(1)*y(6)-y(7)-2*W1*y(2)*y(7)+K*y(5)-(M/short)*(AE*y(5)+…
BE*y(2))+R*y(2)+GAMMA*y(5)^2)/(W1*y(1));
% yy11=(y(1)*y(9)-y(1)*y(11)*DF*SC+(EC/CP)*(y(3)^2+y(6)^2)+…
% (M*EC)/short*(y(2)^2+y(5)^2)+RC-DF*SC*(y(10)+1))/(1/PR-DF*S0*SC);
% yy9=(y(1)*y(9)+EC/CP*(y(3)^2+y(6)^2)+M*EC/short*(y(2)^2+y(5)^2))/(-PR);
% yy11=(-y(1)*y(11)-S0*yy9-RC*y(10))*SC;
yy11=(-y(1)*y(11)+RC*y(10))*SC;
yy9=(y(1)*y(9)+EC/CP*(y(3)^2+y(6)^2)+M*EC/short*(y(2)^2+y(5)^2)+DF*yy11)/(-PR);
yvector=[y(2);y(3);y(4);yy4;y(6);y(7);yy7;y(9);yy9;y(11);yy11];
end
function residual=bc2d(y0,yinf)
residual=[y0(1)-FW;y0(2)-1;y0(5);y0(8)-1;y0(10)-1;yinf(3);yinf(4);
yinf(2);yinf(5);yinf(8);yinf(10)];
end
end bvp4c, steady fluid MATLAB Answers — New Questions
How to analyze the frequency of luminosity change of image sequence?
Hi there,
I got a set of images with different luminosity distributions, how to analyze the frequency of the luminosity change in time domain? Do we need to extract the pixel one by one to get the time series of luminosities? Besides, can we use 3D graph to show the results, with X and Y represent the location, and Z show the frequency value? Thank you very much.
I attached some images for practicing. Any help will be highly appreciated.Hi there,
I got a set of images with different luminosity distributions, how to analyze the frequency of the luminosity change in time domain? Do we need to extract the pixel one by one to get the time series of luminosities? Besides, can we use 3D graph to show the results, with X and Y represent the location, and Z show the frequency value? Thank you very much.
I attached some images for practicing. Any help will be highly appreciated. Hi there,
I got a set of images with different luminosity distributions, how to analyze the frequency of the luminosity change in time domain? Do we need to extract the pixel one by one to get the time series of luminosities? Besides, can we use 3D graph to show the results, with X and Y represent the location, and Z show the frequency value? Thank you very much.
I attached some images for practicing. Any help will be highly appreciated. image processing, 2d frequency analysis MATLAB Answers — New Questions
Embedded coder for simulink model does not link libraries in the right order
Hello,
I am trying to generate an executable using a simple SImulink project using Embedded Coder for C code.
This model is calling some specific function defined into an external library let us call it libOne.a
When Embedded Coder is about to link the C code generated from my Simulink model, the order of the libraries to use is the following one:
gcc -o someExecutable libOne.a rtwshared.lib
With this wrong order, the link failed because a function called into rtwshared.lib which is defined into libOne.a is not found (which is normal error with this library order)
the right command to link should be the following:
gcc -o rtwshared.lib libOne.a
How can I configure my very very simple Simulink model so that libraires ar linked in the right order and not in the wrong reverse order ?
Thank you in advance for your help.
best regads.Hello,
I am trying to generate an executable using a simple SImulink project using Embedded Coder for C code.
This model is calling some specific function defined into an external library let us call it libOne.a
When Embedded Coder is about to link the C code generated from my Simulink model, the order of the libraries to use is the following one:
gcc -o someExecutable libOne.a rtwshared.lib
With this wrong order, the link failed because a function called into rtwshared.lib which is defined into libOne.a is not found (which is normal error with this library order)
the right command to link should be the following:
gcc -o rtwshared.lib libOne.a
How can I configure my very very simple Simulink model so that libraires ar linked in the right order and not in the wrong reverse order ?
Thank you in advance for your help.
best regads. Hello,
I am trying to generate an executable using a simple SImulink project using Embedded Coder for C code.
This model is calling some specific function defined into an external library let us call it libOne.a
When Embedded Coder is about to link the C code generated from my Simulink model, the order of the libraries to use is the following one:
gcc -o someExecutable libOne.a rtwshared.lib
With this wrong order, the link failed because a function called into rtwshared.lib which is defined into libOne.a is not found (which is normal error with this library order)
the right command to link should be the following:
gcc -o rtwshared.lib libOne.a
How can I configure my very very simple Simulink model so that libraires ar linked in the right order and not in the wrong reverse order ?
Thank you in advance for your help.
best regads. embedded coder, simulink MATLAB Answers — New Questions
why file did not appear
Post Content Post Content thermal image processing MATLAB Answers — New Questions
How to code SIR system to see state after time of each individual?
Let we have N individiviaduals in a system, out of which a random number of infividual are infected (say N/10) and the rest are susceptible. each suscptible can become infected with probability p_i and each infected can recover with probablity q_i. How can we code it to see the state after time t.
e.g let initially S=[0 1 1 1 1 1 1 1 1 1], I=[1 0 0 0 0 0 0 0 0 0] and R=[ 0 0 0 0 0 0 0 0 0 0].
I try to use Gillespie algorithm but its not working.Let we have N individiviaduals in a system, out of which a random number of infividual are infected (say N/10) and the rest are susceptible. each suscptible can become infected with probability p_i and each infected can recover with probablity q_i. How can we code it to see the state after time t.
e.g let initially S=[0 1 1 1 1 1 1 1 1 1], I=[1 0 0 0 0 0 0 0 0 0] and R=[ 0 0 0 0 0 0 0 0 0 0].
I try to use Gillespie algorithm but its not working. Let we have N individiviaduals in a system, out of which a random number of infividual are infected (say N/10) and the rest are susceptible. each suscptible can become infected with probability p_i and each infected can recover with probablity q_i. How can we code it to see the state after time t.
e.g let initially S=[0 1 1 1 1 1 1 1 1 1], I=[1 0 0 0 0 0 0 0 0 0] and R=[ 0 0 0 0 0 0 0 0 0 0].
I try to use Gillespie algorithm but its not working. sir model, code, gilliespie, stochastics MATLAB Answers — New Questions
Reproducibility convolutional neural network training with gpu
Hello,
I am training a CNN using my local GPU (to speed up training) for classification problems and would like to try different parameterizations. To avoid the variability effects due to different data and/or weights initialization I am resetting the random seeds each time before training:
% Initialize random seed (thus same dataset on same architecture would lead
% to predictable result)
rng(0);
%parallel.gpu.rng(0, ‘CombRecursive’);
randStream = parallel.gpu.RandStream(‘CombRecursive’, ‘Seed’, 0);
parallel.gpu.RandStream.setGlobalStream(randStream);
% Train the CNN network
net = trainNetwork(TR.data,TR.reference,layers,options);
The problem is that when using GPU I am getting different results on each execution, even if initializing the GPU random seed to the same value. Strange thing is if I use CPU instead, then I do get the reproducible results.
I am doing something wrong with GPU random seed initialization? Is there a know problem for this situation or something I am missing?
Thanks beforehand.
PS: I am using Matlab R2017bHello,
I am training a CNN using my local GPU (to speed up training) for classification problems and would like to try different parameterizations. To avoid the variability effects due to different data and/or weights initialization I am resetting the random seeds each time before training:
% Initialize random seed (thus same dataset on same architecture would lead
% to predictable result)
rng(0);
%parallel.gpu.rng(0, ‘CombRecursive’);
randStream = parallel.gpu.RandStream(‘CombRecursive’, ‘Seed’, 0);
parallel.gpu.RandStream.setGlobalStream(randStream);
% Train the CNN network
net = trainNetwork(TR.data,TR.reference,layers,options);
The problem is that when using GPU I am getting different results on each execution, even if initializing the GPU random seed to the same value. Strange thing is if I use CPU instead, then I do get the reproducible results.
I am doing something wrong with GPU random seed initialization? Is there a know problem for this situation or something I am missing?
Thanks beforehand.
PS: I am using Matlab R2017b Hello,
I am training a CNN using my local GPU (to speed up training) for classification problems and would like to try different parameterizations. To avoid the variability effects due to different data and/or weights initialization I am resetting the random seeds each time before training:
% Initialize random seed (thus same dataset on same architecture would lead
% to predictable result)
rng(0);
%parallel.gpu.rng(0, ‘CombRecursive’);
randStream = parallel.gpu.RandStream(‘CombRecursive’, ‘Seed’, 0);
parallel.gpu.RandStream.setGlobalStream(randStream);
% Train the CNN network
net = trainNetwork(TR.data,TR.reference,layers,options);
The problem is that when using GPU I am getting different results on each execution, even if initializing the GPU random seed to the same value. Strange thing is if I use CPU instead, then I do get the reproducible results.
I am doing something wrong with GPU random seed initialization? Is there a know problem for this situation or something I am missing?
Thanks beforehand.
PS: I am using Matlab R2017b cnn, gpu, reproducibility MATLAB Answers — New Questions
Simulink keyboard shortcut for “save as”
what is the "Save as" keyboard shortcut in Simulink, or how can I assign it as a new shortcut key?
In Matlab’s Preferences, you can assign that but can’t for Simulink!
Thankswhat is the "Save as" keyboard shortcut in Simulink, or how can I assign it as a new shortcut key?
In Matlab’s Preferences, you can assign that but can’t for Simulink!
Thanks what is the "Save as" keyboard shortcut in Simulink, or how can I assign it as a new shortcut key?
In Matlab’s Preferences, you can assign that but can’t for Simulink!
Thanks simulink MATLAB Answers — New Questions
Passband ripple and stopband attenuation
Hello ,
I want to know how to select the passband ripple for my signal , does it depend on specific standered to be selected ? does it hava anything to do with the fft ?Hello ,
I want to know how to select the passband ripple for my signal , does it depend on specific standered to be selected ? does it hava anything to do with the fft ? Hello ,
I want to know how to select the passband ripple for my signal , does it depend on specific standered to be selected ? does it hava anything to do with the fft ? passband ripple MATLAB Answers — New Questions
Plotting the preview from webcam in the matlab app window in real time.
I am developing an app which requires the real time video being captured from a webcam to be displayed. the preview function does this but it comes as a popup. I dont want a separat popup but i want this figure to appear in my matalb app window inside a panel/ uiaxes. Is it possibel to do so? the below figure shows the popup as "Figure 2" but i want this video to appear in the Panel6. Can someone please help me?I am developing an app which requires the real time video being captured from a webcam to be displayed. the preview function does this but it comes as a popup. I dont want a separat popup but i want this figure to appear in my matalb app window inside a panel/ uiaxes. Is it possibel to do so? the below figure shows the popup as "Figure 2" but i want this video to appear in the Panel6. Can someone please help me? I am developing an app which requires the real time video being captured from a webcam to be displayed. the preview function does this but it comes as a popup. I dont want a separat popup but i want this figure to appear in my matalb app window inside a panel/ uiaxes. Is it possibel to do so? the below figure shows the popup as "Figure 2" but i want this video to appear in the Panel6. Can someone please help me? image acquisition, digital image processing, webcam, matalb app designer MATLAB Answers — New Questions
Manage image dataset with .csv file
Hello everyone, I have been working on an ssd object detector and i have the DeepFruits dataset which comes with about 16k images to train but the labels are all on a .csv file. I have created a datastore for the image side of the training set but when it comes to the labels side I’m not sure where to begin. I have already imported the .csv file and i have a struct with two fields. Below i will include what those two fields look like. I was planning on using the boxLabelDatastore but I’m not sure if i even can using that file. Both of these datastore files were going to be then combined and used with trainSSDObjectDetector. Any help is appreciated. Thank you.Hello everyone, I have been working on an ssd object detector and i have the DeepFruits dataset which comes with about 16k images to train but the labels are all on a .csv file. I have created a datastore for the image side of the training set but when it comes to the labels side I’m not sure where to begin. I have already imported the .csv file and i have a struct with two fields. Below i will include what those two fields look like. I was planning on using the boxLabelDatastore but I’m not sure if i even can using that file. Both of these datastore files were going to be then combined and used with trainSSDObjectDetector. Any help is appreciated. Thank you. Hello everyone, I have been working on an ssd object detector and i have the DeepFruits dataset which comes with about 16k images to train but the labels are all on a .csv file. I have created a datastore for the image side of the training set but when it comes to the labels side I’m not sure where to begin. I have already imported the .csv file and i have a struct with two fields. Below i will include what those two fields look like. I was planning on using the boxLabelDatastore but I’m not sure if i even can using that file. Both of these datastore files were going to be then combined and used with trainSSDObjectDetector. Any help is appreciated. Thank you. deep learning, object detection, dataset MATLAB Answers — New Questions
Image segmentation for transparent objects in a image
<</matlabcentral/answers/uploaded_files/1702901/IMG_20240524_043950.jpg>>
Hi,I am just wondering is there any way that I can use image segmentation to show all the objects in this image whit the same color cz I tried converting it to a binary image and I got the background whit a white color and the objects whit dark color but there are some objects whit gray or transparent color that disappeared when I tried to set to a binary image cz what i am trying to do is to calculate the area of the objects in this image and there is some objects that have the same color of the background aka gray or transparent and when I tried to set it to a binary image they just disappeared whit background color except for objects whit deep colors . Cz I already tried Calculating the area of all the objects but the area of the gray objects Is missing<</matlabcentral/answers/uploaded_files/1702901/IMG_20240524_043950.jpg>>
Hi,I am just wondering is there any way that I can use image segmentation to show all the objects in this image whit the same color cz I tried converting it to a binary image and I got the background whit a white color and the objects whit dark color but there are some objects whit gray or transparent color that disappeared when I tried to set to a binary image cz what i am trying to do is to calculate the area of the objects in this image and there is some objects that have the same color of the background aka gray or transparent and when I tried to set it to a binary image they just disappeared whit background color except for objects whit deep colors . Cz I already tried Calculating the area of all the objects but the area of the gray objects Is missing <</matlabcentral/answers/uploaded_files/1702901/IMG_20240524_043950.jpg>>
Hi,I am just wondering is there any way that I can use image segmentation to show all the objects in this image whit the same color cz I tried converting it to a binary image and I got the background whit a white color and the objects whit dark color but there are some objects whit gray or transparent color that disappeared when I tried to set to a binary image cz what i am trying to do is to calculate the area of the objects in this image and there is some objects that have the same color of the background aka gray or transparent and when I tried to set it to a binary image they just disappeared whit background color except for objects whit deep colors . Cz I already tried Calculating the area of all the objects but the area of the gray objects Is missing image segmentation MATLAB Answers — New Questions
Bisection and Fixed Point İterations: Function input
Can you give a hint me to insert a given function. For example I want to ask user to ‘give a function’, it can be any function. And then I am going to ask ‘which method are you going to use?’. According to answer, user will give upper limit, lower limit, and error for the bisection method. And fixed point, max iteration number and error for the iterations method.Can you give a hint me to insert a given function. For example I want to ask user to ‘give a function’, it can be any function. And then I am going to ask ‘which method are you going to use?’. According to answer, user will give upper limit, lower limit, and error for the bisection method. And fixed point, max iteration number and error for the iterations method. Can you give a hint me to insert a given function. For example I want to ask user to ‘give a function’, it can be any function. And then I am going to ask ‘which method are you going to use?’. According to answer, user will give upper limit, lower limit, and error for the bisection method. And fixed point, max iteration number and error for the iterations method. bisection, iteration, numerical analysis, numerical methods, function input MATLAB Answers — New Questions
Optimize size and location of distributed wind generation using NSGA II
Hi Everyone,
I’m trying to optimize the distributed wind generation in a radial distribution system using NSGA II algorithm.
I have voltage profile of the system, system loss, voltage unbalance factor, and saving as the objective function of the system. Each of the system objectives are bound with constraints and I’m using penalty factor approach to handle the constraints.
I have done coding the objective functions. But I do not understand how the NSGA II will identify and change the value of the original input data file of the radial power system bus data. So that NSGA II will test different combination of wind generation size and location to optimize the system.
Can some one help me to code or understand the logic behind inputting objective functions in to NSGA II code.
Do I have to do the power flow inside the objective function since it have to run each iteration to calculate the objective function for different combination of distributed generation size? I can post what I have done up to now if some one would like to help me understand what I have done wrong in my code. But I will omit posting messy lengthy code at the moment.
Any type of help or push toward the right direction would be appreciated.
Thank youHi Everyone,
I’m trying to optimize the distributed wind generation in a radial distribution system using NSGA II algorithm.
I have voltage profile of the system, system loss, voltage unbalance factor, and saving as the objective function of the system. Each of the system objectives are bound with constraints and I’m using penalty factor approach to handle the constraints.
I have done coding the objective functions. But I do not understand how the NSGA II will identify and change the value of the original input data file of the radial power system bus data. So that NSGA II will test different combination of wind generation size and location to optimize the system.
Can some one help me to code or understand the logic behind inputting objective functions in to NSGA II code.
Do I have to do the power flow inside the objective function since it have to run each iteration to calculate the objective function for different combination of distributed generation size? I can post what I have done up to now if some one would like to help me understand what I have done wrong in my code. But I will omit posting messy lengthy code at the moment.
Any type of help or push toward the right direction would be appreciated.
Thank you Hi Everyone,
I’m trying to optimize the distributed wind generation in a radial distribution system using NSGA II algorithm.
I have voltage profile of the system, system loss, voltage unbalance factor, and saving as the objective function of the system. Each of the system objectives are bound with constraints and I’m using penalty factor approach to handle the constraints.
I have done coding the objective functions. But I do not understand how the NSGA II will identify and change the value of the original input data file of the radial power system bus data. So that NSGA II will test different combination of wind generation size and location to optimize the system.
Can some one help me to code or understand the logic behind inputting objective functions in to NSGA II code.
Do I have to do the power flow inside the objective function since it have to run each iteration to calculate the objective function for different combination of distributed generation size? I can post what I have done up to now if some one would like to help me understand what I have done wrong in my code. But I will omit posting messy lengthy code at the moment.
Any type of help or push toward the right direction would be appreciated.
Thank you optimization, nsga ii MATLAB Answers — New Questions