Category: News
Windows 10 laptops are making buzzing noise
I’ve recently noticed that my Windows 10 computer has been making a strange buzzing noise when I’m using it. The buzzing is quite loud and can be heard even when the volume is turned down. It’s not a constant noise, but rather comes and goes depending on what I’m doing on the computer. Sometimes it’s really loud and other times it’s barely audible. I’ve tried to troubleshoot the issue, but so far, I haven’t been able to identify what’s causing it. I’ve checked for any loose connections, updated my drivers, and run disk checks, but nothing seems to be working.
I’ve recently noticed that my Windows 10 computer has been making a strange buzzing noise when I’m using it. The buzzing is quite loud and can be heard even when the volume is turned down. It’s not a constant noise, but rather comes and goes depending on what I’m doing on the computer. Sometimes it’s really loud and other times it’s barely audible. I’ve tried to troubleshoot the issue, but so far, I haven’t been able to identify what’s causing it. I’ve checked for any loose connections, updated my drivers, and run disk checks, but nothing seems to be working. Read More
Containerising Azure Functions without Dockerfile
In my previous post, I discussed different containerising options for .NET developers. Now, let’s slightly move the focus to Azure Functions app. How can you containerise the Azure Functions app? Fortunately, Azure Functions Core Tools natively support it with Dockerfile. But is the Dockerfile the only option for containerising your .NET-based Azure Functions apps? Throughout this post, I’m going to discuss how Azure Functions apps can be containerised both with and without Dockerfile.
You can find a sample code from this GitHub repository.
Prerequisites
There are a few prerequisites to containerise .NET-based function apps effectively.
.NET SDK 8.0+
Azure Functions Core Tools
Visual Studio or Visual Studio Code + C# Dev Kit + Azure Functions
Docker Desktop
Containerise with Dockerfile
With the Azure Functions Core Tools, you can create a new Azure Functions app with the following command:
func init FunctionAppWithDockerfile
–worker-runtime dotnet-isolated
–docker
–target-framework net8.0
You may notice the –docker option in the command. This option creates a Dockerfile in the project directory. The Dockerfile looks like this:
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS installer-env
COPY . /src/dotnet-function-app
RUN cd /src/dotnet-function-app &&
mkdir -p /home/site/wwwroot &&
dotnet publish *.csproj –output /home/site/wwwroot
# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0-appservice
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY –from=installer-env [“/home/site/wwwroot”, “/home/site/wwwroot”]
There are a few points on Dockerfile to pick up:
The base image for the runtime is mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0. There are two other options available, mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0-slim and mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0-mariner. You can choose one of them based on your requirements.
The function app is running on the /home/site/wwwroot directory.
It has two environment variables, AzureWebJobsScriptRoot and AzureFunctionsJobHost__Logging__Console__IsEnabled.
There’s no ENTRYPOINT instruction defined.
These points will be used later on this post.
Let’s add a new function to the Azure Functions app with the following command:
func new -n HttpExampleTrigger -t HttpTrigger -a anonymous
Once it’s added, open the HttpExampleTrigger.cs file and modify it as follows:
// Before
return new OkObjectResult(“Welcome to Azure Functions!”);
// After
return new OkObjectResult(“Welcome to Azure Functions with Dockerfile!”);
Now, you can build the container image with the following command:
docker build . -t funcapp:latest-dockerfile
You have the container image for the Azure Functions app. You can run the container with the following command:
docker run -d -p 7071:80 –name funcappdockerfile funcapp:latest-dockerfile
Your function app is now up and running in a container. Open the browser and navigate to http://localhost:7071/api/HttpExampleTrigger to see the function app running.
Open your Docker Desktop and check the running container.
Can you see the Path and Args value? The Path value is /opt/startup/start_nonappservice.sh and the Args value is an empty array. In other words, the shell script, start_nonappservice.sh is run when the container starts, and it takes no arguments. Keep this information in mind. You’ll use it later in this post.
Once you’re done, stop and remove the container with the following commands:
docker stop funcappdockerfile && docker rm funcappdockerfile
So far, we’ve containerised the Azure Functions app with the Dockerfile. But, as I mentioned before, there is another way to containerise the Azure Functions app without having Dockerfile. Let’s move on.
Containerise with dotnet publish
Because MSBuild natively supports containerisation, you can make use of the dotnet publish command to build the container image for your function app. If you want to dynamically set the base container image, this option will be really useful. To do this, you might need to update your .csproj file to include the containerisation settings. First of all, create a new function app without the –docker option.
func init FunctionAppWithMSBuild
–worker-runtime dotnet-isolated
–target-framework net8.0
Let’s add a new function to the Azure Functions app with the following command:
func new -n HttpExampleTrigger -t HttpTrigger -a anonymous
Once it’s added, open the HttpExampleTrigger.cs file and modify it as follows:
// Before
return new OkObjectResult(“Welcome to Azure Functions!”);
// After
return new OkObjectResult(“Welcome to Azure Functions with MSBuild!”);
Now, the fun part begins. Open the FunctionAppWithMSBuild.csproj file and add the following node:
<ItemGroup>
<ContainerEnvironmentVariable
Include=”AzureWebJobsScriptRoot” Value=”/home/site/wwwroot” />
<ContainerEnvironmentVariable
Include=”AzureFunctionsJobHost__Logging__Console__IsEnabled” Value=”true” />
</ItemGroup>
Did you find that these two environment variables are the same as the ones in the Dockerfile? Let’s add another node to the .csproj file:
<ItemGroup Label=”ContainerAppCommand Assignment”>
<ContainerAppCommand Include=”/opt/startup/start_nonappservice.sh” />
</ItemGroup>
This node specifies the command to run when the container starts. This is the same as the Path value in the Docker Desktop screenshot. Now, you can build the container image with the following command:
dotnet publish ./FunctionAppWithMSBuild
-t:PublishContainer
–os linux –arch x64
-p:ContainerBaseImage=mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0
-p:ContainerRepository=funcapp
-p:ContainerImageTag=latest-msbuild
-p:ContainerWorkingDirectory=”/home/site/wwwroot”
NOTE: You can set the base container image with mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0-slim or mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0-mariner, depending on your requirements.
This command takes four properties – ContainerBaseImage, ContainerRepository, ContainerImageTag, and ContainerWorkingDirectory. With this dotnet publish command, you have the same development experience as building the container image with the docker build command, without having to rely on Dockerfile.
Run the following command to run the container:
docker run -d -p 7071:80 –name funcappmsbuild funcapp:latest-msbuild
Your function app is now up and running in a container. Open the browser and navigate to http://localhost:7071/api/HttpExampleTrigger to see the function app running.
Open your Docker Desktop and check the running container.
Can you see the Path and Args value? The Path value is /opt/startup/start_nonappservice.sh and the Args value has dotnet and FunctionAppWithMSBuild.dll. But these arguments are ignored because the shell script doesn’t take any argument.
Once you’re done, stop and remove the container with the following commands:
docker stop funcappmsbuild && docker rm funcappmsbuild
Now, you’ve got the Azure Functions app containerised without Dockerfile. With this dotnet publish approach, you can easily change the base container image, repository, tag, and working directory without relying on Dockerfile.
So far, I’ve walked through how .NET developers can containerise their .NET-based Azure Functions apps with two different options. You can either write Dockerfiles or use dotnet publish to build container images. Which one do you prefer?
More about MSBuild for Containers?
If you want to learn more options about containers with MSBuild, the following links might be helpful.
.NET Aspire
Containerise a .NET app with dotnet publish
.NET container images
This article was originally published on Dev Kimchi.
Microsoft Tech Community – Latest Blogs –Read More
Detecting residential areas in maps
Hello, trying to understand which strategy works best here.
I am using the mapping toolbox for a research project, which includes the calculation of the average distance/time for traveling from a number of polygonal ROIs (e.g. area of cities) to a given destination. This will in turn provide a measurement for the average cost that residents in the ROI have to endure in order to travel to the destination.
My script goes:
Consider one boundary polygon and geolocate it.
Build a grid of equally spaced geopoints within the polygon.
For each point in step 2, query the OSRM routing engine to the destination and store the response.
Average the distances/times.
I don’t like the current version of step 4, as the algorithm is applying the same weight to points in downtown and in the deep countryside. I would like to achieve a weighted average, where the weights represent a measure of the probability that someone lives nearby a given query point. This basically means detecting residential areas.
I’m not sure how to tackle this, as I’ve never worked with image processing (I’m assuming that’s the way, but I could be wrong). I thought about using geobasemap in ‘streets-light’ mode, and process the amount of pure white color in the picture, which would represent a measure of how much public road exists in a given portion of my ROI. The more roads are present, the less likely it is that we’re in the deep countryside.
I’m pretty sure there are more appropriate workarounds. Has anyone encountered a similar problem? Thank you very much.Hello, trying to understand which strategy works best here.
I am using the mapping toolbox for a research project, which includes the calculation of the average distance/time for traveling from a number of polygonal ROIs (e.g. area of cities) to a given destination. This will in turn provide a measurement for the average cost that residents in the ROI have to endure in order to travel to the destination.
My script goes:
Consider one boundary polygon and geolocate it.
Build a grid of equally spaced geopoints within the polygon.
For each point in step 2, query the OSRM routing engine to the destination and store the response.
Average the distances/times.
I don’t like the current version of step 4, as the algorithm is applying the same weight to points in downtown and in the deep countryside. I would like to achieve a weighted average, where the weights represent a measure of the probability that someone lives nearby a given query point. This basically means detecting residential areas.
I’m not sure how to tackle this, as I’ve never worked with image processing (I’m assuming that’s the way, but I could be wrong). I thought about using geobasemap in ‘streets-light’ mode, and process the amount of pure white color in the picture, which would represent a measure of how much public road exists in a given portion of my ROI. The more roads are present, the less likely it is that we’re in the deep countryside.
I’m pretty sure there are more appropriate workarounds. Has anyone encountered a similar problem? Thank you very much. Hello, trying to understand which strategy works best here.
I am using the mapping toolbox for a research project, which includes the calculation of the average distance/time for traveling from a number of polygonal ROIs (e.g. area of cities) to a given destination. This will in turn provide a measurement for the average cost that residents in the ROI have to endure in order to travel to the destination.
My script goes:
Consider one boundary polygon and geolocate it.
Build a grid of equally spaced geopoints within the polygon.
For each point in step 2, query the OSRM routing engine to the destination and store the response.
Average the distances/times.
I don’t like the current version of step 4, as the algorithm is applying the same weight to points in downtown and in the deep countryside. I would like to achieve a weighted average, where the weights represent a measure of the probability that someone lives nearby a given query point. This basically means detecting residential areas.
I’m not sure how to tackle this, as I’ve never worked with image processing (I’m assuming that’s the way, but I could be wrong). I thought about using geobasemap in ‘streets-light’ mode, and process the amount of pure white color in the picture, which would represent a measure of how much public road exists in a given portion of my ROI. The more roads are present, the less likely it is that we’re in the deep countryside.
I’m pretty sure there are more appropriate workarounds. Has anyone encountered a similar problem? Thank you very much. image processing, matlab, figure, image analysis, geobasemap MATLAB Answers — New Questions
From and Goto block connected block list?
how to find connected Corresponding From blocks list in Goto block? (Using mscript)
Similarly for From Block?how to find connected Corresponding From blocks list in Goto block? (Using mscript)
Similarly for From Block? how to find connected Corresponding From blocks list in Goto block? (Using mscript)
Similarly for From Block? from, goto block, mscript MATLAB Answers — New Questions
The Teams Mobile speed dial doesn’t show names only Numbers
For about a week now, we have had the problem on several Android phones that all external numbers are no longer displayed in the Speed dial in the Teams app.
The contacts are created and available online in the web app and can also be seen there, but in the mobile app you can only see the numbers.
However, if you click on the number in the mobile app and display the “Profile”, the name is also displayed.
For about a week now, we have had the problem on several Android phones that all external numbers are no longer displayed in the Speed dial in the Teams app.The contacts are created and available online in the web app and can also be seen there, but in the mobile app you can only see the numbers.However, if you click on the number in the mobile app and display the “Profile”, the name is also displayed. Read More
Remove password capabilities from windows
Dear Community,
Has anyone tested or explored about removing password capabilities in windows login?
Reduce the user-visible password surface area | Microsoft Learn
Please feel free to share your knowledge.
Dear Community,Has anyone tested or explored about removing password capabilities in windows login? Reduce the user-visible password surface area | Microsoft LearnPlease feel free to share your knowledge. Read More
Outlook crashing when froward email from send items
Hi Teams,
We are facing outlook crashing issue when forwarding calander invitation email with Teams attachment.
Have affected multiple users this problem. Please help me anyone faceing this issue .If anybody resolved this issue Kindly let us know the resolution.
Regards,
Senthil
Hi Teams, We are facing outlook crashing issue when forwarding calander invitation email with Teams attachment.Have affected multiple users this problem. Please help me anyone faceing this issue .If anybody resolved this issue Kindly let us know the resolution.Regards,Senthil Read More
Teams External Domain Activity Report Gets a Refresh
Microsoft says that they plan to refresh the Teams external domain activity report from September 2024. But access to the report requires a Teams Premium license. It seems like this kind of fundamental information should be available to every tenant as it’s not basic security data instead of something that could be considered as Advanced Collaboration Analytics.
https://office365itpros.com/2024/08/23/external-domain-activity-report/
Microsoft says that they plan to refresh the Teams external domain activity report from September 2024. But access to the report requires a Teams Premium license. It seems like this kind of fundamental information should be available to every tenant as it’s not basic security data instead of something that could be considered as Advanced Collaboration Analytics.
https://office365itpros.com/2024/08/23/external-domain-activity-report/ Read More
How Can I Batch Convert RAW Images to JPG on Windows?
Hey folks,
I’ve been working on editing a large collection of photos, and most of them are in RAW format straight from my camera. While RAW is great for detailed editing, I need to convert raw to jpg for easier sharing and quick edits. The thing is, I’ve got hundreds of these files and doing them one by one isn’t really an option.
I’m using a Windows PC, and I’m looking for a reliable and efficient way to batch convert RAW to JPG. I’d prefer something that’s user-friendly since I’m not super tech-savvy, but I’m open to any suggestions. Also, I’d like to preserve as much of the image quality as possible during the conversion.
Does anyone have experience with this or know of any good tools that can handle bulk conversions? Any tips or software recommendations would be awesome! Thanks a lot!
Hey folks, I’ve been working on editing a large collection of photos, and most of them are in RAW format straight from my camera. While RAW is great for detailed editing, I need to convert raw to jpg for easier sharing and quick edits. The thing is, I’ve got hundreds of these files and doing them one by one isn’t really an option. I’m using a Windows PC, and I’m looking for a reliable and efficient way to batch convert RAW to JPG. I’d prefer something that’s user-friendly since I’m not super tech-savvy, but I’m open to any suggestions. Also, I’d like to preserve as much of the image quality as possible during the conversion. Does anyone have experience with this or know of any good tools that can handle bulk conversions? Any tips or software recommendations would be awesome! Thanks a lot! Read More
Run a python exe from within a Matlab exe with Administrator permissions
I would like to run a python.exe from within a Matlab.exe file with administrator permissions.Unfortunately, the python.exe does not have the necessary permissions to write out a file. I have tried executing it directly from command prompt as administrator and it works perfectly. The process fails when I try executing it within the matlab exe. The workflow is as follows:
The python.exe receives two inputs as arguments i) filename – which is a path to a particular file ii) value
ML_correction.exe –filename "C:/…/../xx.txt" –corrected_val "-185.7"
The python exe computes a certain value and writes out a .mat file
2. The above command to call the python exe is executed within a Matlab exe as follows:
python_path="C:/…/../xx.txt";
val=-185.7;
cmd_command=[‘….ML_correction.exe –filename "’ python_path ‘" –corrected_val "’ num2str(val) ‘"’];
[status,cmdout] = system(cmd_command);
I have read the suggestions from @Jan and @Guillaume : https://de.mathworks.com/matlabcentral/answers/398700-run-external-software-from-matlab-using-system-with-admin-rights
I tried to pass my arguments using ShellExecute from Microsoft documentation but I am definitely doing it wrong. I have tried the following:
cmd_command=[‘….ML_correction.exe –filename "’ python_path ‘" –corrected_val "’ num2str(val) ‘"’];
exepath=string(cmd_command);
uac = actxserver(‘Shell.Application’);
uac.ShellExecute(exepath, "ELEV", "", "runas", 1);
Thank You!
I am using Windows 10 and Matlab2017bI would like to run a python.exe from within a Matlab.exe file with administrator permissions.Unfortunately, the python.exe does not have the necessary permissions to write out a file. I have tried executing it directly from command prompt as administrator and it works perfectly. The process fails when I try executing it within the matlab exe. The workflow is as follows:
The python.exe receives two inputs as arguments i) filename – which is a path to a particular file ii) value
ML_correction.exe –filename "C:/…/../xx.txt" –corrected_val "-185.7"
The python exe computes a certain value and writes out a .mat file
2. The above command to call the python exe is executed within a Matlab exe as follows:
python_path="C:/…/../xx.txt";
val=-185.7;
cmd_command=[‘….ML_correction.exe –filename "’ python_path ‘" –corrected_val "’ num2str(val) ‘"’];
[status,cmdout] = system(cmd_command);
I have read the suggestions from @Jan and @Guillaume : https://de.mathworks.com/matlabcentral/answers/398700-run-external-software-from-matlab-using-system-with-admin-rights
I tried to pass my arguments using ShellExecute from Microsoft documentation but I am definitely doing it wrong. I have tried the following:
cmd_command=[‘….ML_correction.exe –filename "’ python_path ‘" –corrected_val "’ num2str(val) ‘"’];
exepath=string(cmd_command);
uac = actxserver(‘Shell.Application’);
uac.ShellExecute(exepath, "ELEV", "", "runas", 1);
Thank You!
I am using Windows 10 and Matlab2017b I would like to run a python.exe from within a Matlab.exe file with administrator permissions.Unfortunately, the python.exe does not have the necessary permissions to write out a file. I have tried executing it directly from command prompt as administrator and it works perfectly. The process fails when I try executing it within the matlab exe. The workflow is as follows:
The python.exe receives two inputs as arguments i) filename – which is a path to a particular file ii) value
ML_correction.exe –filename "C:/…/../xx.txt" –corrected_val "-185.7"
The python exe computes a certain value and writes out a .mat file
2. The above command to call the python exe is executed within a Matlab exe as follows:
python_path="C:/…/../xx.txt";
val=-185.7;
cmd_command=[‘….ML_correction.exe –filename "’ python_path ‘" –corrected_val "’ num2str(val) ‘"’];
[status,cmdout] = system(cmd_command);
I have read the suggestions from @Jan and @Guillaume : https://de.mathworks.com/matlabcentral/answers/398700-run-external-software-from-matlab-using-system-with-admin-rights
I tried to pass my arguments using ShellExecute from Microsoft documentation but I am definitely doing it wrong. I have tried the following:
cmd_command=[‘….ML_correction.exe –filename "’ python_path ‘" –corrected_val "’ num2str(val) ‘"’];
exepath=string(cmd_command);
uac = actxserver(‘Shell.Application’);
uac.ShellExecute(exepath, "ELEV", "", "runas", 1);
Thank You!
I am using Windows 10 and Matlab2017b system, python exe, matlab exe MATLAB Answers — New Questions
Trouble with an array
Hello,
I have some trouble with an array. I try to set the values for a 3D array (nx x ny x nz) that all inner nodes are set to a defined value, all surface nodes (except the edge nodes) are set to a defined value too. It’s like a small cube in a greater cube.
Here is the code I used:
clc;
clear all;
clf;
format short g
fontSize = 18;
% Domaine
L=0.1;
B=0.1;
H=0.1;
nx=5;
ny=5;
nz=5;
dx=L/(nx-1);
dy=B/(ny-1);
dz=H/(nz-1);
% Nodes
Tn=zeros(nx,ny,nz);
x=linspace(0,L,nx);
y=linspace(0,H,ny);
z=linspace(0,B,nz);
[X,Y,Z]=meshgrid(x,y,z);
K=zeros(nx,ny,nz);
K([1 end],:,:)=alpha;
K(:,[1 end],:)=alpha;
K(:,:,[1 end])=alpha;
% inner nodes
T=zeros(nx,ny,nz);
T(:,:,:)=700;
t=0;
% surrounding surfaces
Tu=600; % bottom
To=900; % top
Tl=400; % left
Tr=800; % rigth
Tv=300; % front
Th=300; % back
% side surfaces
Tn(1,2:nx-2,2:nz-2)=Tv; % front
Tn(ny,2:nx-2,2:nz-2)=Th; % back
Tn(2:ny-2,2:nx-2,1)=Tu; % bottom
Tn(2:ny-2,2:nx-2,nz)=To; % top
Tn(2:ny-2,1,2:nz-2)=Tl; % left
Tn(2:ny-2,nx,2:nz-2)=Tr; % rigth
% merge inner nodes
Tn(2:ny-2,2:nx-2,2:nz-2) = T(2:ny-2,2:nx-2,2:nz-2);
f = figure(1);
f.Position(3:4) = [1080 840];
%XY
subplot(2,2,1)
slice(X,Y,Z,Tn,[],[],[0,H],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% XZ
subplot(2,2,2)
slice(X,Y,Z,Tn,[],[0,B],[],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
%set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% YZ
subplot(2,2,3)
slice(X,Y,Z,Tn,[0,L],[],[],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
%set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% 3D
subplot(2,2,4)
slice(X,Y,Z,Tn,[0,L/2],[B/2,B],[0],’linear’);
set(gca,’FontSize’,fontSize)
set(gca,’YDir’,’normal’)
colormap(jet)
set ( gca, ‘xdir’, ‘reverse’ )
set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H])
view(-150,30);
hold on
%shading(gca,’interp’)
p = get(subplot(2,2,4),’Position’);
cb=colorbar(‘Position’, [0.93 0.25 0.025 0.6]);
set(cb,’FontSize’,fontSize);
caxis([0, 900]);
The result I achieve is this:
I marked the false areas with a red sign. I indexed from 2:nx-1 and so on, but it’s not working.
The result should look like this:
I don’t know where the error is. Maybe someone has a clue how to fix this.
Greetings
SteffenHello,
I have some trouble with an array. I try to set the values for a 3D array (nx x ny x nz) that all inner nodes are set to a defined value, all surface nodes (except the edge nodes) are set to a defined value too. It’s like a small cube in a greater cube.
Here is the code I used:
clc;
clear all;
clf;
format short g
fontSize = 18;
% Domaine
L=0.1;
B=0.1;
H=0.1;
nx=5;
ny=5;
nz=5;
dx=L/(nx-1);
dy=B/(ny-1);
dz=H/(nz-1);
% Nodes
Tn=zeros(nx,ny,nz);
x=linspace(0,L,nx);
y=linspace(0,H,ny);
z=linspace(0,B,nz);
[X,Y,Z]=meshgrid(x,y,z);
K=zeros(nx,ny,nz);
K([1 end],:,:)=alpha;
K(:,[1 end],:)=alpha;
K(:,:,[1 end])=alpha;
% inner nodes
T=zeros(nx,ny,nz);
T(:,:,:)=700;
t=0;
% surrounding surfaces
Tu=600; % bottom
To=900; % top
Tl=400; % left
Tr=800; % rigth
Tv=300; % front
Th=300; % back
% side surfaces
Tn(1,2:nx-2,2:nz-2)=Tv; % front
Tn(ny,2:nx-2,2:nz-2)=Th; % back
Tn(2:ny-2,2:nx-2,1)=Tu; % bottom
Tn(2:ny-2,2:nx-2,nz)=To; % top
Tn(2:ny-2,1,2:nz-2)=Tl; % left
Tn(2:ny-2,nx,2:nz-2)=Tr; % rigth
% merge inner nodes
Tn(2:ny-2,2:nx-2,2:nz-2) = T(2:ny-2,2:nx-2,2:nz-2);
f = figure(1);
f.Position(3:4) = [1080 840];
%XY
subplot(2,2,1)
slice(X,Y,Z,Tn,[],[],[0,H],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% XZ
subplot(2,2,2)
slice(X,Y,Z,Tn,[],[0,B],[],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
%set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% YZ
subplot(2,2,3)
slice(X,Y,Z,Tn,[0,L],[],[],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
%set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% 3D
subplot(2,2,4)
slice(X,Y,Z,Tn,[0,L/2],[B/2,B],[0],’linear’);
set(gca,’FontSize’,fontSize)
set(gca,’YDir’,’normal’)
colormap(jet)
set ( gca, ‘xdir’, ‘reverse’ )
set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H])
view(-150,30);
hold on
%shading(gca,’interp’)
p = get(subplot(2,2,4),’Position’);
cb=colorbar(‘Position’, [0.93 0.25 0.025 0.6]);
set(cb,’FontSize’,fontSize);
caxis([0, 900]);
The result I achieve is this:
I marked the false areas with a red sign. I indexed from 2:nx-1 and so on, but it’s not working.
The result should look like this:
I don’t know where the error is. Maybe someone has a clue how to fix this.
Greetings
Steffen Hello,
I have some trouble with an array. I try to set the values for a 3D array (nx x ny x nz) that all inner nodes are set to a defined value, all surface nodes (except the edge nodes) are set to a defined value too. It’s like a small cube in a greater cube.
Here is the code I used:
clc;
clear all;
clf;
format short g
fontSize = 18;
% Domaine
L=0.1;
B=0.1;
H=0.1;
nx=5;
ny=5;
nz=5;
dx=L/(nx-1);
dy=B/(ny-1);
dz=H/(nz-1);
% Nodes
Tn=zeros(nx,ny,nz);
x=linspace(0,L,nx);
y=linspace(0,H,ny);
z=linspace(0,B,nz);
[X,Y,Z]=meshgrid(x,y,z);
K=zeros(nx,ny,nz);
K([1 end],:,:)=alpha;
K(:,[1 end],:)=alpha;
K(:,:,[1 end])=alpha;
% inner nodes
T=zeros(nx,ny,nz);
T(:,:,:)=700;
t=0;
% surrounding surfaces
Tu=600; % bottom
To=900; % top
Tl=400; % left
Tr=800; % rigth
Tv=300; % front
Th=300; % back
% side surfaces
Tn(1,2:nx-2,2:nz-2)=Tv; % front
Tn(ny,2:nx-2,2:nz-2)=Th; % back
Tn(2:ny-2,2:nx-2,1)=Tu; % bottom
Tn(2:ny-2,2:nx-2,nz)=To; % top
Tn(2:ny-2,1,2:nz-2)=Tl; % left
Tn(2:ny-2,nx,2:nz-2)=Tr; % rigth
% merge inner nodes
Tn(2:ny-2,2:nx-2,2:nz-2) = T(2:ny-2,2:nx-2,2:nz-2);
f = figure(1);
f.Position(3:4) = [1080 840];
%XY
subplot(2,2,1)
slice(X,Y,Z,Tn,[],[],[0,H],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% XZ
subplot(2,2,2)
slice(X,Y,Z,Tn,[],[0,B],[],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
%set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% YZ
subplot(2,2,3)
slice(X,Y,Z,Tn,[0,L],[],[],’cubic’);
set(gca,’FontSize’,fontSize)
colormap(jet)
%set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H]);
view(30,30);
% 3D
subplot(2,2,4)
slice(X,Y,Z,Tn,[0,L/2],[B/2,B],[0],’linear’);
set(gca,’FontSize’,fontSize)
set(gca,’YDir’,’normal’)
colormap(jet)
set ( gca, ‘xdir’, ‘reverse’ )
set ( gca, ‘ydir’, ‘reverse’ )
xlabel(‘X -Axis’,’FontSize’, fontSize)
ylabel(‘Y -Axis’,’FontSize’, fontSize)
zlabel(‘Z -Axis’,’FontSize’, fontSize)
axis([0 L 0 B 0 H])
view(-150,30);
hold on
%shading(gca,’interp’)
p = get(subplot(2,2,4),’Position’);
cb=colorbar(‘Position’, [0.93 0.25 0.025 0.6]);
set(cb,’FontSize’,fontSize);
caxis([0, 900]);
The result I achieve is this:
I marked the false areas with a red sign. I indexed from 2:nx-1 and so on, but it’s not working.
The result should look like this:
I don’t know where the error is. Maybe someone has a clue how to fix this.
Greetings
Steffen array, indexing MATLAB Answers — New Questions
n-dimensional Polyhedron plotting using 2-dimensional plot commamnd
I have a 4-dimensional system with 4 states x=(x1, x2, x3,x4) as follow:
A =[ 0 1 0 0
0 -6.7811 203.43 1.6275
0 0 0 1
0 0.89105 -26.732 -6.8804];
B =[ 0
101.72
0
61.26];
xmin = [-2; -5;-4; -2];xmax = [0; 50; 10; 10];
umin =-5;umax =5;
and a I must plot a Polyhedron as follow only for x1 , x2
X = Polyhedron(‘lb’,model.x.min,’ub’,model.x.max);
above-mentionaed Polyhedron is 4-dimentional and it is not possible to plot it.
i want to plot this polyhedron in 2-dimensional page only for x1 and x2 states such that x1 state is considered as horizontal axis and x2 state is considered as vertical axis.
How can I do that in Matlab?I have a 4-dimensional system with 4 states x=(x1, x2, x3,x4) as follow:
A =[ 0 1 0 0
0 -6.7811 203.43 1.6275
0 0 0 1
0 0.89105 -26.732 -6.8804];
B =[ 0
101.72
0
61.26];
xmin = [-2; -5;-4; -2];xmax = [0; 50; 10; 10];
umin =-5;umax =5;
and a I must plot a Polyhedron as follow only for x1 , x2
X = Polyhedron(‘lb’,model.x.min,’ub’,model.x.max);
above-mentionaed Polyhedron is 4-dimentional and it is not possible to plot it.
i want to plot this polyhedron in 2-dimensional page only for x1 and x2 states such that x1 state is considered as horizontal axis and x2 state is considered as vertical axis.
How can I do that in Matlab? I have a 4-dimensional system with 4 states x=(x1, x2, x3,x4) as follow:
A =[ 0 1 0 0
0 -6.7811 203.43 1.6275
0 0 0 1
0 0.89105 -26.732 -6.8804];
B =[ 0
101.72
0
61.26];
xmin = [-2; -5;-4; -2];xmax = [0; 50; 10; 10];
umin =-5;umax =5;
and a I must plot a Polyhedron as follow only for x1 , x2
X = Polyhedron(‘lb’,model.x.min,’ub’,model.x.max);
above-mentionaed Polyhedron is 4-dimentional and it is not possible to plot it.
i want to plot this polyhedron in 2-dimensional page only for x1 and x2 states such that x1 state is considered as horizontal axis and x2 state is considered as vertical axis.
How can I do that in Matlab? polyhedron, mpc MATLAB Answers — New Questions
Cannot figure out how to fit a complicated custom equation.
I am having trouble implementing this equation into the curve fitting toolbox, both in the command and by utilizing the curve fitting GUI.
A little background that may help explain this:
I am wanting to fit experimental data of T(K) vs K_ph (W/m K) which the thermal conductivity of a material, to a model from a journal paper. I have done an okay job in python with scipy.optimize but have been trying MATLAB for a more accurate method.
I have this equation I need to fit
where
A, B, b, C_1, C_2, D, Omega_res1, Omega_res2, and L (ignore L in the exmaple code) are all coefficients I want solved for.
Omega is the independent variable in the integral (omega is solved for) while T is the range 1 to 100 in 1K steps. Or T can simply be my experimental Temperature data as is in my code.
My problems (in the GUI) are in the ways to set the values for T and use an integral in the custom equation box. As in, I am not sure how to tyep the equation in the way MATLAB accepts in the GUI for the toolbox.
My problems for the code is in the integration and lsqcurve fit it seems. I have a lot of warnings/errors such as
Warning: Derivative finite-differencing step was artificially reduced to be within bound constraints. This may
adversely affect convergence. Increasing distance between bound constraints, in dimension 6, to be at least 2e-20
may improve results.
Local minimum possible.
lsqcurvefit stopped because the size of the current step is less than
the value of the step size tolerance.
<stopping criteria details>
Fitted Parameters:
D = 1e-40
B = 1e-20
A = 1e-15
b = 100
C1 = 1e-40
C2 = 1e-40
I am not sure how to fix these, I have gone through other posts on similar matters and have changed the bounds and manually changed the optimoptions values to very low, but reached a point where it was just iterating nonstop.
Any help is appreciated!
% Data from 0T.txt
data = readmatrix(‘0T.txt’, ‘HeaderLines’, 1);
T_data = data(:, 1); % First col: Temperature (K)
k_ph_data = data(:, 2); % Second col: kappa_{xx} (W/mK)
% Constants
k_B = 1.380649e-23; % Boltzmann constant in J/K
hbar = 1.0545718e-34; % Reduced Planck constant in J·s
v_s = 4.817e3; % Sound velocity in m/s
theta_D = 235; % Debye temperature in K
L = 1e-6; % Length in m
% Define the integrand function with omega_res1 and omega_res2
integrand = @(omega, T, D, B, A, b, C1, C2, omega_res1, omega_res2) …
(omega.^4 .* exp(hbar*omega./(k_B*T)) ./ (exp(hbar*omega./(k_B*T)) – 1).^2) .* …
(v_s / L + D*omega.^4 + B*omega + A*T*omega.^3 .* exp(-theta_D / (b*T)) + …
C1 * omega.^4 ./ ((omega.^2 – omega_res1.^2).^2 + 1e-10) .* exp(-hbar*omega_res1 / (k_B * T)) ./ …
(1 + exp(-hbar*omega_res1 / (k_B * T))) + …
C2 * omega.^4 ./ ((omega.^2 – omega_res2.^2).^2 + 1e-10) .* exp(-hbar*omega_res2 / (k_B * T)) ./ …
(1 + exp(-hbar*omega_res2 / (k_B * T))));
% Define the k_ph function
k_ph_func = @(params, T) (k_B / (2 * pi^2 * v_s)) * (k_B * T / hbar)^3 .* …
integral(@(omega) integrand(omega, T, params(1), params(2), params(3), params(4), params(5), params(6), params(7), params(8)), 0, theta_D / T);
% Define the function to be minimized
fun = @(params, T) arrayfun(@(t) k_ph_func(params, t), T);
% Initial guess for parameters [D, B, A, b, C1, C2, omega_res1, omega_res2]
initial_guess = [1e-43, 1e-6, 1e-31, 1, 1e9, 1e10, 1e12, 4e12];
% Set bounds
lb = [1e-50, 1e-12, 1e-35, 1, 1e7, 1e8, 1e10, 3e12];
ub = [1e-40, 1e-3, 1e-28, 1000, 1e11, 1e12, 1e14, 5e12];
% Create opts structure
opts = optimoptions(‘lsqcurvefit’, ‘MaxFunctionEvaluations’, 1e4, ‘MaxIterations’, 1e3);
% Use lsqcurvefit for the fitting
[fitted_params, resnorm, residual, exitflag, output] = lsqcurvefit(fun, initial_guess, T_data, k_ph_data, lb, ub, opts);
% Generate fitted curve (using log spacing)
T_fit = logspace(log10(min(T_data)), log10(max(T_data)), 100);
k_ph_fit = fun(fitted_params, T_fit);I am having trouble implementing this equation into the curve fitting toolbox, both in the command and by utilizing the curve fitting GUI.
A little background that may help explain this:
I am wanting to fit experimental data of T(K) vs K_ph (W/m K) which the thermal conductivity of a material, to a model from a journal paper. I have done an okay job in python with scipy.optimize but have been trying MATLAB for a more accurate method.
I have this equation I need to fit
where
A, B, b, C_1, C_2, D, Omega_res1, Omega_res2, and L (ignore L in the exmaple code) are all coefficients I want solved for.
Omega is the independent variable in the integral (omega is solved for) while T is the range 1 to 100 in 1K steps. Or T can simply be my experimental Temperature data as is in my code.
My problems (in the GUI) are in the ways to set the values for T and use an integral in the custom equation box. As in, I am not sure how to tyep the equation in the way MATLAB accepts in the GUI for the toolbox.
My problems for the code is in the integration and lsqcurve fit it seems. I have a lot of warnings/errors such as
Warning: Derivative finite-differencing step was artificially reduced to be within bound constraints. This may
adversely affect convergence. Increasing distance between bound constraints, in dimension 6, to be at least 2e-20
may improve results.
Local minimum possible.
lsqcurvefit stopped because the size of the current step is less than
the value of the step size tolerance.
<stopping criteria details>
Fitted Parameters:
D = 1e-40
B = 1e-20
A = 1e-15
b = 100
C1 = 1e-40
C2 = 1e-40
I am not sure how to fix these, I have gone through other posts on similar matters and have changed the bounds and manually changed the optimoptions values to very low, but reached a point where it was just iterating nonstop.
Any help is appreciated!
% Data from 0T.txt
data = readmatrix(‘0T.txt’, ‘HeaderLines’, 1);
T_data = data(:, 1); % First col: Temperature (K)
k_ph_data = data(:, 2); % Second col: kappa_{xx} (W/mK)
% Constants
k_B = 1.380649e-23; % Boltzmann constant in J/K
hbar = 1.0545718e-34; % Reduced Planck constant in J·s
v_s = 4.817e3; % Sound velocity in m/s
theta_D = 235; % Debye temperature in K
L = 1e-6; % Length in m
% Define the integrand function with omega_res1 and omega_res2
integrand = @(omega, T, D, B, A, b, C1, C2, omega_res1, omega_res2) …
(omega.^4 .* exp(hbar*omega./(k_B*T)) ./ (exp(hbar*omega./(k_B*T)) – 1).^2) .* …
(v_s / L + D*omega.^4 + B*omega + A*T*omega.^3 .* exp(-theta_D / (b*T)) + …
C1 * omega.^4 ./ ((omega.^2 – omega_res1.^2).^2 + 1e-10) .* exp(-hbar*omega_res1 / (k_B * T)) ./ …
(1 + exp(-hbar*omega_res1 / (k_B * T))) + …
C2 * omega.^4 ./ ((omega.^2 – omega_res2.^2).^2 + 1e-10) .* exp(-hbar*omega_res2 / (k_B * T)) ./ …
(1 + exp(-hbar*omega_res2 / (k_B * T))));
% Define the k_ph function
k_ph_func = @(params, T) (k_B / (2 * pi^2 * v_s)) * (k_B * T / hbar)^3 .* …
integral(@(omega) integrand(omega, T, params(1), params(2), params(3), params(4), params(5), params(6), params(7), params(8)), 0, theta_D / T);
% Define the function to be minimized
fun = @(params, T) arrayfun(@(t) k_ph_func(params, t), T);
% Initial guess for parameters [D, B, A, b, C1, C2, omega_res1, omega_res2]
initial_guess = [1e-43, 1e-6, 1e-31, 1, 1e9, 1e10, 1e12, 4e12];
% Set bounds
lb = [1e-50, 1e-12, 1e-35, 1, 1e7, 1e8, 1e10, 3e12];
ub = [1e-40, 1e-3, 1e-28, 1000, 1e11, 1e12, 1e14, 5e12];
% Create opts structure
opts = optimoptions(‘lsqcurvefit’, ‘MaxFunctionEvaluations’, 1e4, ‘MaxIterations’, 1e3);
% Use lsqcurvefit for the fitting
[fitted_params, resnorm, residual, exitflag, output] = lsqcurvefit(fun, initial_guess, T_data, k_ph_data, lb, ub, opts);
% Generate fitted curve (using log spacing)
T_fit = logspace(log10(min(T_data)), log10(max(T_data)), 100);
k_ph_fit = fun(fitted_params, T_fit); I am having trouble implementing this equation into the curve fitting toolbox, both in the command and by utilizing the curve fitting GUI.
A little background that may help explain this:
I am wanting to fit experimental data of T(K) vs K_ph (W/m K) which the thermal conductivity of a material, to a model from a journal paper. I have done an okay job in python with scipy.optimize but have been trying MATLAB for a more accurate method.
I have this equation I need to fit
where
A, B, b, C_1, C_2, D, Omega_res1, Omega_res2, and L (ignore L in the exmaple code) are all coefficients I want solved for.
Omega is the independent variable in the integral (omega is solved for) while T is the range 1 to 100 in 1K steps. Or T can simply be my experimental Temperature data as is in my code.
My problems (in the GUI) are in the ways to set the values for T and use an integral in the custom equation box. As in, I am not sure how to tyep the equation in the way MATLAB accepts in the GUI for the toolbox.
My problems for the code is in the integration and lsqcurve fit it seems. I have a lot of warnings/errors such as
Warning: Derivative finite-differencing step was artificially reduced to be within bound constraints. This may
adversely affect convergence. Increasing distance between bound constraints, in dimension 6, to be at least 2e-20
may improve results.
Local minimum possible.
lsqcurvefit stopped because the size of the current step is less than
the value of the step size tolerance.
<stopping criteria details>
Fitted Parameters:
D = 1e-40
B = 1e-20
A = 1e-15
b = 100
C1 = 1e-40
C2 = 1e-40
I am not sure how to fix these, I have gone through other posts on similar matters and have changed the bounds and manually changed the optimoptions values to very low, but reached a point where it was just iterating nonstop.
Any help is appreciated!
% Data from 0T.txt
data = readmatrix(‘0T.txt’, ‘HeaderLines’, 1);
T_data = data(:, 1); % First col: Temperature (K)
k_ph_data = data(:, 2); % Second col: kappa_{xx} (W/mK)
% Constants
k_B = 1.380649e-23; % Boltzmann constant in J/K
hbar = 1.0545718e-34; % Reduced Planck constant in J·s
v_s = 4.817e3; % Sound velocity in m/s
theta_D = 235; % Debye temperature in K
L = 1e-6; % Length in m
% Define the integrand function with omega_res1 and omega_res2
integrand = @(omega, T, D, B, A, b, C1, C2, omega_res1, omega_res2) …
(omega.^4 .* exp(hbar*omega./(k_B*T)) ./ (exp(hbar*omega./(k_B*T)) – 1).^2) .* …
(v_s / L + D*omega.^4 + B*omega + A*T*omega.^3 .* exp(-theta_D / (b*T)) + …
C1 * omega.^4 ./ ((omega.^2 – omega_res1.^2).^2 + 1e-10) .* exp(-hbar*omega_res1 / (k_B * T)) ./ …
(1 + exp(-hbar*omega_res1 / (k_B * T))) + …
C2 * omega.^4 ./ ((omega.^2 – omega_res2.^2).^2 + 1e-10) .* exp(-hbar*omega_res2 / (k_B * T)) ./ …
(1 + exp(-hbar*omega_res2 / (k_B * T))));
% Define the k_ph function
k_ph_func = @(params, T) (k_B / (2 * pi^2 * v_s)) * (k_B * T / hbar)^3 .* …
integral(@(omega) integrand(omega, T, params(1), params(2), params(3), params(4), params(5), params(6), params(7), params(8)), 0, theta_D / T);
% Define the function to be minimized
fun = @(params, T) arrayfun(@(t) k_ph_func(params, t), T);
% Initial guess for parameters [D, B, A, b, C1, C2, omega_res1, omega_res2]
initial_guess = [1e-43, 1e-6, 1e-31, 1, 1e9, 1e10, 1e12, 4e12];
% Set bounds
lb = [1e-50, 1e-12, 1e-35, 1, 1e7, 1e8, 1e10, 3e12];
ub = [1e-40, 1e-3, 1e-28, 1000, 1e11, 1e12, 1e14, 5e12];
% Create opts structure
opts = optimoptions(‘lsqcurvefit’, ‘MaxFunctionEvaluations’, 1e4, ‘MaxIterations’, 1e3);
% Use lsqcurvefit for the fitting
[fitted_params, resnorm, residual, exitflag, output] = lsqcurvefit(fun, initial_guess, T_data, k_ph_data, lb, ub, opts);
% Generate fitted curve (using log spacing)
T_fit = logspace(log10(min(T_data)), log10(max(T_data)), 100);
k_ph_fit = fun(fitted_params, T_fit); curve fitting MATLAB Answers — New Questions
extract 1 row data of 1 table
I want to extract the data of a row in a table, how to do it
exam: Name address age
hang VN 18
nam vn 40
lan vn 23
I want to retrieve the information of a man named Nam
help me!I want to extract the data of a row in a table, how to do it
exam: Name address age
hang VN 18
nam vn 40
lan vn 23
I want to retrieve the information of a man named Nam
help me! I want to extract the data of a row in a table, how to do it
exam: Name address age
hang VN 18
nam vn 40
lan vn 23
I want to retrieve the information of a man named Nam
help me! extract 1 row data of 1 table MATLAB Answers — New Questions
How do I create windows 10 bootable USB on Mac without bootcamp?
I’m running into a frustrating issue where I need to create a Windows 10 bootable USB for my Macbook Pro 2023, but every attempt to use Boot Camp Assistant has ended in errors. This has left me in a bit of a bind, as I’m keen to find an alternative method that bypasses Boot Camp altogether. The goal is to successfully prepare a USB drive with Windows 10 installation files, which I plan to use on a PC. If anyone knows how to do this directly on macOS, avoiding Boot Camp issues, I’d really appreciate a simplified guide or tool suggestions to get this done.
I’m running into a frustrating issue where I need to create a Windows 10 bootable USB for my Macbook Pro 2023, but every attempt to use Boot Camp Assistant has ended in errors. This has left me in a bit of a bind, as I’m keen to find an alternative method that bypasses Boot Camp altogether. The goal is to successfully prepare a USB drive with Windows 10 installation files, which I plan to use on a PC. If anyone knows how to do this directly on macOS, avoiding Boot Camp issues, I’d really appreciate a simplified guide or tool suggestions to get this done. Read More
Microsoft Gold Partner Perks
Can I get a www.msn.com publishing account if I’m already a Microsoft Gold partner for providing IT & Cloud Services.
My company is www.xavor.com.
Can I get a www.msn.com publishing account if I’m already a Microsoft Gold partner for providing IT & Cloud Services.My company is www.xavor.com. Read More
Sharing: can i hide users / groups from showing on the sharing option
Hello good morning.
I was checking in our SharePoint online sites, and when people want to share things it can be a bit confusing.
at the moment they can see , Individual users, Shared mailboxes, security groups, Microsoft 365 groups, and Mail enabled security groups.
I noticed that when sharing to a group shared mailbox, users still don’t have access to what’s been shared, same with security groups.
Is it possible to hide these so that users don’t get confused?
Thank you
Hello good morning.I was checking in our SharePoint online sites, and when people want to share things it can be a bit confusing.at the moment they can see , Individual users, Shared mailboxes, security groups, Microsoft 365 groups, and Mail enabled security groups. I noticed that when sharing to a group shared mailbox, users still don’t have access to what’s been shared, same with security groups.Is it possible to hide these so that users don’t get confused? Thank you Read More
custom phase changing material does not release heat.
Problem:
When I adjust the latent heat, there’s no change in the temperature curve of the XPS material. I anticipate a stable temperature, ranging between 305K and 320K. So the problem is that the material does not release the absorbed heat.
equations
assert(Cps > 0 && Cpl > 0)
assert(T > 0, ‘Temperature must be greater than absolute zero’)
T == M.T;
if T >= Tmelt_start && T <= Tmelt_end
phaseChangeRate == {0.001, ‘1/s’};
else
phaseChangeRate == {0, ‘1/s’};
end
if phase < 1 && phase > 0
Q == m * Cps * T.der + m * L * phaseChangeRate;
phase.der == phaseChangeRate;
else
Q == m * Cpl * T.der;
phase.der == {0, ‘1/s’};
end
end
explanation of the full code:
This code describes a thermal component that models internal energy storage in a thermal network. Here’s a breakdown of the main parts of this code:
1. **Nodes**: These are points where other components can connect. Two thermal nodes are defined: `M` (top) and `N` (bottom).
2. **Inputs**: These values can be supplied from outside. `Mdot` represents the mass flow rate (in kg/s) and `T_in` is the input temperature (in Kelvin).
3. **Parameters**: These values determine the behavior of the component. They include:
– `mass_type`: Type of mass (constant or variable).
– `mass`: The mass of the thermal component.
– `Cps` and `Cpl`: Specific heat capacity for solid and liquid, respectively.
– `Tmelt_start` and `Tmelt_end`: The temperature range where the material starts melting and stops melting.
– `L`: Specific latent heat.
– `mass_min`: Minimum mass.
– `num_ports`: The number of graphical ports.
4. **Annotations**: These are metadata that provide additional information about the component or dictate how it is displayed in a GUI. Here, it is primarily used to indicate which parameters can be modified externally and to define the component’s icon.
5. **Variables**: These represent the internal states of the component. They include:
– `m`: The mass.
– `T`: The temperature.
– `phase`: The phase (0 for solid, 1 for liquid, and values in between for a mixed phase).
– `phaseChangeRate`: The rate of phase change.
– `Q`: Heat flow rate.
6. **Branches**: These are connections between different parts of the network. Here, the heat flow `Q` from node `M` to another part of the network is defined.
7. **Equations**: These describe the mathematical relationships between the different variables and parameters. They include:
– Relationships between `T`, `Q`, `m`, and other variables, especially around phase change.
– Constraints on certain values (like that `Cps`, `Cpl`, and `T` must be positive).
8. **Connections**: These are the actual connections between the different nodes within the component. Here, node `M` is connected to node `N`.
The essence of this component is that it models a thermal mass that can store and release energy. It also accounts for phase changes, meaning it can melt or solidify within a certain temperature range.
component derdecomponent
% Thermal Mass
% This block models internal energy storage in a thermal network.
nodes
M = foundation.thermal.thermal; % :top
end
inputs(ExternalAccess = none)
Mdot = {0, ‘kg/s’}; % Mdot:bottom
T_in = {300, ‘K’}; % Tin:bottom
end
nodes(ExternalAccess = none)
N = foundation.thermal.thermal; % :bottom
end
parameters
mass_type = foundation.enum.constant_variable.constant; % Mass type
end
parameters (ExternalAccess = none)
mass = {1, ‘kg’}; % Mass
end
parameters
Cps = {200, ‘J/(kg*K)’}; % Specific heat solid
Cpl = {1000, ‘J/(kg*K)’}; % Specific heat liquid
Tmelt_start = {320, ‘K’}; % Start Melting Temperature
Tmelt_end = {305, ‘K’}; % End Melting Temperature
L = {100, ‘J/(kg)’}; % Specific Latent Heat
end
parameters (ExternalAccess = none)
mass_min = {1e-6,’kg’}; % Minimum mass
end
parameters
num_ports = foundation.enum.numPorts2.one; % Number of graphical ports
end
if num_ports == 2
annotations
N : ExternalAccess=modify
end
if mass_type == foundation.enum.constant_variable.constant
annotations
% Icon = ‘mass2.svg’
end
else
annotations
% Icon = ‘mass4.svg’
end
end
else
if mass_type == foundation.enum.constant_variable.variable
annotations
% Icon = ‘mass3.svg’
end
end
end
if mass_type == foundation.enum.constant_variable.constant
annotations
mass : ExternalAccess=modify
end
equations
m == {1,’kg’};
end
else
annotations
[Mdot, T_in, m, mass_min] : ExternalAccess=modify
end
equations
assert(mass_min > 0)
end
end
variables (ExternalAccess=none)
m = {value = {1,’kg’}, priority=priority.high}; % Mass
end
variables
T = {value = {300, ‘K’}, priority = priority.high}; % Temperature
phase = {value = {0, ‘1’}, priority = priority.high}; % Phase
phaseChangeRate = {0, ‘1/s’}; % Rate of phase change
end
variables (Access=private)
Q = {0, ‘W’}; % Heat flow rate
end
branches
Q : M.Q -> *;
end
equations
assert(Cps > 0 && Cpl > 0)
assert(T > 0, ‘Temperature must be greater than absolute zero’)
T == M.T;
if T >= Tmelt_start && T <= Tmelt_end
phaseChangeRate == {0.001, ‘1/s’};
else
phaseChangeRate == {0, ‘1/s’};
end
if phase < 1 && phase > 0
Q == m * Cps * T.der + m * L * phaseChangeRate;
phase.der == phaseChangeRate;
else
Q == m * Cpl * T.der;
phase.der == {0, ‘1/s’};
end
end
connections
connect(M,N)
end
endProblem:
When I adjust the latent heat, there’s no change in the temperature curve of the XPS material. I anticipate a stable temperature, ranging between 305K and 320K. So the problem is that the material does not release the absorbed heat.
equations
assert(Cps > 0 && Cpl > 0)
assert(T > 0, ‘Temperature must be greater than absolute zero’)
T == M.T;
if T >= Tmelt_start && T <= Tmelt_end
phaseChangeRate == {0.001, ‘1/s’};
else
phaseChangeRate == {0, ‘1/s’};
end
if phase < 1 && phase > 0
Q == m * Cps * T.der + m * L * phaseChangeRate;
phase.der == phaseChangeRate;
else
Q == m * Cpl * T.der;
phase.der == {0, ‘1/s’};
end
end
explanation of the full code:
This code describes a thermal component that models internal energy storage in a thermal network. Here’s a breakdown of the main parts of this code:
1. **Nodes**: These are points where other components can connect. Two thermal nodes are defined: `M` (top) and `N` (bottom).
2. **Inputs**: These values can be supplied from outside. `Mdot` represents the mass flow rate (in kg/s) and `T_in` is the input temperature (in Kelvin).
3. **Parameters**: These values determine the behavior of the component. They include:
– `mass_type`: Type of mass (constant or variable).
– `mass`: The mass of the thermal component.
– `Cps` and `Cpl`: Specific heat capacity for solid and liquid, respectively.
– `Tmelt_start` and `Tmelt_end`: The temperature range where the material starts melting and stops melting.
– `L`: Specific latent heat.
– `mass_min`: Minimum mass.
– `num_ports`: The number of graphical ports.
4. **Annotations**: These are metadata that provide additional information about the component or dictate how it is displayed in a GUI. Here, it is primarily used to indicate which parameters can be modified externally and to define the component’s icon.
5. **Variables**: These represent the internal states of the component. They include:
– `m`: The mass.
– `T`: The temperature.
– `phase`: The phase (0 for solid, 1 for liquid, and values in between for a mixed phase).
– `phaseChangeRate`: The rate of phase change.
– `Q`: Heat flow rate.
6. **Branches**: These are connections between different parts of the network. Here, the heat flow `Q` from node `M` to another part of the network is defined.
7. **Equations**: These describe the mathematical relationships between the different variables and parameters. They include:
– Relationships between `T`, `Q`, `m`, and other variables, especially around phase change.
– Constraints on certain values (like that `Cps`, `Cpl`, and `T` must be positive).
8. **Connections**: These are the actual connections between the different nodes within the component. Here, node `M` is connected to node `N`.
The essence of this component is that it models a thermal mass that can store and release energy. It also accounts for phase changes, meaning it can melt or solidify within a certain temperature range.
component derdecomponent
% Thermal Mass
% This block models internal energy storage in a thermal network.
nodes
M = foundation.thermal.thermal; % :top
end
inputs(ExternalAccess = none)
Mdot = {0, ‘kg/s’}; % Mdot:bottom
T_in = {300, ‘K’}; % Tin:bottom
end
nodes(ExternalAccess = none)
N = foundation.thermal.thermal; % :bottom
end
parameters
mass_type = foundation.enum.constant_variable.constant; % Mass type
end
parameters (ExternalAccess = none)
mass = {1, ‘kg’}; % Mass
end
parameters
Cps = {200, ‘J/(kg*K)’}; % Specific heat solid
Cpl = {1000, ‘J/(kg*K)’}; % Specific heat liquid
Tmelt_start = {320, ‘K’}; % Start Melting Temperature
Tmelt_end = {305, ‘K’}; % End Melting Temperature
L = {100, ‘J/(kg)’}; % Specific Latent Heat
end
parameters (ExternalAccess = none)
mass_min = {1e-6,’kg’}; % Minimum mass
end
parameters
num_ports = foundation.enum.numPorts2.one; % Number of graphical ports
end
if num_ports == 2
annotations
N : ExternalAccess=modify
end
if mass_type == foundation.enum.constant_variable.constant
annotations
% Icon = ‘mass2.svg’
end
else
annotations
% Icon = ‘mass4.svg’
end
end
else
if mass_type == foundation.enum.constant_variable.variable
annotations
% Icon = ‘mass3.svg’
end
end
end
if mass_type == foundation.enum.constant_variable.constant
annotations
mass : ExternalAccess=modify
end
equations
m == {1,’kg’};
end
else
annotations
[Mdot, T_in, m, mass_min] : ExternalAccess=modify
end
equations
assert(mass_min > 0)
end
end
variables (ExternalAccess=none)
m = {value = {1,’kg’}, priority=priority.high}; % Mass
end
variables
T = {value = {300, ‘K’}, priority = priority.high}; % Temperature
phase = {value = {0, ‘1’}, priority = priority.high}; % Phase
phaseChangeRate = {0, ‘1/s’}; % Rate of phase change
end
variables (Access=private)
Q = {0, ‘W’}; % Heat flow rate
end
branches
Q : M.Q -> *;
end
equations
assert(Cps > 0 && Cpl > 0)
assert(T > 0, ‘Temperature must be greater than absolute zero’)
T == M.T;
if T >= Tmelt_start && T <= Tmelt_end
phaseChangeRate == {0.001, ‘1/s’};
else
phaseChangeRate == {0, ‘1/s’};
end
if phase < 1 && phase > 0
Q == m * Cps * T.der + m * L * phaseChangeRate;
phase.der == phaseChangeRate;
else
Q == m * Cpl * T.der;
phase.der == {0, ‘1/s’};
end
end
connections
connect(M,N)
end
end Problem:
When I adjust the latent heat, there’s no change in the temperature curve of the XPS material. I anticipate a stable temperature, ranging between 305K and 320K. So the problem is that the material does not release the absorbed heat.
equations
assert(Cps > 0 && Cpl > 0)
assert(T > 0, ‘Temperature must be greater than absolute zero’)
T == M.T;
if T >= Tmelt_start && T <= Tmelt_end
phaseChangeRate == {0.001, ‘1/s’};
else
phaseChangeRate == {0, ‘1/s’};
end
if phase < 1 && phase > 0
Q == m * Cps * T.der + m * L * phaseChangeRate;
phase.der == phaseChangeRate;
else
Q == m * Cpl * T.der;
phase.der == {0, ‘1/s’};
end
end
explanation of the full code:
This code describes a thermal component that models internal energy storage in a thermal network. Here’s a breakdown of the main parts of this code:
1. **Nodes**: These are points where other components can connect. Two thermal nodes are defined: `M` (top) and `N` (bottom).
2. **Inputs**: These values can be supplied from outside. `Mdot` represents the mass flow rate (in kg/s) and `T_in` is the input temperature (in Kelvin).
3. **Parameters**: These values determine the behavior of the component. They include:
– `mass_type`: Type of mass (constant or variable).
– `mass`: The mass of the thermal component.
– `Cps` and `Cpl`: Specific heat capacity for solid and liquid, respectively.
– `Tmelt_start` and `Tmelt_end`: The temperature range where the material starts melting and stops melting.
– `L`: Specific latent heat.
– `mass_min`: Minimum mass.
– `num_ports`: The number of graphical ports.
4. **Annotations**: These are metadata that provide additional information about the component or dictate how it is displayed in a GUI. Here, it is primarily used to indicate which parameters can be modified externally and to define the component’s icon.
5. **Variables**: These represent the internal states of the component. They include:
– `m`: The mass.
– `T`: The temperature.
– `phase`: The phase (0 for solid, 1 for liquid, and values in between for a mixed phase).
– `phaseChangeRate`: The rate of phase change.
– `Q`: Heat flow rate.
6. **Branches**: These are connections between different parts of the network. Here, the heat flow `Q` from node `M` to another part of the network is defined.
7. **Equations**: These describe the mathematical relationships between the different variables and parameters. They include:
– Relationships between `T`, `Q`, `m`, and other variables, especially around phase change.
– Constraints on certain values (like that `Cps`, `Cpl`, and `T` must be positive).
8. **Connections**: These are the actual connections between the different nodes within the component. Here, node `M` is connected to node `N`.
The essence of this component is that it models a thermal mass that can store and release energy. It also accounts for phase changes, meaning it can melt or solidify within a certain temperature range.
component derdecomponent
% Thermal Mass
% This block models internal energy storage in a thermal network.
nodes
M = foundation.thermal.thermal; % :top
end
inputs(ExternalAccess = none)
Mdot = {0, ‘kg/s’}; % Mdot:bottom
T_in = {300, ‘K’}; % Tin:bottom
end
nodes(ExternalAccess = none)
N = foundation.thermal.thermal; % :bottom
end
parameters
mass_type = foundation.enum.constant_variable.constant; % Mass type
end
parameters (ExternalAccess = none)
mass = {1, ‘kg’}; % Mass
end
parameters
Cps = {200, ‘J/(kg*K)’}; % Specific heat solid
Cpl = {1000, ‘J/(kg*K)’}; % Specific heat liquid
Tmelt_start = {320, ‘K’}; % Start Melting Temperature
Tmelt_end = {305, ‘K’}; % End Melting Temperature
L = {100, ‘J/(kg)’}; % Specific Latent Heat
end
parameters (ExternalAccess = none)
mass_min = {1e-6,’kg’}; % Minimum mass
end
parameters
num_ports = foundation.enum.numPorts2.one; % Number of graphical ports
end
if num_ports == 2
annotations
N : ExternalAccess=modify
end
if mass_type == foundation.enum.constant_variable.constant
annotations
% Icon = ‘mass2.svg’
end
else
annotations
% Icon = ‘mass4.svg’
end
end
else
if mass_type == foundation.enum.constant_variable.variable
annotations
% Icon = ‘mass3.svg’
end
end
end
if mass_type == foundation.enum.constant_variable.constant
annotations
mass : ExternalAccess=modify
end
equations
m == {1,’kg’};
end
else
annotations
[Mdot, T_in, m, mass_min] : ExternalAccess=modify
end
equations
assert(mass_min > 0)
end
end
variables (ExternalAccess=none)
m = {value = {1,’kg’}, priority=priority.high}; % Mass
end
variables
T = {value = {300, ‘K’}, priority = priority.high}; % Temperature
phase = {value = {0, ‘1’}, priority = priority.high}; % Phase
phaseChangeRate = {0, ‘1/s’}; % Rate of phase change
end
variables (Access=private)
Q = {0, ‘W’}; % Heat flow rate
end
branches
Q : M.Q -> *;
end
equations
assert(Cps > 0 && Cpl > 0)
assert(T > 0, ‘Temperature must be greater than absolute zero’)
T == M.T;
if T >= Tmelt_start && T <= Tmelt_end
phaseChangeRate == {0.001, ‘1/s’};
else
phaseChangeRate == {0, ‘1/s’};
end
if phase < 1 && phase > 0
Q == m * Cps * T.der + m * L * phaseChangeRate;
phase.der == phaseChangeRate;
else
Q == m * Cpl * T.der;
phase.der == {0, ‘1/s’};
end
end
connections
connect(M,N)
end
end phasechangingmaterial, heattransfer MATLAB Answers — New Questions
Simulink zoom / scroll problem on MacBook Pro trackpad
When I two-finger scroll on my trackpad to zoom a Simulink model, it
zooms in and out rapidly and erratically. Moreoever, pinch-to-zoom
produces no zooming effect.
This problem was noted here:
http://lizard-spock.co.uk/blog/engineering/simulink-scroll-wheel-erratic-behaviour/
They advised disabling scroll-wheel zoom altogether with
File > Simulink Prefs > Editor defaults > Scroll wheel controls zooming preference.
However, the zoom feature is essential for fast model navigation.
I have tried twiddling various settings on the Mac Trackpad system preferences, no luck.
The following Mathworks doc claims that pinch-to-zoom and regular
scroll-zoom should work, but it doesn’t for me.
http://www.mathworks.com/help/simulink/ug/zooming-block-diagrams.html
Has anyone solved this?
("Use a mouse" and "just click the zoom button" are not acceptable
answers, since I don’t want to lug a mouse around just for Matlab and
having to click a button is a crappy UI constraint on something that
should be natural.)
Thanks for your help.When I two-finger scroll on my trackpad to zoom a Simulink model, it
zooms in and out rapidly and erratically. Moreoever, pinch-to-zoom
produces no zooming effect.
This problem was noted here:
http://lizard-spock.co.uk/blog/engineering/simulink-scroll-wheel-erratic-behaviour/
They advised disabling scroll-wheel zoom altogether with
File > Simulink Prefs > Editor defaults > Scroll wheel controls zooming preference.
However, the zoom feature is essential for fast model navigation.
I have tried twiddling various settings on the Mac Trackpad system preferences, no luck.
The following Mathworks doc claims that pinch-to-zoom and regular
scroll-zoom should work, but it doesn’t for me.
http://www.mathworks.com/help/simulink/ug/zooming-block-diagrams.html
Has anyone solved this?
("Use a mouse" and "just click the zoom button" are not acceptable
answers, since I don’t want to lug a mouse around just for Matlab and
having to click a button is a crappy UI constraint on something that
should be natural.)
Thanks for your help. When I two-finger scroll on my trackpad to zoom a Simulink model, it
zooms in and out rapidly and erratically. Moreoever, pinch-to-zoom
produces no zooming effect.
This problem was noted here:
http://lizard-spock.co.uk/blog/engineering/simulink-scroll-wheel-erratic-behaviour/
They advised disabling scroll-wheel zoom altogether with
File > Simulink Prefs > Editor defaults > Scroll wheel controls zooming preference.
However, the zoom feature is essential for fast model navigation.
I have tried twiddling various settings on the Mac Trackpad system preferences, no luck.
The following Mathworks doc claims that pinch-to-zoom and regular
scroll-zoom should work, but it doesn’t for me.
http://www.mathworks.com/help/simulink/ug/zooming-block-diagrams.html
Has anyone solved this?
("Use a mouse" and "just click the zoom button" are not acceptable
answers, since I don’t want to lug a mouse around just for Matlab and
having to click a button is a crappy UI constraint on something that
should be natural.)
Thanks for your help. simulink, trackpad, zoom MATLAB Answers — New Questions