Category: News
Accelerate your observability journey with Azure Monitor pipeline (preview)
In the ever-evolving landscape of digital infrastructure, transparency in resource and application performance is imperative. Success hinges on visibility, and that’s true whether you’re operating on Azure, on-premise, or at the edge. As organizations scale their infrastructures and applications, the volume of observability data naturally increases. This surge can complicate the management of networking, data storage and ingestion, often forcing a trade-off between cost management and observability.
The complexity doesn’t end there. The very tools designed to ingest, process, and route this data can be both costly and complex, adding layers of operational challenges. Moreover, edge infrastructure is deployed near IoT devices for optimal data processing, high availability, and reduced latency. This adds its own set of challenges when it comes to collecting telemetry from such constrained environments.
Recognizing these challenges, our team has been focused on providing a robust, highly scalable, and secure data ingestion solution through Azure Monitor. We are thrilled to announce the preview of the Azure Monitor pipeline at edge.
What is Azure Monitor pipeline?
Azure Monitor pipeline, similar to ETL (Extract, Transform, Load) process, enhances traditional data collection methods. It streamlines data collection from various sources through a unified ingestion pipeline and utilizes a standardized configuration approach that is more efficient and scalable. This is particularly beneficial for cloud-based monitoring in Azure.
We are now extending our Azure Monitor pipeline capabilities from the cloud to the edge, enabling high-scale data ingestion with centralized configuration management.
What is Azure Monitor pipeline at edge?
Azure Monitor pipeline at edge is a powerful solution designed to facilitate high-scale data ingestion and routing from edge environments to Azure Monitor for observability. It leverages the robust capabilities of the vendor-agnostic tool – OpenTelemetry Collector, which is used by enterprises worldwide to manage high volumes of telemetry each month.
With the Azure Monitor pipeline at edge, organizations can tap into the same highly scalable platform with a standardized configuration and reliability. Whether dealing with petabytes of data or seeking consistent observability experience across Azure, edge, and multi-cloud, this solution empowers organizations to reliably collect telemetry and drive operational excellence.
The Azure Monitor pipeline at edge is equipped with out-of-the-box capabilities to receive telemetry from a diverse range of resources and route it to Azure Monitor. Here are some key features:
High scale data ingestion: Customers have various devices and resources at edge, emitting high volume of data. With Azure Monitor pipeline at edge, you can seamlessly scale to support ingestion of high volume of data in the cloud. Azure Monitor pipeline can be deployed on your on-premises Kubernetes cluster as an Arc Kubernetes cluster extension. This allows it to adapt to your data scaling needs by running multiple replica sets and provides you with full control to define workflows and route high-volume data to Azure Monitor.
Observing resources in isolated environments: In the manufacturing sector, resources are often located in isolated network zones without direct cloud connectivity, posing challenges for telemetry collection. With the Azure Monitor pipeline at edge, combined with Azure IoT Layered Network Management, you can facilitate a connection between Azure and Kubernetes clusters in isolated networks, deploy the Azure Monitor pipeline at edge, collect data from resources in segmented networks, and route it to Azure Monitor for comprehensive observability.
Reliable data ingestion and prevent data loss: Edge environments frequently encounter intermittent connectivity, leading to potential data loss and disrupting data continuity. The Azure Monitor pipeline at edge allows you to cache logs during periods of intermittent connectivity. When connectivity is re-established, your data is synchronized with Azure Monitor, preventing data loss.
Getting started
It’s super easy to get started! You need to deploy the Azure Monitor pipeline on a single Arc-enabled Kubernetes cluster in your environment. Once that is done, you can configure your resources to emit the telemetry to Azure Monitor pipeline at edge and ingest into Azure Monitor for observability.
Once you Arc-enable your on-prem Kubernetes cluster and the prerequisites are met, go the Extension section, select Azure Monitor pipeline extension (preview) and create the instance. Alternatively, from the search bar in the Azure portal, select Azure Monitor pipeline and then click Create.
Enter the information related to the pipeline instance.
The Dataflow tab allows you to create and edit dataflows for the pipeline instance.
Configure your resources to emit the telemetry to the Azure Monitor pipeline.
Learn more in our documentation.
Pricing
There is no additional cost to use Azure Monitor pipeline to send data to Azure Monitor. You will be only charged for data ingestion as per the current pricing.
FAQ
What telemetry can be collected using Azure Monitor pipeline? Currently, in public preview, you can collect syslogs and OTLP logs using Azure Monitor pipeline at edge. We will keep expanding the data collection capabilities based on your feedback and requirements.
How can I perform transformations on the telemetry that is collected? You can certainly transform your telemetry! Since this is an extension of Azure Monitor pipeline, you can perform the data collection transformations in the Azure Monitor pipeline at cloud.
Is this another agent for data collection? Azure Monitor pipeline at edge is engineered to function in environments where installing agents on resources is not feasible, whether due to technical limitations or warranty concerns. It enables you to get the telemetry from these resources and acts as a central forwarding component to ingest high volume data.
I have 100 Linux servers in my on-prem environment. Do I need to deploy Azure Monitor pipeline at edge on all of them? You need to deploy the Azure Monitor pipeline at edge on a single Arc-enabled Kubernetes cluster and configure it to ingest data into Azure Monitor. Once that is completed, you can configure your Linux servers to emit telemetry to the Azure Monitor pipeline at edge instance.
Microsoft Tech Community – Latest Blogs –Read More
Hannover Messe 2024: Scaling Industrial Transformation with Azure’s Adaptive Cloud Approach
As I reflect on Hannover Messe International 2024, it was amazing to see how industrial organizations are embracing this year’s show theme of “energizing a sustainable industry”. Large industry events such as these are incredibly valuable, as we get the opportunity to meet with many of the customers and partners who inform and guide our strategy in this space. This year, we were excited to share our vision for how Azure’s adaptive cloud approach provides the foundation for scaling industrial transformation efforts to the next level. Announcements include how we’re working with the ecosystem to empower customers to do more with their data, new capabilities to help customers build secure, resilient and observable edge applications, and how we’re making it simpler to manage Azure resources in a cohesive way across distributed physical operations.
The opportunity for industrial transformation with an adaptive cloud approach
Today, we’re at an inflection point where two of the most significant technology trends – – are converging to create meaningful outcomes for industrial customers. AI and advanced analytics tools provide the intelligence to optimize business processes, while the cloud offers the global footprint required to scale those outcomes organization-wide, including physical operations. Customers such as
Chevron are committed to responsibly applying AI to achieve its objectives of delivering safer and more efficient operations. And Electrolux Group is leveraging the cloud and advanced analytics to keep quality at the forefront of their global manufacturing processes.
Defining the adaptive cloud approach
To drive comprehensive organizational transformation, customers need to be able to harness data across a distributed estate that typically spans a variety of people, places, and processes. To date, however, many organizations have taken a decentralized approach to digitizing physical operations environments that has challenged their ability to successfully scale business outcomes. Today, we see the opportunity for a new approach; one that uses the cloud as a consistent operations and innovation platform to drive visibility, repeatability, and scalability across heterogeneous edge environments. This approach, referred to as adaptive cloud, brings separate teams, sites, and systems into a unified model for operations, applications, and data, so organizations can take advantage of AI across a global operational estate.
Applying the adaptive cloud approach in physical operations environments
This standardized approach to data, applications and management, is enabled by Azure Arc, which allows organizations to leverage best of breed Azure capabilities across their entire computing estate for repeatability and scale. Azure IoT Operations, currently in public preview, allows organizations to extend these benefits to their physical operations environments with a unified, enterprise-wide technology architecture and data plane that democratizes data, enables cross-team collaboration, and accelerates decision-making. With Azure IoT Operations, enabled by Azure Arc, data and operational technology professionals can cultivate insights across digital and physical operations with a contextualized edge to cloud data fabric, while developers can rapidly build and deploy intelligent applications across boundaries with a consistent set of application development, deployment and management tools and methodologies. In parallel, IT can remove complexity by centralizing management, security processes, and policies across distributed applications and infrastructure.
The importance of the ecosystem within physical operations environments
As mentioned earlier, physical operations environments have traditionally been managed in a decentralized way. The reason for this paradigm is the highly heterogenous nature of such environments, which often include assets and devices built by various manufacturers, each with their own tooling and applications. Success in this market won’t be achieved by trying to replace the unique value that these ecosystem partners bring to the table. Instead, as a platform company, Microsoft’s goal is to provide an open, common pattern that partners can utilize, together providing customers with a common foundation for their industrial applications. This common foundation provides customers with a single place to manage these highly complex environments, as well as the benefit of being able to integrate data from different solutions and sites together for enterprise-wide insights. Partners not only benefit from a customer-centric approach, but also by being able to deliver solutions faster using the flexible, standards-based reference architecture offered by Azure IoT Operations.
Announcements
Today, we have several exciting product and partner announcements that will help industrial customers embrace the transformative benefits of the adaptive cloud approach.
Enabling insights at scale with an open, interoperable foundation
At Microsoft, we are committed to empowering our customers to achieve more with their data and unlocking new insights and opportunities across the industrial ecosystem.
For customers to cultivate insights across their operational environments, they first need access to the data sitting within their industrial assets – and to be able to get that data into a format that will be usable by other applications. To assist with these efforts, Microsoft is working with the ecosystem of connectivity partners for Azure IoT Operations to modernize industrial systems and devices. These partners provide data translation and normalization services across heterogeneous environments for a seamless and secure data flow from the shop floor to the cloud. We leverage open standards and provide consistent control and management capabilities for OT and IT assets. To date, we have established integrations with connectivity partners Advantech, PTC, and Softing that are uniquely positioned in their field and enable a wide range of customers. Beyond connectivity, we are also partnering with Rockwell Automation to deliver a set of composable solutions that take advantage of the adaptive cloud approach to unlock the promise of rapid digital transformation at scale across manufacturing scenarios.
Additionally, to help drive interoperability across edge applications, edge devices, and edge orchestration software, Microsoft is also proud to participate and contribute to Margo, a new open standard initiative for interoperability at the edge of industrial automation ecosystems. Hosted by The Linux Foundation, the Margo initiative defines the mechanisms for interoperability between edge applications, edge devices, and edge orchestration software to help accelerate building, operating, and scaling complex automation solutions at the edge. It will help customers grow operations quicker and help them achieve their digital transformation objectives faster.
Ultimately, the goal of these intelligent applications is to support better decision-making. Digital twins allow organizations to optimize decision-making by modelling possibilities based on actual past outcomes and the predicted future. In this area, in collaborative move with the W3C Consortium, Siemens and Microsoft have announced the convergence of the Digital Twin Definition Language (DTDL), the language used by Azure Digital Twins to describe digital twin models and interfaces, with the W3C Web of Things standard. This convergence will help consolidate digital twin definitions for assets in the industry and enable new technology innovation like automatic asset onboarding with the help of generative AI technologies.
Providing enterprise class resiliency, observability and security for edge applications
While Azure IoT Operations provides the foundation for industrial data flow, customer use cases are implemented in applications running on the edge that use that data. To that end, we’re investing in new capabilities to make it easier to build those applications. Today, we’re excited to announce three new capabilities for the development of enterprise-class Kubernetes applications running on the edge in the realms of application resiliency, observability and security.
Edge Storage Accelerator public preview – At the edge, Kubernetes storage capabilities vary in durability, persistence, and performance, posing a challenge for customers seeking reliable solutions. To address these challenges, we recently introduced Edge Storage Accelerator (ESA), a storage system designed for Arc-connected Kubernetes clusters. ESA offers fault-tolerant, highly available cloud-native persistent storage, empowering customers to confidently host stateful applications like Azure IoT Operations, custom apps, and other Arc extensions with ease and reliability. Through standard Kubernetes APIs, users can effortlessly attach containerized applications managing file data stored on Azure Blob storage, leveraging its limitless cloud storage capacity for edge applications. ESA’s flexible deployment options, simplified connection via a Container Storage Interface (CSI) driver, and platform neutrality transforms edge storage solutions, alleviating customer pain points and enabling seamless operations at the edge.
Azure Monitor pipeline public preview – As enterprises scale their infrastructure and applications, the volume of observability data naturally increases, and it is challenging to collect telemetry from certain restricted environments. With today’s announcement, we are extending our Azure Monitor pipeline at the edge to enable customers to collect telemetry at scale from their edge environment and route to Azure Monitor for observability. With Azure Monitor pipeline at edge, customers can collect telemetry from the resources in segmented networks that do not have a line of sight to cloud. Additionally, the pipeline prevents data loss by caching the telemetry locally during intermittent connectivity periods and backfilling to the cloud, improving reliability and resiliency.
Secrets Sync Controller private preview – Industrial customers want the confidence and scalability that comes with unified secrets management in the cloud, while maintaining disconnection-resilience for operational activities at the edge. To help them with this, the new Secret Synchronization Controller for Kubernetes (currently in private preview) automatically synchronizes secrets from an Azure Key Vault to a Kubernetes cluster for offline access. This means customers can use Azure Key Vault to store, maintain, and rotate secrets, even when running a Kubernetes cluster in a semi-disconnected state. Synchronized secrets are stored in the cluster secret store, making them available as Kubernetes secrets to be used in all the usual ways—mounted as data volumes or exposed as environment variables to a container in a Pod.
Delivering simplified, cohesive management of physical operations environments
During HMI last week, we were also excited to announce the public preview of Azure Arc site manager. Arc site manager extends existing grouping constructs in Azure, allowing customers to group their resources, including Azure IoT Operations clusters, and assets by physical location. IT professionals can use Arc site manager to create sites to organize their Arc-enabled servers, clusters, and other assets, and view aggregated monitoring data. Arc site manager simplifies the overall monitoring and management of Azure resources by integrating individual resource pages, Azure Monitor, Update Management Center, and other offerings into a single cohesive experience. With Arc site manager, IT administrators can easily monitor health, updates, security, and other key areas for each site. Because Azure IoT Operations, along with the new services announced today are all Kubernetes based Arc-enabled services, they can be centrally managed using Arc site manager.
In addition to Azure Arc site manager, we also demonstrated a new Azure edge infrastructure solution for small form factor devices like the Lenovo ThinkEdge SE30 at the show. This new solution, which supported our Azure IoT Operations demo on the expo floor, runs AKS enabled by Azure Arc directly on bare metal with Azure Linux, with the option to cluster multiple nodes for availability. To learn more and register interest for the preview, head over to the Azure Stack blog.
We want to thank all the customers, partners and attendees who engaged with us at Hannover Messe 2024. We firmly believe Azure’s open and standardized strategy, an adaptive cloud approach, can help industrial organizations reach the next level of transformation and we’re excited to partner with you on that journey.
To learn more about how Azure’s adaptive cloud approach can help you cultivate insights across digital and physical operations, please read our latest blogs:
Advancing hybrid cloud to adaptive cloud with Azure | Microsoft Azure Blog
Harmonizing AI-enhanced physical and cloud operations | Microsoft Azure Blog
Accelerating Industrial Transformation with Azure IoT Operations – Microsoft Community Hub
Microsoft Tech Community – Latest Blogs –Read More
Sync time of the loop and the time step of the simulation
Dear all,
I am using a For loop in my simulink model. Let’s say simple factorial function.
It receives a number(for instance 4) and returns the factorial of the input(24).
1) The main question is
The whole loops (i=1,…4) occurs in one single time stamp of the simulation. Also at the MATLAB document I found a note that
"Simulation time does not advance during iterative executions of a While/(For) Iterator Subsystem block. Nevertheless, blocks in the subsystem treat each iteration as a time step. .."
This is not what I want.
I want in a single step of my simulation i turns to 1, then in the next step it becomes 2, and ,….
How I can do that?
(The type of the solver selection is Fixed-Step but the simulation time is 10 seconds, but we do not want to change the simulation time starting and ending)
2) Does the functions that we wrote as MATLAb function that has a loop inside the code, treats similarly?
I mean the whole code is run once in one single step.
If yes, How I can change the code so each iteration performs in each single step of the simulation.
3) When I do not select "states when starting" to "reset", it returns zero as an output(I already set initial value of the delay to 1). I do not undrestand why?
Thanks…Dear all,
I am using a For loop in my simulink model. Let’s say simple factorial function.
It receives a number(for instance 4) and returns the factorial of the input(24).
1) The main question is
The whole loops (i=1,…4) occurs in one single time stamp of the simulation. Also at the MATLAB document I found a note that
"Simulation time does not advance during iterative executions of a While/(For) Iterator Subsystem block. Nevertheless, blocks in the subsystem treat each iteration as a time step. .."
This is not what I want.
I want in a single step of my simulation i turns to 1, then in the next step it becomes 2, and ,….
How I can do that?
(The type of the solver selection is Fixed-Step but the simulation time is 10 seconds, but we do not want to change the simulation time starting and ending)
2) Does the functions that we wrote as MATLAb function that has a loop inside the code, treats similarly?
I mean the whole code is run once in one single step.
If yes, How I can change the code so each iteration performs in each single step of the simulation.
3) When I do not select "states when starting" to "reset", it returns zero as an output(I already set initial value of the delay to 1). I do not undrestand why?
Thanks… Dear all,
I am using a For loop in my simulink model. Let’s say simple factorial function.
It receives a number(for instance 4) and returns the factorial of the input(24).
1) The main question is
The whole loops (i=1,…4) occurs in one single time stamp of the simulation. Also at the MATLAB document I found a note that
"Simulation time does not advance during iterative executions of a While/(For) Iterator Subsystem block. Nevertheless, blocks in the subsystem treat each iteration as a time step. .."
This is not what I want.
I want in a single step of my simulation i turns to 1, then in the next step it becomes 2, and ,….
How I can do that?
(The type of the solver selection is Fixed-Step but the simulation time is 10 seconds, but we do not want to change the simulation time starting and ending)
2) Does the functions that we wrote as MATLAb function that has a loop inside the code, treats similarly?
I mean the whole code is run once in one single step.
If yes, How I can change the code so each iteration performs in each single step of the simulation.
3) When I do not select "states when starting" to "reset", it returns zero as an output(I already set initial value of the delay to 1). I do not undrestand why?
Thanks… simulink, loop, for loop, simulation, iteration MATLAB Answers — New Questions
How can I get debug information for Polyspace Access running in Kubernetes?
When experiencing an issue with Polyspace Access installed in a Kubernetes cluster, how do I generate logs or reports that I can send to MathWorks Support to help diagnose the issue?When experiencing an issue with Polyspace Access installed in a Kubernetes cluster, how do I generate logs or reports that I can send to MathWorks Support to help diagnose the issue? When experiencing an issue with Polyspace Access installed in a Kubernetes cluster, how do I generate logs or reports that I can send to MathWorks Support to help diagnose the issue? MATLAB Answers — New Questions
How to plot contour ?
clc
clear
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define material properties and simulation parameters
n0 = 1; % Refractive index of air
ns = 1.46; % Refractive index of subtrate
% Parameters
lambda0=5e-6; % Wavelength of light in micrometers
frequency = linspace(58,67,1000);
c=3e8;
transmission=zeros(1,1000);
n01 = 1.578; % Refractive index of PS
n02 = 1.484; % Refractive index of PMMA
n=25;
nA = n01;
dA = lambda0/(4*nA); %% Thickness of First Layer in meters
nB = n02;
dB = lambda0/(4*nB); %% Thickness of Second Layer in meters
for i = 1:length(frequency)
f = frequency(i);
w=2*pi*f*1e12; %%% Angular frequency by frequency
DAA=dA * nA * (w/c);
DBB=dB * nB * (w/c);
%%% Transfer Matrix elements of first layer
ma11=cos(DAA); ma12=-1i*sin(DAA)/nA; ma21=-1i*nA*sin(DAA); ma22=cos(DAA);
MA=[ma11 ma12; ma21 ma22];
%%% Transfer MAtrix elements of Second layer
lb11=cos(DBB); lb12=-1i*sin(DBB)/nB; lb21=-1i*nB*sin(DBB); lb22=cos(DBB);
MB=[lb11 lb12; lb21 lb22];
M_total_P = (MB*MA)^n*(MA*MB)^n;
T1 = (2*ns/(ns*M_total_P(1,1)+ns*n0*M_total_P(1,2)+M_total_P(2,1)+n0*M_total_P(2,2)));
T=(n0 / ns) * abs(T1)^2;
transmission(i) = T;
end
plot(frequency,transmission)
this code is transmission spectra
I need a contour plot of this by varying the n01 and n02 with respect to Q factor
I did a program but is not working
can anyone help me
clc
clear
close all
tic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define material properties and simulation parameters
P = 0; %%% Hydrostatic pressure in MPa
n0 = 1; % Refractive index of air
ns = 1.46; % Refractive index of subtrate
% Parameters
lambda0=5e-6; % Wavelength of light in micrometers
%%% frequency Range
% f = 61.25; %% frequency in THz
frequency = linspace(58,67,1000);
c=3e8;
transmission=zeros(1,1000);
n01_ = linspace(1.3,4,25); % Refractive index of PS
n02_ = linspace(1.3,4,25); % Refractive index of PMMA
n=25;
% Q factor array
Q_factor_ = zeros(length(n01_), length(n02_));
for ii = 1:length(n01_)
n01 = n01_(ii);
nA = n01;
dA = lambda0/(4*nA); %% Thickness of First Layer in meters (varying with respect to n01)
for jj = 1:length(n02_)
n02 = n02_(jj);
nB = n02;
dB = lambda0/(4*nB); %% Thickness of Second Layer in meters (varying with respect to n02)
for i = 1:length(frequency)
f = frequency(i);
w=2*pi*f*1e12; %%% Angular frequency by frequency
DAA=dA * nA * (w/c); %%% (varying with respect to n01)
DBB=dB * nB * (w/c); %%% (varying with respect to n02)
%%% Transfer Matrix elements of first layer
ma11=cos(DAA); ma12=-1i*sin(DAA)/nA; ma21=-1i*nA*sin(DAA); ma22=cos(DAA);
MA=[ma11 ma12; ma21 ma22];
%%% Transfer MAtrix elements of Second layer
lb11=cos(DBB); lb12=-1i*sin(DBB)/nB; lb21=-1i*nB*sin(DBB); lb22=cos(DBB);
MB=[lb11 lb12; lb21 lb22];
M_total_P = (MB*MA)^n*(MA*MB)^n;
T1 = (2*ns/(ns*M_total_P(1,1)+ns*n0*M_total_P(1,2)+M_total_P(2,1)+n0*M_total_P(2,2)));
T=(n0 / ns) * abs(T1)^2;
transmission(i) = T;
desired_freq = 60;
peak_idx = find((frequency) == (desired_freq));
peak_val = transmission(peak_idx);
half_max = peak_val / 2;
peak_left_edge = find(transmission(1:peak_idx) < half_max, 1, ‘last’);
peak_right_edge = find(transmission(peak_idx:end) < half_max, 1, ‘first’) + peak_idx – 1;
fwhm = frequency(peak_right_edge) – frequency(peak_left_edge); %%% full width at half maximum
% Calculate Q factor
Q = desired_freq ./ fwhm;
% Store Q factor in array
Q_factor_(:,:,i) = Q;
end
end
end
contourf(n01_,n02_,Q_factor_)clc
clear
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define material properties and simulation parameters
n0 = 1; % Refractive index of air
ns = 1.46; % Refractive index of subtrate
% Parameters
lambda0=5e-6; % Wavelength of light in micrometers
frequency = linspace(58,67,1000);
c=3e8;
transmission=zeros(1,1000);
n01 = 1.578; % Refractive index of PS
n02 = 1.484; % Refractive index of PMMA
n=25;
nA = n01;
dA = lambda0/(4*nA); %% Thickness of First Layer in meters
nB = n02;
dB = lambda0/(4*nB); %% Thickness of Second Layer in meters
for i = 1:length(frequency)
f = frequency(i);
w=2*pi*f*1e12; %%% Angular frequency by frequency
DAA=dA * nA * (w/c);
DBB=dB * nB * (w/c);
%%% Transfer Matrix elements of first layer
ma11=cos(DAA); ma12=-1i*sin(DAA)/nA; ma21=-1i*nA*sin(DAA); ma22=cos(DAA);
MA=[ma11 ma12; ma21 ma22];
%%% Transfer MAtrix elements of Second layer
lb11=cos(DBB); lb12=-1i*sin(DBB)/nB; lb21=-1i*nB*sin(DBB); lb22=cos(DBB);
MB=[lb11 lb12; lb21 lb22];
M_total_P = (MB*MA)^n*(MA*MB)^n;
T1 = (2*ns/(ns*M_total_P(1,1)+ns*n0*M_total_P(1,2)+M_total_P(2,1)+n0*M_total_P(2,2)));
T=(n0 / ns) * abs(T1)^2;
transmission(i) = T;
end
plot(frequency,transmission)
this code is transmission spectra
I need a contour plot of this by varying the n01 and n02 with respect to Q factor
I did a program but is not working
can anyone help me
clc
clear
close all
tic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define material properties and simulation parameters
P = 0; %%% Hydrostatic pressure in MPa
n0 = 1; % Refractive index of air
ns = 1.46; % Refractive index of subtrate
% Parameters
lambda0=5e-6; % Wavelength of light in micrometers
%%% frequency Range
% f = 61.25; %% frequency in THz
frequency = linspace(58,67,1000);
c=3e8;
transmission=zeros(1,1000);
n01_ = linspace(1.3,4,25); % Refractive index of PS
n02_ = linspace(1.3,4,25); % Refractive index of PMMA
n=25;
% Q factor array
Q_factor_ = zeros(length(n01_), length(n02_));
for ii = 1:length(n01_)
n01 = n01_(ii);
nA = n01;
dA = lambda0/(4*nA); %% Thickness of First Layer in meters (varying with respect to n01)
for jj = 1:length(n02_)
n02 = n02_(jj);
nB = n02;
dB = lambda0/(4*nB); %% Thickness of Second Layer in meters (varying with respect to n02)
for i = 1:length(frequency)
f = frequency(i);
w=2*pi*f*1e12; %%% Angular frequency by frequency
DAA=dA * nA * (w/c); %%% (varying with respect to n01)
DBB=dB * nB * (w/c); %%% (varying with respect to n02)
%%% Transfer Matrix elements of first layer
ma11=cos(DAA); ma12=-1i*sin(DAA)/nA; ma21=-1i*nA*sin(DAA); ma22=cos(DAA);
MA=[ma11 ma12; ma21 ma22];
%%% Transfer MAtrix elements of Second layer
lb11=cos(DBB); lb12=-1i*sin(DBB)/nB; lb21=-1i*nB*sin(DBB); lb22=cos(DBB);
MB=[lb11 lb12; lb21 lb22];
M_total_P = (MB*MA)^n*(MA*MB)^n;
T1 = (2*ns/(ns*M_total_P(1,1)+ns*n0*M_total_P(1,2)+M_total_P(2,1)+n0*M_total_P(2,2)));
T=(n0 / ns) * abs(T1)^2;
transmission(i) = T;
desired_freq = 60;
peak_idx = find((frequency) == (desired_freq));
peak_val = transmission(peak_idx);
half_max = peak_val / 2;
peak_left_edge = find(transmission(1:peak_idx) < half_max, 1, ‘last’);
peak_right_edge = find(transmission(peak_idx:end) < half_max, 1, ‘first’) + peak_idx – 1;
fwhm = frequency(peak_right_edge) – frequency(peak_left_edge); %%% full width at half maximum
% Calculate Q factor
Q = desired_freq ./ fwhm;
% Store Q factor in array
Q_factor_(:,:,i) = Q;
end
end
end
contourf(n01_,n02_,Q_factor_) clc
clear
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define material properties and simulation parameters
n0 = 1; % Refractive index of air
ns = 1.46; % Refractive index of subtrate
% Parameters
lambda0=5e-6; % Wavelength of light in micrometers
frequency = linspace(58,67,1000);
c=3e8;
transmission=zeros(1,1000);
n01 = 1.578; % Refractive index of PS
n02 = 1.484; % Refractive index of PMMA
n=25;
nA = n01;
dA = lambda0/(4*nA); %% Thickness of First Layer in meters
nB = n02;
dB = lambda0/(4*nB); %% Thickness of Second Layer in meters
for i = 1:length(frequency)
f = frequency(i);
w=2*pi*f*1e12; %%% Angular frequency by frequency
DAA=dA * nA * (w/c);
DBB=dB * nB * (w/c);
%%% Transfer Matrix elements of first layer
ma11=cos(DAA); ma12=-1i*sin(DAA)/nA; ma21=-1i*nA*sin(DAA); ma22=cos(DAA);
MA=[ma11 ma12; ma21 ma22];
%%% Transfer MAtrix elements of Second layer
lb11=cos(DBB); lb12=-1i*sin(DBB)/nB; lb21=-1i*nB*sin(DBB); lb22=cos(DBB);
MB=[lb11 lb12; lb21 lb22];
M_total_P = (MB*MA)^n*(MA*MB)^n;
T1 = (2*ns/(ns*M_total_P(1,1)+ns*n0*M_total_P(1,2)+M_total_P(2,1)+n0*M_total_P(2,2)));
T=(n0 / ns) * abs(T1)^2;
transmission(i) = T;
end
plot(frequency,transmission)
this code is transmission spectra
I need a contour plot of this by varying the n01 and n02 with respect to Q factor
I did a program but is not working
can anyone help me
clc
clear
close all
tic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define material properties and simulation parameters
P = 0; %%% Hydrostatic pressure in MPa
n0 = 1; % Refractive index of air
ns = 1.46; % Refractive index of subtrate
% Parameters
lambda0=5e-6; % Wavelength of light in micrometers
%%% frequency Range
% f = 61.25; %% frequency in THz
frequency = linspace(58,67,1000);
c=3e8;
transmission=zeros(1,1000);
n01_ = linspace(1.3,4,25); % Refractive index of PS
n02_ = linspace(1.3,4,25); % Refractive index of PMMA
n=25;
% Q factor array
Q_factor_ = zeros(length(n01_), length(n02_));
for ii = 1:length(n01_)
n01 = n01_(ii);
nA = n01;
dA = lambda0/(4*nA); %% Thickness of First Layer in meters (varying with respect to n01)
for jj = 1:length(n02_)
n02 = n02_(jj);
nB = n02;
dB = lambda0/(4*nB); %% Thickness of Second Layer in meters (varying with respect to n02)
for i = 1:length(frequency)
f = frequency(i);
w=2*pi*f*1e12; %%% Angular frequency by frequency
DAA=dA * nA * (w/c); %%% (varying with respect to n01)
DBB=dB * nB * (w/c); %%% (varying with respect to n02)
%%% Transfer Matrix elements of first layer
ma11=cos(DAA); ma12=-1i*sin(DAA)/nA; ma21=-1i*nA*sin(DAA); ma22=cos(DAA);
MA=[ma11 ma12; ma21 ma22];
%%% Transfer MAtrix elements of Second layer
lb11=cos(DBB); lb12=-1i*sin(DBB)/nB; lb21=-1i*nB*sin(DBB); lb22=cos(DBB);
MB=[lb11 lb12; lb21 lb22];
M_total_P = (MB*MA)^n*(MA*MB)^n;
T1 = (2*ns/(ns*M_total_P(1,1)+ns*n0*M_total_P(1,2)+M_total_P(2,1)+n0*M_total_P(2,2)));
T=(n0 / ns) * abs(T1)^2;
transmission(i) = T;
desired_freq = 60;
peak_idx = find((frequency) == (desired_freq));
peak_val = transmission(peak_idx);
half_max = peak_val / 2;
peak_left_edge = find(transmission(1:peak_idx) < half_max, 1, ‘last’);
peak_right_edge = find(transmission(peak_idx:end) < half_max, 1, ‘first’) + peak_idx – 1;
fwhm = frequency(peak_right_edge) – frequency(peak_left_edge); %%% full width at half maximum
% Calculate Q factor
Q = desired_freq ./ fwhm;
% Store Q factor in array
Q_factor_(:,:,i) = Q;
end
end
end
contourf(n01_,n02_,Q_factor_) contour, plot, for loop MATLAB Answers — New Questions
New Member Introduction and Question
Hi all,
Paul here.. I am new to MS Teams and Forms. My company merged into a regional one, and the management is big on tech. I enjoy working in the englineering and construction field because it gives me variety in environments and tasks. So far, I am comfortable with MS Office, especially the new Share feature, which lets me keep my reports on my OneDrive and share them with our admin! This is much better than the old attach to email method because I can fix mistakes and not have to send her multiple emails with the updates. Greetings!
My question:
We use “break cards” to record and transmit (via physical handoff) our laboratory data to the admin for relay to the clients. These cards are updated roughly 5 times over a month in data entry fields, but they also contain multiple fields such as job name and number that stay the same. I am in the Engineering/Construction field.
In perusing MS Forms, it seems this application is oriented towards surveys (administrative) and quizzes (education). Is there an anything for my application (above)?
Sincerely,
Paul
Hi all, Paul here.. I am new to MS Teams and Forms. My company merged into a regional one, and the management is big on tech. I enjoy working in the englineering and construction field because it gives me variety in environments and tasks. So far, I am comfortable with MS Office, especially the new Share feature, which lets me keep my reports on my OneDrive and share them with our admin! This is much better than the old attach to email method because I can fix mistakes and not have to send her multiple emails with the updates. Greetings! My question: We use “break cards” to record and transmit (via physical handoff) our laboratory data to the admin for relay to the clients. These cards are updated roughly 5 times over a month in data entry fields, but they also contain multiple fields such as job name and number that stay the same. I am in the Engineering/Construction field. In perusing MS Forms, it seems this application is oriented towards surveys (administrative) and quizzes (education). Is there an anything for my application (above)? Sincerely, Paul Read More
Is there a new CPOR Guide PDF?
I have this walk-through guide for claiming partner of record (CPOR). It’s from FY20 and the way you do it has since changed so it’s out of date. Is there a newer version anywhere?
Old FY20 version is here – https://partner.microsoft.com/en-us/asset/collection/claiming-partner-of-record-cpor-resources#/
I have this walk-through guide for claiming partner of record (CPOR). It’s from FY20 and the way you do it has since changed so it’s out of date. Is there a newer version anywhere?Old FY20 version is here – https://partner.microsoft.com/en-us/asset/collection/claiming-partner-of-record-cpor-resources#/ Read More
Improving the DevOps Experience for Azure Logic Apps Standard
With the trend towards distributed and native cloud apps, organizations are dealing with more distributed components across more environments. To maintain control and consistency, you can automate your environments and deploy more components faster with higher confidence by using DevOps tools and processes.
Azure Logic Apps Standard just launched a set of preview features that help you automate the steps in setting up DevOps processes for your applications. In this blog post, you will find more about these new features:
Parameterize connection references
Automate deployment scripts generation in Visual Studio Code
Enable zero downtime deployment scenarios
Parameterize connection references
Connectors in Azure Logic Apps enable seamless integration with external systems and services across different protocols, platforms, and authentication methods. Azure Logic Apps Standard separates the physical and logical aspects for connectors thanks to the connection reference file (connections.json), which maps the connections used in workflows to live connections using Azure Resources, Azure Functions, Azure API Management and in-app references).
Until now, these references were tied to the connection that you defined at design time, which made the process to abstract the code for multiple environments a manual process. However, starting with the Visual Studio Code extension for Azure Logic Apps version 4.4.3, connections are parameterized by default, which simplifies the process of deploying these applications to other environments.
What does connection reference parameterization look like?
In the connections.json file, new managed connections look like the following template:
“myconnection”: {
“api”: {
“id”: “/subscriptions/@{appsetting(‘WORKFLOWS_SUBSCRIPTION_ID’)}/providers/Microsoft.Web/locations/@{appsetting(‘WORKFLOWS_LOCATION_NAME’)}/managedApis/connectorname”
},
“connection”: {
“id”: “/subscriptions/@{appsetting(‘WORKFLOWS_SUBSCRIPTION_ID’)}/resourceGroups/@{appsetting(‘WORKFLOWS_RESOURCE_GROUP_NAME’)}/providers/Microsoft.Web/connections/myconnection”
},
“connectionRuntimeUrl”: “@{appsetting(myconnection-connectionRuntimeUrl’)}”,
“authentication”: “@parameters(myconnection-connectionAuthentication’)”
}
Property
Parameterization
api.id
Subscription and location are derived from app settings.
connection.id
Subscription and resource group are derived from app settings.
connection.connectionRuntimeUrl
This value is derived from app settings. The app setting key is defined as <connection_reference_name>-connectionRuntimeUrl.
connection.authentication
This value is derived from the parameters file. The key is defined as <connection_reference_name>-connectionAuthentication.
For connection authentication, a new entry is created in the parameters file, per the following template:
“myconnection-connectionAuthentication”: {
“type”: “Object”,
“value”: {
“type”: “Raw”,
“scheme”: “Key”,
“parameter”: “@appsetting(myconnection-connectionKey’)”
}
}
Note: As a secret, the connection key is referenced in your app settings. Connection keys have different values for local and Azure deployments. When deployed to Azure, the connection key value should reference the managed identity associated with your Standard logic app resource. The latest Visual Studio Code extension also has the capability to auto-generate deployment scripts, which makes sure that you have a ready-to-use cloud version of the parameters file, so that you don’t have to guess at the changes.
Opt in for connection parameterization
This experience is an opt-in for you as you might already have projects in flight that use your own solution for parameterization. After you install extension version 4.4.3, you get the following pop-up message during new project startup:
Option
Action
Yes
This option enables connection parameterization and updates any project that you open with the new parameterization capability.
No
This option doesn’t enable parameterization for your current project but asks again the next time that you open a project.
Don’t warn again
This option opts out from the parameterization feature and doesn’t show the message again. However, you can opt in later at any time.
To opt in later, go to the extension settings in Visual Studio Code and select the following option:
Automate deployment scripts generation
You can generate ARM templates and Azure DevOps pipelines to support deployment automation for your Standard logic apps, starting with the Visual Studio Code extension for Azure Logic Apps Standard version 4.4.3.
For more information and full walkthrough that shows how to generate and connect these templates to your Azure DevOps platform, see our official documentation at Automate build and deployment for Standard logic app workflows with Azure DevOps.
Azure Logic Apps Build and Release Actions for Azure DevOps
Two new actions now exist for Azure DevOps, which the Visual Studio Code extension uses to generate build and release pipelines:
Azure Logic Apps Standard Build
Azure Logic Apps Standard Release
Before you can use this new pipeline capability, you must first install these actions, which you can find on the Visual Studio Marketplace.
Enable zero downtime deployment scenarios
To deploy mission-critical logic apps that are always available and responsive, even during updates or maintenance, you can enable zero downtime deployment by creating and using deployment slots. Zero downtime means that when you deploy new versions of your app, end users shouldn’t experience disruption or downtime. Deployment slots, which are now available in public preview for Azure Logic Apps, are isolated nonproduction environments that host different versions of your Standard logic app and provide the following benefits:
Swap a deployment slot with your production slot without interruption. That way, you can update your logic app and workflows without affecting availability or performance.
Validate any changes in a deployment slot before you apply those changes to the production slot.
Roll back to a previous version, if anything goes wrong with your deployment.
Reduce the risk of negative performance when you must exceed the recommended number of workflows per logic app.
For more information, see our official documentation at Set up deployment slots to enable zero downtime deployment in Azure Logic Apps.
Microsoft Tech Community – Latest Blogs –Read More
In app designer, I have a random number generated that is assigned to a variable. If the number is 1, I want the user to be able to choose the value of this variable: 1 or 11
if p1 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% I need the code to pause here in app designer, ask the
% user for input then assign that input to p1
p1 = app.AceValueEditField.Value
elseif p2 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% Same as above here
p2 = app.AceValueEditField.Value
else
p1 = p1;
p2 = p2;
endif p1 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% I need the code to pause here in app designer, ask the
% user for input then assign that input to p1
p1 = app.AceValueEditField.Value
elseif p2 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% Same as above here
p2 = app.AceValueEditField.Value
else
p1 = p1;
p2 = p2;
end if p1 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% I need the code to pause here in app designer, ask the
% user for input then assign that input to p1
p1 = app.AceValueEditField.Value
elseif p2 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% Same as above here
p2 = app.AceValueEditField.Value
else
p1 = p1;
p2 = p2;
end appdesigner MATLAB Answers — New Questions
How to stop double printing text using sprintf ?
Hi guys, im trying to write a file which contains text that i already defined in Matlab.
I have 2 problems here. First is my numbering inside the file is not match with numbring of my file’s name. You can see the picture below:
Here is my code :
clear;
clc;
H = 5;
L = 15;
Ns = 2;
Nb = 1;
PortalHeight = H;
Bayspan = L;
NumberStory = Ns;
NumberBay = Nb;
% Variable1
h = [0.8,1.00,1.20,1.40,1.6,1.80];
% Variable2
Lss = [2.00,2.40,2.80,3.20,3.60,4.00];
% Variable3
Nss = [2,3,4];
% Definition
Var1HeightofTrussBeam = h;
Var2LengthSpecialSegment = Lss;
Var3NumberSpecialSegment = Nss;
% % Xbase = zeros(1,length(Totalvariant));
% % Zbase = zeros(1,length(Totalvariant));
% % Xcol = zeros(1,length(Totalvariant));
% % Zcol = zeros(1,length(Totalvariant));
% % Xos = zeros(1,length(Totalvariant));
% % Zos = zeros(1,length(Totalvariant));
% % Xss = zeros(1,length(Totalvariant));
% % Zss = zeros(1,length(Totalvariant));
% % X = zeros(1,length(Totalvariant));
% % Z = zeros(1,length(Totalvariant));
% % jointbase = zeros(1,length(Totalvariant));
% % jointcolumn = zeros(1,length(Totalvariant));
% % jointordinarysegment = zeros(1,length(Totalvariant));
% % jointtopordinarysegment = zeros(1,length(Totalvariant));
% % jointbottomordinarysegment = zeros(1,length(Totalvariant));
% % jointspecialsegment = zeros(1,length(Totalvariant));
% % jointtopspecialsegment = zeros(1,length(Totalvariant));
% % jointbottomspecialsegment = zeros(1,length(Totalvariant));
ijk = 0;
for i = 1:numel(h)
for j = 1:numel(Lss)
for k = 1:numel(Nss)
ijk = ijk+1;
Variantmodel{ijk,:} = table(ijk,h(i),Lss(j),Nss(k),’VariableNames’,{‘VariantID’,’Height’,’Length’,’Number’});
%% Cooridinate Point Base(base)
Xbase{ijk,:} = L*(0:NumberBay);
Zbase{ijk,:} = repelem(0,1,length(Xbase{ijk,:}));
%% Column(col)
Xcolumn = L*(0:NumberBay);
Zcolumn = repelem(H*(1:NumberStory),1,length(Xcolumn));
Xbotbeam = L*(0:NumberBay);
Zbotbeam = repelem((H*(1:NumberStory)-h(i)),1,length(Xbotbeam));
idx = unique(Zbotbeam(:).’);
Zbottombeam{ijk,:} = idx;
% replicate [X] to be the same size as [Z] for plotting:
Xcol{ijk,:} = repmat([Xcolumn,Xbotbeam],1,NumberStory);
Zcol{ijk,:} = [Zcolumn,Zbotbeam];
%% Cooridinate Point Ordinary Segment (os)
% calculate span length of ordinary segment
Los = (L-Lss(j))/2;
Nos = Los/h(i);
Nos = round(Nos);
los = Los/Nos;
totalspan{ijk,:} = los*Nos*2+Lss(j);
if totalspan{ijk,:} == 15.000
checkspan{ijk,:} = "correct span";
else
checkspan{ijk,:} = "span must be 15m";
end
% top and bottom joint of ordinary segment(os)
XTopOrdinarySegment = reshape([los*(1:Nos),(L/2+Lss(j)/2)+los*(0:Nos-1)].’+L*(0:(NumberBay-1)),1,[]);
XBottomOrdinarySegment = XTopOrdinarySegment;
ZTopOrdinarySegment = repelem(H*(1:NumberStory),1,2*Nos*NumberBay);
ZBottomOrdinarySegment = repelem(H*(1:NumberStory)-h(i),1,2*Nos*NumberBay);
% replicate [X] to be the same size as [Z] for plotting:
Xos{ijk,:} = repmat([XTopOrdinarySegment,XBottomOrdinarySegment],1,NumberStory);
Zos{ijk,:} = [ZTopOrdinarySegment,ZBottomOrdinarySegment];
%% Cooridinate Point Special Segment (ss)
% calculate span length of special segment
lss = Lss(j)/Nss(k);
% top and bottom joint of special segment(ss)
XTopSpecialSegment = reshape((lss*(0:Nss(k))+L/2-Lss(j)/2).’+L*(0:(NumberBay-1)),1,[]);
XBottomSpecialSegment = XTopSpecialSegment;
ZTopSpecialSegment = repelem(H*(1:NumberStory),1,length(XTopSpecialSegment));
ZBottomSpecialSegment = repelem(H*(1:NumberStory)-h(i),1,length(XBottomSpecialSegment));
% replicate [X] to be the same size as [Z] for plotting:
Xss{ijk,:} = repmat([XTopSpecialSegment,XBottomSpecialSegment],1,NumberStory);
Zss{ijk,:} = [ZTopSpecialSegment,ZBottomSpecialSegment];
%% Plot Cooridinate Point (X,Z)
X{ijk,:} = [Xbase{ijk,:},Xcol{ijk,:},Xos{ijk,:},Xss{ijk,:}];
Z{ijk,:} = [Zbase{ijk,:},Zcol{ijk,:},Zos{ijk,:},Zss{ijk,:}];
scatter(X{ijk,:},Z{ijk,:},’filled’),grid on
%check angle
tangent = (Lss(j)/Nss(k))/h(i);
anglespecialsegment(ijk) = atand(tangent);
%% Name the Joint
jointbase{ijk} = table((1:numel(Xbase{ijk,:}))’,Xbase{ijk,:}’,Zbase{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointcolumn{ijk} = table((max(jointbase{ijk}.ID)+1:numel(Xcol{ijk,:})+max(jointbase{ijk}.ID))’,Xcol{ijk,:}’,Zcol{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointordinarysegment{ijk} = table((max(jointcolumn{ijk}.ID)+1:numel(Xos{ijk,:})+max(jointcolumn{ijk}.ID))’,Xos{ijk,:}’,Zos{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zcolumn),:);
jointbottomordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zbotbeam),:);
jointspecialsegment{ijk} = table((max(jointbottomordinarysegment{ijk}.ID)+1:numel(Xss{ijk,:})+max(jointbottomordinarysegment{ijk}.ID))’,Xss{ijk,:}’,Zss{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zcolumn),:);
jointbottomspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zbotbeam),:);
end
end
end
% Verify Variants Which Passed the Angle Requirement
tablecheck = table((1:numel(anglespecialsegment))’,totalspan,anglespecialsegment’,’VariableNames’,{‘VariantID’,’Total Span’,’Angle’});
VariantIDPassed = tablecheck.VariantID(tablecheck.Angle>=30 & tablecheck.Angle<=60);
jointbase = table((1:numel(jointbase))’,jointbase’,’VariableNames’,{‘VariantID’,’Joint Base’});
jointbase = jointbase(ismember(jointbase.VariantID,VariantIDPassed),:);
jointcolumn = table((1:numel(jointcolumn))’,jointcolumn’,’VariableNames’,{‘VariantID’,’Joint Column’});
jointcolumn = jointcolumn(ismember(jointcolumn.VariantID,VariantIDPassed),:);
jointtopordinarysegment = table((1:numel(jointtopordinarysegment))’,jointtopordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Top Ordinary Segment’});
jointtopordinarysegment = jointtopordinarysegment(ismember(jointtopordinarysegment.VariantID,VariantIDPassed),:);
jointbottomordinarysegment = table((1:numel(jointbottomordinarysegment))’,jointbottomordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Ordinary Segment’});
jointbottomordinarysegment = jointbottomordinarysegment(ismember(jointbottomordinarysegment.VariantID,VariantIDPassed),:);
jointtopspecialsegment = table((1:numel(jointtopspecialsegment))’,jointtopspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Top Special Segment’});
jointtopspecialsegment = jointtopspecialsegment(ismember(jointtopspecialsegment.VariantID,VariantIDPassed),:);
jointbottomspecialsegment = table((1:numel(jointbottomspecialsegment))’,jointbottomspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Special Segment’});
jointbottomspecialsegment = jointbottomspecialsegment(ismember(jointbottomspecialsegment.VariantID,VariantIDPassed),:);
Zbottombeam{ijk} = table((1:numel(Zbottombeam{ijk,:}))’,Zbottombeam{ijk,:}’,’VariableNames’,{‘VariantID’,’Z Bottom Beam’});
Zbottombeam = Zbottombeam(VariantIDPassed);
%% Name the Frame
% column
for i = 1:height(VariantIDPassed)
jointIcolumn = 0;
jointJcolumn = 0;
jointcolumnnew{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointcolumnnew{i,:} = vertcat(jointbase.("Joint Base"){i},jointcolumnnew{i});
for j = 1:height(jointcolumnnew{i,1})-2
jointIcolumn(j) = jointcolumnnew{i,1}.ID(j);
jointJcolumn(j) = jointcolumnnew{i,1}.ID(j+2);
end
framecolumn{i,:} = table((1:j)’,jointIcolumn’,jointJcolumn’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Name the Frame
% top ordinary segment (TOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endTOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointTOS{i,:} = vertcat(jointtopordinarysegment.("Joint Top Ordinary Segment"){i},endTOS{i});
jointTOSnew1{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H),:),2);
jointTOSnew2{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H*Ns),:),2);
jointTOSnew{i,:} = vertcat(jointTOSnew1{i},jointTOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew1{i,1})-1
jointI(j) = jointTOSnew1{i,1}.ID(j);
jointJ(j) = jointTOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(framecolumn{i,1}.("Frame ID"));
frameTOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS1{i,1}(median(1:height(frameTOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew2{i,1})-1
jointI(j) = jointTOSnew2{i,1}.ID(j);
jointJ(j) = jointTOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS1{i,1}.("Frame ID"));
frameTOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS2{i,1}(median(1:height(frameTOS2{i,1})),:) = [];
end
frameTOS = cellfun(@(varargin)vertcat(varargin{:}),frameTOS1,frameTOS2,’UniformOutput’,false);
%% Name the Frame
% bottom ordinary segment (BOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endBOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i}.Z),:);
jointBOS{i,:} = vertcat(jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i},endBOS{i});
jointBOSnew1{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(1)),:),2);
jointBOSnew2{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(2)),:),2);
jointBOSnew{i,:} = vertcat(jointBOSnew1{i},jointBOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBOSnew1{i,1})-1
jointI(j) = jointBOSnew1{i,1}.ID(j);
jointJ(j) = jointBOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS{i,1}.("Frame ID"));
frameBOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS1{i,1}(median(1:height(frameBOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ =0;
for j = 1:height(jointBOSnew2{i,1})-1
jointI(j) = jointBOSnew2{i,1}.ID(j);
jointJ(j) = jointBOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS1{i,1}.("Frame ID"));
frameBOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS2{i,1}(median(1:height(frameBOS2{i,1})),:) = [];
end
frameBOS = cellfun(@(varargin)vertcat(varargin{:}),frameBOS1,frameBOS2,’UniformOutput’,false);
%% Name the Frame
% top special segment (TSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointTSSnew1{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H),:),2);
jointTSSnew2{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H*Ns),:),2);
jointTSSnew{i,:} = vertcat(jointTSSnew1{i},jointTSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew1{i,1})-1
jointI(j) = jointTSSnew1{i,1}.ID(j);
jointJ(j) = jointTSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS{i,1}.("Frame ID"));
frameTSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew2{i,1})-1
jointI(j) = jointTSSnew2{i,1}.ID(j);
jointJ(j) = jointTSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS1{i,1}.("Frame ID"));
frameTSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameTSS = cellfun(@(varargin)vertcat(varargin{:}),frameTSS1,frameTSS2,’UniformOutput’,false);
%% Name the Frame
% bottom special segment (BSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointBSSnew1{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(1)),:),2);
jointBSSnew2{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(2)),:),2);
jointBSSnew{i,:} = vertcat(jointBSSnew1{i},jointBSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew1{i,1})-1
jointI(j) = jointBSSnew1{i,1}.ID(j);
jointJ(j) = jointBSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS{i,1}.("Frame ID"));
frameBSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew2{i,1})-1
jointI(j) = jointBSSnew2{i,1}.ID(j);
jointJ(j) = jointBSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBSS1{i,1}.("Frame ID"));
frameBSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameBSS = cellfun(@(varargin)vertcat(varargin{:}),frameBSS1,frameBSS2,’UniformOutput’,false);
%% Name the Frame
% diagonal ordinary segment (DOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tosleft{i,:} = frameTOS{i,1}(1:2:end,:);
tosright{i,:} = frameTOS{i,1}(2:2:end,:);
bosleft{i,:} = frameBOS{i,1}(1:2:end,:);
bosright{i,:} = frameBOS{i,1}(2:2:end,:);
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tosleft{i,1})
jointI(j) = tosleft{i,1}.JointI(j);
jointJ(j) = bosleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameBSS{i,1}.("Frame ID"));
frameDOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bosright{i,1})
jointI(j) = bosright{i,1}.JointI(j);
jointJ(j) = tosright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS1{i,1}.("Frame ID"));
frameDOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDOS = cellfun(@(varargin)vertcat(varargin{:}),frameDOS1,frameDOS2,’UniformOutput’,false);
%% Name the Frame
% diagonal special segment (DSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
tssright{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
bssright{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS{i,1}.("Frame ID"));
frameDSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bssright{i,1})
jointI(j) = bssright{i,1}.JointI(j);
jointJ(j) = tssright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDSS1{i,1}.("Frame ID"));
frameDSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDSS = cellfun(@(varargin)vertcat(varargin{:}),frameDSS1,frameDSS2,’UniformOutput’,false);
%% Name the Frame
% vertical special segment (VSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
endtss1{i,:} = max(jointTSSnew1{i,1}.ID);
endtss2{i,:} = max(jointTSSnew2{i,1}.ID);
endbss1{i,:} = max(jointBSSnew1{i,1}.ID);
endbss2{i,:} = max(jointBSSnew2{i,1}.ID);
endtss{i,:} = vertcat(endtss1{i},endtss2{i});
endbss{i,:} = vertcat(endbss1{i},endbss2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointI(j);
end
lastframenumber{i,:} = max(frameDSS{i,1}.("Frame ID"));
frameVSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:NumberStory
jointI(j) = endtss{i,:}(j);
jointJ(j) = endbss{i,:}(j);
end
lastframenumber{i,:} = max(frameVSS1{i,1}.("Frame ID"));
frameVSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameVSS = cellfun(@(varargin)vertcat(varargin{:}),frameVSS1,frameVSS2,’UniformOutput’,false);
%% Print ‘frame’ data to textline
txtframeCOLUMN = strings(height(framecolumn),1);
for i = 1:height(framecolumn)
T = framecolumn{i};
M = T{:,:};
txtframeCOLUMN(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTOS = strings(height(frameTOS),1);
for i = 1:height(frameTOS)
T = frameTOS{i};
M = T{:,:};
txtframeTOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBOS = strings(height(frameBOS),1);
for i = 1:height(frameBOS)
T = frameBOS{i};
M = T{:,:};
txtframeBOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTSS = strings(height(frameTSS),1);
for i = 1:height(frameTSS)
T = frameTSS{i};
M = T{:,:};
txtframeTSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBSS = strings(height(frameBSS),1);
for i = 1:height(frameBSS)
T = frameBSS{i};
M = T{:,:};
txtframeBSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDOS = strings(height(frameDOS),1);
for i = 1:height(frameDOS)
T = frameDOS{i};
M = T{:,:};
txtframeDOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDSS = strings(height(frameDSS),1);
for i = 1:height(frameDSS)
T = frameDSS{i};
M = T{:,:};
txtframeDSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeVSS = strings(height(frameVSS),1);
for i = 1:height(frameVSS)
T = frameVSS{i};
M = T{:,:};
txtframeVSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
%% Print ‘joint’ data to textline
txtjointBASE = strings(height(jointbase),1);
for i = 1:height(jointbase)
T = jointbase.("Joint Base"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBASE(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointCOLUMN = strings(height(jointcolumn),1);
for i = 1:height(jointcolumn)
T = jointcolumn.("Joint Column"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointCOLUMN(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTOS = strings(height(jointtopordinarysegment),1);
for i = 1:height(jointtopordinarysegment)
T = jointtopordinarysegment.("Joint Top Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBOS = strings(height(jointbottomordinarysegment),1);
for i = 1:height(jointbottomordinarysegment)
T = jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTSS = strings(height(jointtopspecialsegment),1);
for i = 1:height(jointtopspecialsegment)
T = jointtopspecialsegment.("Joint Top Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBSS = strings(height(jointbottomspecialsegment),1);
for i = 1:height(jointbottomspecialsegment)
T = jointbottomspecialsegment.("Joint Bottom Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
%% WRITE s2k Extension Files
VariantModel = compose(‘%d’, 1:height(VariantIDPassed));
lined= append(txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS);
for i = 1:numel(VariantModel)
writefile(VariantModel{i},txtjointBASE{i},txtjointCOLUMN{i},txtjointTOS{i},txtjointBOS{i},txtjointTSS{i},txtjointBSS{i},txtframeCOLUMN{i},txtframeTOS{i},txtframeBOS{i},txtframeTSS{i},txtframeBSS{i},txtframeDOS{i},txtframeDSS{i},txtframeVSS{i});
end
files = dir(‘*.s2k’);
files(:).name;
function writefile(C,txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS,txtframeCOLUMN,txtframeTOS,txtframeBOS,txtframeTSS,txtframeBSS,txtframeDOS,txtframeDSS,txtframeVSS)
fido = fopen("ModelVariant"+C+".s2k",’wt’);
newline = ‘n’;
line1=’File D:\MAGISTER\KULIAH\TESIS\S2K FILE\ModelVariant-%d.s2k was saved on m/d/yy at h:mm:ss’;
line2=’TABLE: "PROGRAM CONTROL"’;
line3=’ ProgramName=SAP2000 Version=25.0.0 ProgLevel=Ultimate LicenseNum=3010*1D6KZBK478DMQCT LicenseOS=Yes LicenseSC=Yes LicenseHT=No CurrUnits="KN, m, C" SteelCode="AISC 360-10" ConcCode="ACI 318-19" AlumCode="AA 2015" _’;
line4=’ ColdCode=AISI-16 RegenHinge=Yes’;
line5=’TABLE: "ACTIVE DEGREES OF FREEDOM"’;
line6=’ UX=Yes UY=No UZ=Yes RX=No RY=Yes RZ=No’;
line7=’TABLE: "ANALYSIS OPTIONS"’;
line8=’ Solver=Multithreaded SolverProc="Analysis Process" NumParallel=0 Force32Bit=No StiffCase=None GeomMod=None HingeOpt="In Elements" NumAThreads=0 MaxFileSize=0 NumDThreads=0 NumRThreads=0 _ UseMMFiles="Program Determined" AllowDiff=No’;
line9=’TABLE: "COORDINATE SYSTEMS"’;
line10=’ Name=GLOBAL Type=Cartesian X=0 Y=0 Z=0 AboutZ=0 AboutY=0 AboutX=0′;
line11=’TABLE: "GRID LINES"’;
line12=’ CoordSys=GLOBAL AxisDir=X GridID=A XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End AllVisible=Yes BubbleSize=1,5′;
line13=’ CoordSys=GLOBAL AxisDir=X GridID=B XRYZCoord=15 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line14=’ CoordSys=GLOBAL AxisDir=X GridID=C XRYZCoord=30 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line15=’ CoordSys=GLOBAL AxisDir=Y GridID=1 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=Start’;
line16=’ CoordSys=GLOBAL AxisDir=Z GridID=Z0 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line17=’ CoordSys=GLOBAL AxisDir=Z GridID=Z1 XRYZCoord=5 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line18=’ CoordSys=GLOBAL AxisDir=Z GridID=Z2 XRYZCoord=10 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line19=’TABLE: "MATERIAL PROPERTIES 01 – GENERAL"’;
line20=’ Material=4000Psi Type=Concrete Grade="’ + "f’c 4000 " + ‘psi"’+ ‘ SymType=Isotropic TempDepend=No Color=Green GUID=b0920fc0-a39b-46e4-a096-037f0f0739a7 Notes="Customary ‘+"f’c 4000 psi "+’01/02/2024 20:13:33"’;
line21=’ Material=BJ-37 Type=Steel Grade="Grade 50" SymType=Isotropic TempDepend=No Color=Magenta Notes="ASTM A992 Grade 50 01/02/2024 20:03:34"’;
line22=’TABLE: "MATERIAL PROPERTIES 02 – BASIC MECHANICAL PROPERTIES"’;
line23=’ Material=4000Psi UnitWeight=23,5631216161854 UnitMass=2,40276960558926 E1=24855578,0600518 G12=10356490,8583549 U12=0,2 A1=9,89999952793124E-06′;
line24=’ Material=BJ-37 UnitWeight=76,9728639422648 UnitMass=7,84904737995992 E1=199947978,795958 G12=76903068,7676762 U12=0,3 A1=1,16999994421006E-05′;
line25=’TABLE: "MATERIAL PROPERTIES 03A – STEEL DATA"’;
line26=’ Material=BJ-37 Fy=235000 Fu=352500 EffFy=235000 EffFu=352500 SSCurveOpt=Simple SSHysType=Kinematic SHard=0,015 SMax=0,11 SRup=0,17 FinalSlope=-0,1 CoupModType="Von Mises"’;
line27=’TABLE: "MATERIAL PROPERTIES 06 – DAMPING PARAMETERS"’;
line28=’ Material=4000Psi ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line29=’ Material=BJ-37 ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line30=’TABLE: "MATERIAL PROPERTIES 09 – ACCEPTANCE CRITERIA"’;
line31=’ Material=4000Psi IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,003 LSComp=-0,006 CPComp=-0,015 IgnoreTens=Yes’;
line32=’ Material=BJ-37 IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,005 LSComp=-0,01 CPComp=-0,02′;
line33=’TABLE: "FRAME SECTION PROPERTIES 01 – GENERAL"’;
line34=’ SectionName=ExampleWideFlanged Material=BJ-37 Shape="I/Wide Flange" t3=0,25 t2=0,15 tf=0,012 tw=0,008 t2b=0,15 tfb=0,012 FilletRadius=0,012 Area=0,005552 TorsConst=2,13418666666667E-07 I33=6,04638656154112E-05 _’;
line35=’ I22=6,76749435145855E-06 I23=-6,7762635780344E-21 AS2=0,00200790111881035 AS3=0,00357344416053972 S33Top=0,00048371092492329 S33Bot=0,00048371092492329 S22Left=9,02332580194473E-05 S22Right=9,02332580194473E-05 _’;
line36=’ Z33=0,000546402338734841 Z22=0,00013961366126516 R33=0,10435739412628 R22=0,0349131651083826 CGOffset3=-1,38777878078145E-17 CGOffset2=5,55111512312578E-17 EccV2=0 EccV3=0 Cw=9,558675E-08 ConcCol=No ConcBeam=No _’;
line37=’ Color=Blue TotalWt=60,3707599671425 TotalMass=6,15610399662034 FromFile=No AMod=1 A2Mod=1 A3Mod=1 JMod=1 I2Mod=1 I3Mod=1 MMod=1 WMod=1 Notes="Added 03/04/2024 20:08:55′;
line38=’TABLE: "LOAD PATTERN DEFINITIONS"’;
line39=’ LoadPat=DEAD DesignType=Dead SelfWtMult=1 GUID=d2c74fc0-a771-416d-b3dc-4b0a2047268d’;
line40=’ LoadPat=SUPERDEAD DesignType="Super Dead" SelfWtMult=0 GUID=91534b51-672f-4fb0-a037-d7225de00c69 Notes="Added 01/02/2024 20:08:11"’;
line41=’ LoadPat=LIVE DesignType=Live SelfWtMult=0 GUID=1f6f6fd1-e0f1-4fcb-bf3d-dc86bd53f1a8 Notes="Added 01/02/2024 20:08:16"’;
line42=’TABLE: "GROUPS 1 – DEFINITIONS"’;
line43=’ GroupName=All Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line44=’ GroupName=ST_Top Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line45=’ GroupName=ST_Bot Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line46=’ GroupName=ST_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line47=’ GroupName=ST_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line48=’ GroupName=OT_Top1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line49=’ GroupName=OT_Top2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Yellow’;
line49a=’ GroupName=OT_Bot1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line49b=’ GroupName=OT_Bot2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line49c=’ GroupName=OT_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line49d=’ GroupName=OT_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line49e=’ GroupName=Column_End Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line50=’TABLE: "JOINT PATTERN DEFINITIONS"’;
line51=’ Pattern=Default’;
line52=’TABLE: "MASS SOURCE"’;
line53=’ MassSource=MSSSRC1 Elements=Yes Masses=Yes Loads=Yes IsDefault=Yes LoadPat=DEAD Multiplier=1′;
line54=’ MassSource=MSSSRC1 LoadPat=SUPERDEAD Multiplier=1′;
line55=’ MassSource=MSSSRC1 LoadPat=LIVE Multiplier=0,5′;
line56=’TABLE: "LOAD CASE DEFINITIONS"’;
line57=’ Case=DEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=91b91585-f6e6-446e-ac30-362013fd8af9′;
line58=’ Case=MODAL Type=LinModal InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Other DesActOpt="Prog Det" DesignAct=Other AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=3e160405-efbf-45fb-ae06-c6da634ca183′;
line59=’ Case=SUPERDEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType="Super Dead" DesActOpt="Prog Det" DesignAct="Long-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=2ca565b7-af73-42e9-9208-0a0739594699′;
line60=’ Case=LIVE Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Live DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e969dd8f-56cc-40d7-af8a-0fba39157fcb’;
line61=’ Case="Gravity NLS" Type=NonStatic InitialCond=Zero MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line62=’ Case=Pushover-UX Type=NonStatic InitialCond="Gravity NLS" MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Quake DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line63=’TABLE: "CASE – STATIC 1 – LOAD ASSIGNMENTS"’;
line64=’ Case=DEAD LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line65=’ Case=SUPERDEAD LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line66=’ Case=LIVE LoadType="Load pattern" LoadName=LIVE LoadSF=1′;
line67=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line68=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line69=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=LIVE LoadSF=0,5′;
line70=’ Case=Pushover-UX LoadType=Accel LoadName="Accel UX" TransAccSF=-1′;
line71=’TABLE: "CASE – STATIC 2 – NONLINEAR LOAD APPLICATION"’;
line72=’ Case="Gravity NLS" LoadApp="Full Load" MonitorDOF=U1 MonitorJt=9′;
line73=’ Case=Pushover-UX LoadApp="Displ Ctrl" DisplType=Monitored TargetDispl=1 MonitorDOF=U1 MonitorJt=9′;
line74=’TABLE: "CASE – STATIC 4 – NONLINEAR PARAMETERS"’;
line75=’ Case="Gravity NLS" GeoNonLin=P-Delta ResultsSave="Final State" SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 _’;
line76=’ TFAccelFact=1 TFNoStop=No’;
line77=’ Case=Pushover-UX GeoNonLin=P-Delta ResultsSave="Multiple States" MinNumState=10 MaxNumState=100 PosIncOnly=Yes SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 _’;
line78=’ MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 TFAccelFact=1 TFNoStop=No’;
line79=’TABLE: "CASE – MODAL 1 – GENERAL"’;
line80=’ Case=MODAL ModeType=Eigen MaxNumModes=12 MinNumModes=1 EigenShift=0 EigenCutoff=0 EigenTol=1E-09 AutoShift=Yes’;
line81=’TABLE: "JOINT COORDINATES"’;
line82= append(txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS);
line83=’TABLE: "CONNECTIVITY – FRAME"’;
line84= append(txtframeCOLUMN,txtframeTOS,txtframeBOS,txtframeTSS,txtframeBSS,txtframeDOS,txtframeDSS,txtframeVSS);
line85=’TABLE: "END TABLE DATA"’;
combine1 = append(line1,newline,line2,newline,line3,newline,line4,newline,line5,newline,line6,newline,line7,newline,line8,newline,line9,newline,line10,newline,line11,newline,line12,newline,line13,newline,line14,newline,line15,newline,line16,newline,line17,newline,line18,newline,line19,newline,line20,newline,line21,newline,line22,newline,line23,newline,line24,newline,line25,newline,line26,newline,line27,newline,line28,newline,line29,newline,line30,newline,line31,newline,line32,newline,line33,newline,line34,newline,line35,newline,line36);
combine2 = append(combine1,newline,line37,newline,line38,newline,line39,newline,line40,newline,line41,newline,line42,newline,line43,newline,line44,newline,line45,newline,line46,newline,line47,newline,line48,newline,line49,newline,line49a,newline,line49b,newline,line49c,newline,line49d,newline,line49e,newline,line50,newline,line51,newline,line52,newline,line53,newline,line54,newline,line55,newline,line56,newline,line57,newline,line58,newline,line59,newline,line60,newline,line61,newline,line62,newline,line63,newline,line64,newline,line65,newline,line66,newline,line67,newline,line68,newline);
combine3 = append(combine2,line69,newline,line70,newline,line71,newline,line72,newline,line73,newline,line74,newline,line75,newline,line76,newline,line77,newline,line78,newline,line79,newline,line80,newline,line81,newline,line82,newline,line83,newline,line84,newline,line85);
fprintf(fido,combine3,C);
fclose(fido);
end
and second problem is why the result inside the file is different between when i Run the matlab by stepping (not single-run) and when i do one time running. When i do stepping-run one-by one the result is same with what my ittention. Because each file doesnt do double writing (just end in line no.85 (END TABLE DATA). The result will be like this:
But when i do one-time running it happened like this :
then how to stop double writing like that ?Hi guys, im trying to write a file which contains text that i already defined in Matlab.
I have 2 problems here. First is my numbering inside the file is not match with numbring of my file’s name. You can see the picture below:
Here is my code :
clear;
clc;
H = 5;
L = 15;
Ns = 2;
Nb = 1;
PortalHeight = H;
Bayspan = L;
NumberStory = Ns;
NumberBay = Nb;
% Variable1
h = [0.8,1.00,1.20,1.40,1.6,1.80];
% Variable2
Lss = [2.00,2.40,2.80,3.20,3.60,4.00];
% Variable3
Nss = [2,3,4];
% Definition
Var1HeightofTrussBeam = h;
Var2LengthSpecialSegment = Lss;
Var3NumberSpecialSegment = Nss;
% % Xbase = zeros(1,length(Totalvariant));
% % Zbase = zeros(1,length(Totalvariant));
% % Xcol = zeros(1,length(Totalvariant));
% % Zcol = zeros(1,length(Totalvariant));
% % Xos = zeros(1,length(Totalvariant));
% % Zos = zeros(1,length(Totalvariant));
% % Xss = zeros(1,length(Totalvariant));
% % Zss = zeros(1,length(Totalvariant));
% % X = zeros(1,length(Totalvariant));
% % Z = zeros(1,length(Totalvariant));
% % jointbase = zeros(1,length(Totalvariant));
% % jointcolumn = zeros(1,length(Totalvariant));
% % jointordinarysegment = zeros(1,length(Totalvariant));
% % jointtopordinarysegment = zeros(1,length(Totalvariant));
% % jointbottomordinarysegment = zeros(1,length(Totalvariant));
% % jointspecialsegment = zeros(1,length(Totalvariant));
% % jointtopspecialsegment = zeros(1,length(Totalvariant));
% % jointbottomspecialsegment = zeros(1,length(Totalvariant));
ijk = 0;
for i = 1:numel(h)
for j = 1:numel(Lss)
for k = 1:numel(Nss)
ijk = ijk+1;
Variantmodel{ijk,:} = table(ijk,h(i),Lss(j),Nss(k),’VariableNames’,{‘VariantID’,’Height’,’Length’,’Number’});
%% Cooridinate Point Base(base)
Xbase{ijk,:} = L*(0:NumberBay);
Zbase{ijk,:} = repelem(0,1,length(Xbase{ijk,:}));
%% Column(col)
Xcolumn = L*(0:NumberBay);
Zcolumn = repelem(H*(1:NumberStory),1,length(Xcolumn));
Xbotbeam = L*(0:NumberBay);
Zbotbeam = repelem((H*(1:NumberStory)-h(i)),1,length(Xbotbeam));
idx = unique(Zbotbeam(:).’);
Zbottombeam{ijk,:} = idx;
% replicate [X] to be the same size as [Z] for plotting:
Xcol{ijk,:} = repmat([Xcolumn,Xbotbeam],1,NumberStory);
Zcol{ijk,:} = [Zcolumn,Zbotbeam];
%% Cooridinate Point Ordinary Segment (os)
% calculate span length of ordinary segment
Los = (L-Lss(j))/2;
Nos = Los/h(i);
Nos = round(Nos);
los = Los/Nos;
totalspan{ijk,:} = los*Nos*2+Lss(j);
if totalspan{ijk,:} == 15.000
checkspan{ijk,:} = "correct span";
else
checkspan{ijk,:} = "span must be 15m";
end
% top and bottom joint of ordinary segment(os)
XTopOrdinarySegment = reshape([los*(1:Nos),(L/2+Lss(j)/2)+los*(0:Nos-1)].’+L*(0:(NumberBay-1)),1,[]);
XBottomOrdinarySegment = XTopOrdinarySegment;
ZTopOrdinarySegment = repelem(H*(1:NumberStory),1,2*Nos*NumberBay);
ZBottomOrdinarySegment = repelem(H*(1:NumberStory)-h(i),1,2*Nos*NumberBay);
% replicate [X] to be the same size as [Z] for plotting:
Xos{ijk,:} = repmat([XTopOrdinarySegment,XBottomOrdinarySegment],1,NumberStory);
Zos{ijk,:} = [ZTopOrdinarySegment,ZBottomOrdinarySegment];
%% Cooridinate Point Special Segment (ss)
% calculate span length of special segment
lss = Lss(j)/Nss(k);
% top and bottom joint of special segment(ss)
XTopSpecialSegment = reshape((lss*(0:Nss(k))+L/2-Lss(j)/2).’+L*(0:(NumberBay-1)),1,[]);
XBottomSpecialSegment = XTopSpecialSegment;
ZTopSpecialSegment = repelem(H*(1:NumberStory),1,length(XTopSpecialSegment));
ZBottomSpecialSegment = repelem(H*(1:NumberStory)-h(i),1,length(XBottomSpecialSegment));
% replicate [X] to be the same size as [Z] for plotting:
Xss{ijk,:} = repmat([XTopSpecialSegment,XBottomSpecialSegment],1,NumberStory);
Zss{ijk,:} = [ZTopSpecialSegment,ZBottomSpecialSegment];
%% Plot Cooridinate Point (X,Z)
X{ijk,:} = [Xbase{ijk,:},Xcol{ijk,:},Xos{ijk,:},Xss{ijk,:}];
Z{ijk,:} = [Zbase{ijk,:},Zcol{ijk,:},Zos{ijk,:},Zss{ijk,:}];
scatter(X{ijk,:},Z{ijk,:},’filled’),grid on
%check angle
tangent = (Lss(j)/Nss(k))/h(i);
anglespecialsegment(ijk) = atand(tangent);
%% Name the Joint
jointbase{ijk} = table((1:numel(Xbase{ijk,:}))’,Xbase{ijk,:}’,Zbase{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointcolumn{ijk} = table((max(jointbase{ijk}.ID)+1:numel(Xcol{ijk,:})+max(jointbase{ijk}.ID))’,Xcol{ijk,:}’,Zcol{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointordinarysegment{ijk} = table((max(jointcolumn{ijk}.ID)+1:numel(Xos{ijk,:})+max(jointcolumn{ijk}.ID))’,Xos{ijk,:}’,Zos{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zcolumn),:);
jointbottomordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zbotbeam),:);
jointspecialsegment{ijk} = table((max(jointbottomordinarysegment{ijk}.ID)+1:numel(Xss{ijk,:})+max(jointbottomordinarysegment{ijk}.ID))’,Xss{ijk,:}’,Zss{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zcolumn),:);
jointbottomspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zbotbeam),:);
end
end
end
% Verify Variants Which Passed the Angle Requirement
tablecheck = table((1:numel(anglespecialsegment))’,totalspan,anglespecialsegment’,’VariableNames’,{‘VariantID’,’Total Span’,’Angle’});
VariantIDPassed = tablecheck.VariantID(tablecheck.Angle>=30 & tablecheck.Angle<=60);
jointbase = table((1:numel(jointbase))’,jointbase’,’VariableNames’,{‘VariantID’,’Joint Base’});
jointbase = jointbase(ismember(jointbase.VariantID,VariantIDPassed),:);
jointcolumn = table((1:numel(jointcolumn))’,jointcolumn’,’VariableNames’,{‘VariantID’,’Joint Column’});
jointcolumn = jointcolumn(ismember(jointcolumn.VariantID,VariantIDPassed),:);
jointtopordinarysegment = table((1:numel(jointtopordinarysegment))’,jointtopordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Top Ordinary Segment’});
jointtopordinarysegment = jointtopordinarysegment(ismember(jointtopordinarysegment.VariantID,VariantIDPassed),:);
jointbottomordinarysegment = table((1:numel(jointbottomordinarysegment))’,jointbottomordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Ordinary Segment’});
jointbottomordinarysegment = jointbottomordinarysegment(ismember(jointbottomordinarysegment.VariantID,VariantIDPassed),:);
jointtopspecialsegment = table((1:numel(jointtopspecialsegment))’,jointtopspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Top Special Segment’});
jointtopspecialsegment = jointtopspecialsegment(ismember(jointtopspecialsegment.VariantID,VariantIDPassed),:);
jointbottomspecialsegment = table((1:numel(jointbottomspecialsegment))’,jointbottomspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Special Segment’});
jointbottomspecialsegment = jointbottomspecialsegment(ismember(jointbottomspecialsegment.VariantID,VariantIDPassed),:);
Zbottombeam{ijk} = table((1:numel(Zbottombeam{ijk,:}))’,Zbottombeam{ijk,:}’,’VariableNames’,{‘VariantID’,’Z Bottom Beam’});
Zbottombeam = Zbottombeam(VariantIDPassed);
%% Name the Frame
% column
for i = 1:height(VariantIDPassed)
jointIcolumn = 0;
jointJcolumn = 0;
jointcolumnnew{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointcolumnnew{i,:} = vertcat(jointbase.("Joint Base"){i},jointcolumnnew{i});
for j = 1:height(jointcolumnnew{i,1})-2
jointIcolumn(j) = jointcolumnnew{i,1}.ID(j);
jointJcolumn(j) = jointcolumnnew{i,1}.ID(j+2);
end
framecolumn{i,:} = table((1:j)’,jointIcolumn’,jointJcolumn’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Name the Frame
% top ordinary segment (TOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endTOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointTOS{i,:} = vertcat(jointtopordinarysegment.("Joint Top Ordinary Segment"){i},endTOS{i});
jointTOSnew1{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H),:),2);
jointTOSnew2{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H*Ns),:),2);
jointTOSnew{i,:} = vertcat(jointTOSnew1{i},jointTOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew1{i,1})-1
jointI(j) = jointTOSnew1{i,1}.ID(j);
jointJ(j) = jointTOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(framecolumn{i,1}.("Frame ID"));
frameTOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS1{i,1}(median(1:height(frameTOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew2{i,1})-1
jointI(j) = jointTOSnew2{i,1}.ID(j);
jointJ(j) = jointTOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS1{i,1}.("Frame ID"));
frameTOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS2{i,1}(median(1:height(frameTOS2{i,1})),:) = [];
end
frameTOS = cellfun(@(varargin)vertcat(varargin{:}),frameTOS1,frameTOS2,’UniformOutput’,false);
%% Name the Frame
% bottom ordinary segment (BOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endBOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i}.Z),:);
jointBOS{i,:} = vertcat(jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i},endBOS{i});
jointBOSnew1{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(1)),:),2);
jointBOSnew2{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(2)),:),2);
jointBOSnew{i,:} = vertcat(jointBOSnew1{i},jointBOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBOSnew1{i,1})-1
jointI(j) = jointBOSnew1{i,1}.ID(j);
jointJ(j) = jointBOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS{i,1}.("Frame ID"));
frameBOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS1{i,1}(median(1:height(frameBOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ =0;
for j = 1:height(jointBOSnew2{i,1})-1
jointI(j) = jointBOSnew2{i,1}.ID(j);
jointJ(j) = jointBOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS1{i,1}.("Frame ID"));
frameBOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS2{i,1}(median(1:height(frameBOS2{i,1})),:) = [];
end
frameBOS = cellfun(@(varargin)vertcat(varargin{:}),frameBOS1,frameBOS2,’UniformOutput’,false);
%% Name the Frame
% top special segment (TSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointTSSnew1{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H),:),2);
jointTSSnew2{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H*Ns),:),2);
jointTSSnew{i,:} = vertcat(jointTSSnew1{i},jointTSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew1{i,1})-1
jointI(j) = jointTSSnew1{i,1}.ID(j);
jointJ(j) = jointTSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS{i,1}.("Frame ID"));
frameTSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew2{i,1})-1
jointI(j) = jointTSSnew2{i,1}.ID(j);
jointJ(j) = jointTSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS1{i,1}.("Frame ID"));
frameTSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameTSS = cellfun(@(varargin)vertcat(varargin{:}),frameTSS1,frameTSS2,’UniformOutput’,false);
%% Name the Frame
% bottom special segment (BSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointBSSnew1{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(1)),:),2);
jointBSSnew2{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(2)),:),2);
jointBSSnew{i,:} = vertcat(jointBSSnew1{i},jointBSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew1{i,1})-1
jointI(j) = jointBSSnew1{i,1}.ID(j);
jointJ(j) = jointBSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS{i,1}.("Frame ID"));
frameBSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew2{i,1})-1
jointI(j) = jointBSSnew2{i,1}.ID(j);
jointJ(j) = jointBSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBSS1{i,1}.("Frame ID"));
frameBSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameBSS = cellfun(@(varargin)vertcat(varargin{:}),frameBSS1,frameBSS2,’UniformOutput’,false);
%% Name the Frame
% diagonal ordinary segment (DOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tosleft{i,:} = frameTOS{i,1}(1:2:end,:);
tosright{i,:} = frameTOS{i,1}(2:2:end,:);
bosleft{i,:} = frameBOS{i,1}(1:2:end,:);
bosright{i,:} = frameBOS{i,1}(2:2:end,:);
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tosleft{i,1})
jointI(j) = tosleft{i,1}.JointI(j);
jointJ(j) = bosleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameBSS{i,1}.("Frame ID"));
frameDOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bosright{i,1})
jointI(j) = bosright{i,1}.JointI(j);
jointJ(j) = tosright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS1{i,1}.("Frame ID"));
frameDOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDOS = cellfun(@(varargin)vertcat(varargin{:}),frameDOS1,frameDOS2,’UniformOutput’,false);
%% Name the Frame
% diagonal special segment (DSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
tssright{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
bssright{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS{i,1}.("Frame ID"));
frameDSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bssright{i,1})
jointI(j) = bssright{i,1}.JointI(j);
jointJ(j) = tssright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDSS1{i,1}.("Frame ID"));
frameDSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDSS = cellfun(@(varargin)vertcat(varargin{:}),frameDSS1,frameDSS2,’UniformOutput’,false);
%% Name the Frame
% vertical special segment (VSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
endtss1{i,:} = max(jointTSSnew1{i,1}.ID);
endtss2{i,:} = max(jointTSSnew2{i,1}.ID);
endbss1{i,:} = max(jointBSSnew1{i,1}.ID);
endbss2{i,:} = max(jointBSSnew2{i,1}.ID);
endtss{i,:} = vertcat(endtss1{i},endtss2{i});
endbss{i,:} = vertcat(endbss1{i},endbss2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointI(j);
end
lastframenumber{i,:} = max(frameDSS{i,1}.("Frame ID"));
frameVSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:NumberStory
jointI(j) = endtss{i,:}(j);
jointJ(j) = endbss{i,:}(j);
end
lastframenumber{i,:} = max(frameVSS1{i,1}.("Frame ID"));
frameVSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameVSS = cellfun(@(varargin)vertcat(varargin{:}),frameVSS1,frameVSS2,’UniformOutput’,false);
%% Print ‘frame’ data to textline
txtframeCOLUMN = strings(height(framecolumn),1);
for i = 1:height(framecolumn)
T = framecolumn{i};
M = T{:,:};
txtframeCOLUMN(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTOS = strings(height(frameTOS),1);
for i = 1:height(frameTOS)
T = frameTOS{i};
M = T{:,:};
txtframeTOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBOS = strings(height(frameBOS),1);
for i = 1:height(frameBOS)
T = frameBOS{i};
M = T{:,:};
txtframeBOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTSS = strings(height(frameTSS),1);
for i = 1:height(frameTSS)
T = frameTSS{i};
M = T{:,:};
txtframeTSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBSS = strings(height(frameBSS),1);
for i = 1:height(frameBSS)
T = frameBSS{i};
M = T{:,:};
txtframeBSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDOS = strings(height(frameDOS),1);
for i = 1:height(frameDOS)
T = frameDOS{i};
M = T{:,:};
txtframeDOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDSS = strings(height(frameDSS),1);
for i = 1:height(frameDSS)
T = frameDSS{i};
M = T{:,:};
txtframeDSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeVSS = strings(height(frameVSS),1);
for i = 1:height(frameVSS)
T = frameVSS{i};
M = T{:,:};
txtframeVSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
%% Print ‘joint’ data to textline
txtjointBASE = strings(height(jointbase),1);
for i = 1:height(jointbase)
T = jointbase.("Joint Base"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBASE(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointCOLUMN = strings(height(jointcolumn),1);
for i = 1:height(jointcolumn)
T = jointcolumn.("Joint Column"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointCOLUMN(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTOS = strings(height(jointtopordinarysegment),1);
for i = 1:height(jointtopordinarysegment)
T = jointtopordinarysegment.("Joint Top Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBOS = strings(height(jointbottomordinarysegment),1);
for i = 1:height(jointbottomordinarysegment)
T = jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTSS = strings(height(jointtopspecialsegment),1);
for i = 1:height(jointtopspecialsegment)
T = jointtopspecialsegment.("Joint Top Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBSS = strings(height(jointbottomspecialsegment),1);
for i = 1:height(jointbottomspecialsegment)
T = jointbottomspecialsegment.("Joint Bottom Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
%% WRITE s2k Extension Files
VariantModel = compose(‘%d’, 1:height(VariantIDPassed));
lined= append(txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS);
for i = 1:numel(VariantModel)
writefile(VariantModel{i},txtjointBASE{i},txtjointCOLUMN{i},txtjointTOS{i},txtjointBOS{i},txtjointTSS{i},txtjointBSS{i},txtframeCOLUMN{i},txtframeTOS{i},txtframeBOS{i},txtframeTSS{i},txtframeBSS{i},txtframeDOS{i},txtframeDSS{i},txtframeVSS{i});
end
files = dir(‘*.s2k’);
files(:).name;
function writefile(C,txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS,txtframeCOLUMN,txtframeTOS,txtframeBOS,txtframeTSS,txtframeBSS,txtframeDOS,txtframeDSS,txtframeVSS)
fido = fopen("ModelVariant"+C+".s2k",’wt’);
newline = ‘n’;
line1=’File D:\MAGISTER\KULIAH\TESIS\S2K FILE\ModelVariant-%d.s2k was saved on m/d/yy at h:mm:ss’;
line2=’TABLE: "PROGRAM CONTROL"’;
line3=’ ProgramName=SAP2000 Version=25.0.0 ProgLevel=Ultimate LicenseNum=3010*1D6KZBK478DMQCT LicenseOS=Yes LicenseSC=Yes LicenseHT=No CurrUnits="KN, m, C" SteelCode="AISC 360-10" ConcCode="ACI 318-19" AlumCode="AA 2015" _’;
line4=’ ColdCode=AISI-16 RegenHinge=Yes’;
line5=’TABLE: "ACTIVE DEGREES OF FREEDOM"’;
line6=’ UX=Yes UY=No UZ=Yes RX=No RY=Yes RZ=No’;
line7=’TABLE: "ANALYSIS OPTIONS"’;
line8=’ Solver=Multithreaded SolverProc="Analysis Process" NumParallel=0 Force32Bit=No StiffCase=None GeomMod=None HingeOpt="In Elements" NumAThreads=0 MaxFileSize=0 NumDThreads=0 NumRThreads=0 _ UseMMFiles="Program Determined" AllowDiff=No’;
line9=’TABLE: "COORDINATE SYSTEMS"’;
line10=’ Name=GLOBAL Type=Cartesian X=0 Y=0 Z=0 AboutZ=0 AboutY=0 AboutX=0′;
line11=’TABLE: "GRID LINES"’;
line12=’ CoordSys=GLOBAL AxisDir=X GridID=A XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End AllVisible=Yes BubbleSize=1,5′;
line13=’ CoordSys=GLOBAL AxisDir=X GridID=B XRYZCoord=15 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line14=’ CoordSys=GLOBAL AxisDir=X GridID=C XRYZCoord=30 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line15=’ CoordSys=GLOBAL AxisDir=Y GridID=1 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=Start’;
line16=’ CoordSys=GLOBAL AxisDir=Z GridID=Z0 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line17=’ CoordSys=GLOBAL AxisDir=Z GridID=Z1 XRYZCoord=5 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line18=’ CoordSys=GLOBAL AxisDir=Z GridID=Z2 XRYZCoord=10 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line19=’TABLE: "MATERIAL PROPERTIES 01 – GENERAL"’;
line20=’ Material=4000Psi Type=Concrete Grade="’ + "f’c 4000 " + ‘psi"’+ ‘ SymType=Isotropic TempDepend=No Color=Green GUID=b0920fc0-a39b-46e4-a096-037f0f0739a7 Notes="Customary ‘+"f’c 4000 psi "+’01/02/2024 20:13:33"’;
line21=’ Material=BJ-37 Type=Steel Grade="Grade 50" SymType=Isotropic TempDepend=No Color=Magenta Notes="ASTM A992 Grade 50 01/02/2024 20:03:34"’;
line22=’TABLE: "MATERIAL PROPERTIES 02 – BASIC MECHANICAL PROPERTIES"’;
line23=’ Material=4000Psi UnitWeight=23,5631216161854 UnitMass=2,40276960558926 E1=24855578,0600518 G12=10356490,8583549 U12=0,2 A1=9,89999952793124E-06′;
line24=’ Material=BJ-37 UnitWeight=76,9728639422648 UnitMass=7,84904737995992 E1=199947978,795958 G12=76903068,7676762 U12=0,3 A1=1,16999994421006E-05′;
line25=’TABLE: "MATERIAL PROPERTIES 03A – STEEL DATA"’;
line26=’ Material=BJ-37 Fy=235000 Fu=352500 EffFy=235000 EffFu=352500 SSCurveOpt=Simple SSHysType=Kinematic SHard=0,015 SMax=0,11 SRup=0,17 FinalSlope=-0,1 CoupModType="Von Mises"’;
line27=’TABLE: "MATERIAL PROPERTIES 06 – DAMPING PARAMETERS"’;
line28=’ Material=4000Psi ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line29=’ Material=BJ-37 ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line30=’TABLE: "MATERIAL PROPERTIES 09 – ACCEPTANCE CRITERIA"’;
line31=’ Material=4000Psi IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,003 LSComp=-0,006 CPComp=-0,015 IgnoreTens=Yes’;
line32=’ Material=BJ-37 IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,005 LSComp=-0,01 CPComp=-0,02′;
line33=’TABLE: "FRAME SECTION PROPERTIES 01 – GENERAL"’;
line34=’ SectionName=ExampleWideFlanged Material=BJ-37 Shape="I/Wide Flange" t3=0,25 t2=0,15 tf=0,012 tw=0,008 t2b=0,15 tfb=0,012 FilletRadius=0,012 Area=0,005552 TorsConst=2,13418666666667E-07 I33=6,04638656154112E-05 _’;
line35=’ I22=6,76749435145855E-06 I23=-6,7762635780344E-21 AS2=0,00200790111881035 AS3=0,00357344416053972 S33Top=0,00048371092492329 S33Bot=0,00048371092492329 S22Left=9,02332580194473E-05 S22Right=9,02332580194473E-05 _’;
line36=’ Z33=0,000546402338734841 Z22=0,00013961366126516 R33=0,10435739412628 R22=0,0349131651083826 CGOffset3=-1,38777878078145E-17 CGOffset2=5,55111512312578E-17 EccV2=0 EccV3=0 Cw=9,558675E-08 ConcCol=No ConcBeam=No _’;
line37=’ Color=Blue TotalWt=60,3707599671425 TotalMass=6,15610399662034 FromFile=No AMod=1 A2Mod=1 A3Mod=1 JMod=1 I2Mod=1 I3Mod=1 MMod=1 WMod=1 Notes="Added 03/04/2024 20:08:55′;
line38=’TABLE: "LOAD PATTERN DEFINITIONS"’;
line39=’ LoadPat=DEAD DesignType=Dead SelfWtMult=1 GUID=d2c74fc0-a771-416d-b3dc-4b0a2047268d’;
line40=’ LoadPat=SUPERDEAD DesignType="Super Dead" SelfWtMult=0 GUID=91534b51-672f-4fb0-a037-d7225de00c69 Notes="Added 01/02/2024 20:08:11"’;
line41=’ LoadPat=LIVE DesignType=Live SelfWtMult=0 GUID=1f6f6fd1-e0f1-4fcb-bf3d-dc86bd53f1a8 Notes="Added 01/02/2024 20:08:16"’;
line42=’TABLE: "GROUPS 1 – DEFINITIONS"’;
line43=’ GroupName=All Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line44=’ GroupName=ST_Top Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line45=’ GroupName=ST_Bot Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line46=’ GroupName=ST_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line47=’ GroupName=ST_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line48=’ GroupName=OT_Top1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line49=’ GroupName=OT_Top2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Yellow’;
line49a=’ GroupName=OT_Bot1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line49b=’ GroupName=OT_Bot2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line49c=’ GroupName=OT_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line49d=’ GroupName=OT_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line49e=’ GroupName=Column_End Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line50=’TABLE: "JOINT PATTERN DEFINITIONS"’;
line51=’ Pattern=Default’;
line52=’TABLE: "MASS SOURCE"’;
line53=’ MassSource=MSSSRC1 Elements=Yes Masses=Yes Loads=Yes IsDefault=Yes LoadPat=DEAD Multiplier=1′;
line54=’ MassSource=MSSSRC1 LoadPat=SUPERDEAD Multiplier=1′;
line55=’ MassSource=MSSSRC1 LoadPat=LIVE Multiplier=0,5′;
line56=’TABLE: "LOAD CASE DEFINITIONS"’;
line57=’ Case=DEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=91b91585-f6e6-446e-ac30-362013fd8af9′;
line58=’ Case=MODAL Type=LinModal InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Other DesActOpt="Prog Det" DesignAct=Other AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=3e160405-efbf-45fb-ae06-c6da634ca183′;
line59=’ Case=SUPERDEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType="Super Dead" DesActOpt="Prog Det" DesignAct="Long-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=2ca565b7-af73-42e9-9208-0a0739594699′;
line60=’ Case=LIVE Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Live DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e969dd8f-56cc-40d7-af8a-0fba39157fcb’;
line61=’ Case="Gravity NLS" Type=NonStatic InitialCond=Zero MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line62=’ Case=Pushover-UX Type=NonStatic InitialCond="Gravity NLS" MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Quake DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line63=’TABLE: "CASE – STATIC 1 – LOAD ASSIGNMENTS"’;
line64=’ Case=DEAD LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line65=’ Case=SUPERDEAD LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line66=’ Case=LIVE LoadType="Load pattern" LoadName=LIVE LoadSF=1′;
line67=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line68=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line69=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=LIVE LoadSF=0,5′;
line70=’ Case=Pushover-UX LoadType=Accel LoadName="Accel UX" TransAccSF=-1′;
line71=’TABLE: "CASE – STATIC 2 – NONLINEAR LOAD APPLICATION"’;
line72=’ Case="Gravity NLS" LoadApp="Full Load" MonitorDOF=U1 MonitorJt=9′;
line73=’ Case=Pushover-UX LoadApp="Displ Ctrl" DisplType=Monitored TargetDispl=1 MonitorDOF=U1 MonitorJt=9′;
line74=’TABLE: "CASE – STATIC 4 – NONLINEAR PARAMETERS"’;
line75=’ Case="Gravity NLS" GeoNonLin=P-Delta ResultsSave="Final State" SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 _’;
line76=’ TFAccelFact=1 TFNoStop=No’;
line77=’ Case=Pushover-UX GeoNonLin=P-Delta ResultsSave="Multiple States" MinNumState=10 MaxNumState=100 PosIncOnly=Yes SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 _’;
line78=’ MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 TFAccelFact=1 TFNoStop=No’;
line79=’TABLE: "CASE – MODAL 1 – GENERAL"’;
line80=’ Case=MODAL ModeType=Eigen MaxNumModes=12 MinNumModes=1 EigenShift=0 EigenCutoff=0 EigenTol=1E-09 AutoShift=Yes’;
line81=’TABLE: "JOINT COORDINATES"’;
line82= append(txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS);
line83=’TABLE: "CONNECTIVITY – FRAME"’;
line84= append(txtframeCOLUMN,txtframeTOS,txtframeBOS,txtframeTSS,txtframeBSS,txtframeDOS,txtframeDSS,txtframeVSS);
line85=’TABLE: "END TABLE DATA"’;
combine1 = append(line1,newline,line2,newline,line3,newline,line4,newline,line5,newline,line6,newline,line7,newline,line8,newline,line9,newline,line10,newline,line11,newline,line12,newline,line13,newline,line14,newline,line15,newline,line16,newline,line17,newline,line18,newline,line19,newline,line20,newline,line21,newline,line22,newline,line23,newline,line24,newline,line25,newline,line26,newline,line27,newline,line28,newline,line29,newline,line30,newline,line31,newline,line32,newline,line33,newline,line34,newline,line35,newline,line36);
combine2 = append(combine1,newline,line37,newline,line38,newline,line39,newline,line40,newline,line41,newline,line42,newline,line43,newline,line44,newline,line45,newline,line46,newline,line47,newline,line48,newline,line49,newline,line49a,newline,line49b,newline,line49c,newline,line49d,newline,line49e,newline,line50,newline,line51,newline,line52,newline,line53,newline,line54,newline,line55,newline,line56,newline,line57,newline,line58,newline,line59,newline,line60,newline,line61,newline,line62,newline,line63,newline,line64,newline,line65,newline,line66,newline,line67,newline,line68,newline);
combine3 = append(combine2,line69,newline,line70,newline,line71,newline,line72,newline,line73,newline,line74,newline,line75,newline,line76,newline,line77,newline,line78,newline,line79,newline,line80,newline,line81,newline,line82,newline,line83,newline,line84,newline,line85);
fprintf(fido,combine3,C);
fclose(fido);
end
and second problem is why the result inside the file is different between when i Run the matlab by stepping (not single-run) and when i do one time running. When i do stepping-run one-by one the result is same with what my ittention. Because each file doesnt do double writing (just end in line no.85 (END TABLE DATA). The result will be like this:
But when i do one-time running it happened like this :
then how to stop double writing like that ? Hi guys, im trying to write a file which contains text that i already defined in Matlab.
I have 2 problems here. First is my numbering inside the file is not match with numbring of my file’s name. You can see the picture below:
Here is my code :
clear;
clc;
H = 5;
L = 15;
Ns = 2;
Nb = 1;
PortalHeight = H;
Bayspan = L;
NumberStory = Ns;
NumberBay = Nb;
% Variable1
h = [0.8,1.00,1.20,1.40,1.6,1.80];
% Variable2
Lss = [2.00,2.40,2.80,3.20,3.60,4.00];
% Variable3
Nss = [2,3,4];
% Definition
Var1HeightofTrussBeam = h;
Var2LengthSpecialSegment = Lss;
Var3NumberSpecialSegment = Nss;
% % Xbase = zeros(1,length(Totalvariant));
% % Zbase = zeros(1,length(Totalvariant));
% % Xcol = zeros(1,length(Totalvariant));
% % Zcol = zeros(1,length(Totalvariant));
% % Xos = zeros(1,length(Totalvariant));
% % Zos = zeros(1,length(Totalvariant));
% % Xss = zeros(1,length(Totalvariant));
% % Zss = zeros(1,length(Totalvariant));
% % X = zeros(1,length(Totalvariant));
% % Z = zeros(1,length(Totalvariant));
% % jointbase = zeros(1,length(Totalvariant));
% % jointcolumn = zeros(1,length(Totalvariant));
% % jointordinarysegment = zeros(1,length(Totalvariant));
% % jointtopordinarysegment = zeros(1,length(Totalvariant));
% % jointbottomordinarysegment = zeros(1,length(Totalvariant));
% % jointspecialsegment = zeros(1,length(Totalvariant));
% % jointtopspecialsegment = zeros(1,length(Totalvariant));
% % jointbottomspecialsegment = zeros(1,length(Totalvariant));
ijk = 0;
for i = 1:numel(h)
for j = 1:numel(Lss)
for k = 1:numel(Nss)
ijk = ijk+1;
Variantmodel{ijk,:} = table(ijk,h(i),Lss(j),Nss(k),’VariableNames’,{‘VariantID’,’Height’,’Length’,’Number’});
%% Cooridinate Point Base(base)
Xbase{ijk,:} = L*(0:NumberBay);
Zbase{ijk,:} = repelem(0,1,length(Xbase{ijk,:}));
%% Column(col)
Xcolumn = L*(0:NumberBay);
Zcolumn = repelem(H*(1:NumberStory),1,length(Xcolumn));
Xbotbeam = L*(0:NumberBay);
Zbotbeam = repelem((H*(1:NumberStory)-h(i)),1,length(Xbotbeam));
idx = unique(Zbotbeam(:).’);
Zbottombeam{ijk,:} = idx;
% replicate [X] to be the same size as [Z] for plotting:
Xcol{ijk,:} = repmat([Xcolumn,Xbotbeam],1,NumberStory);
Zcol{ijk,:} = [Zcolumn,Zbotbeam];
%% Cooridinate Point Ordinary Segment (os)
% calculate span length of ordinary segment
Los = (L-Lss(j))/2;
Nos = Los/h(i);
Nos = round(Nos);
los = Los/Nos;
totalspan{ijk,:} = los*Nos*2+Lss(j);
if totalspan{ijk,:} == 15.000
checkspan{ijk,:} = "correct span";
else
checkspan{ijk,:} = "span must be 15m";
end
% top and bottom joint of ordinary segment(os)
XTopOrdinarySegment = reshape([los*(1:Nos),(L/2+Lss(j)/2)+los*(0:Nos-1)].’+L*(0:(NumberBay-1)),1,[]);
XBottomOrdinarySegment = XTopOrdinarySegment;
ZTopOrdinarySegment = repelem(H*(1:NumberStory),1,2*Nos*NumberBay);
ZBottomOrdinarySegment = repelem(H*(1:NumberStory)-h(i),1,2*Nos*NumberBay);
% replicate [X] to be the same size as [Z] for plotting:
Xos{ijk,:} = repmat([XTopOrdinarySegment,XBottomOrdinarySegment],1,NumberStory);
Zos{ijk,:} = [ZTopOrdinarySegment,ZBottomOrdinarySegment];
%% Cooridinate Point Special Segment (ss)
% calculate span length of special segment
lss = Lss(j)/Nss(k);
% top and bottom joint of special segment(ss)
XTopSpecialSegment = reshape((lss*(0:Nss(k))+L/2-Lss(j)/2).’+L*(0:(NumberBay-1)),1,[]);
XBottomSpecialSegment = XTopSpecialSegment;
ZTopSpecialSegment = repelem(H*(1:NumberStory),1,length(XTopSpecialSegment));
ZBottomSpecialSegment = repelem(H*(1:NumberStory)-h(i),1,length(XBottomSpecialSegment));
% replicate [X] to be the same size as [Z] for plotting:
Xss{ijk,:} = repmat([XTopSpecialSegment,XBottomSpecialSegment],1,NumberStory);
Zss{ijk,:} = [ZTopSpecialSegment,ZBottomSpecialSegment];
%% Plot Cooridinate Point (X,Z)
X{ijk,:} = [Xbase{ijk,:},Xcol{ijk,:},Xos{ijk,:},Xss{ijk,:}];
Z{ijk,:} = [Zbase{ijk,:},Zcol{ijk,:},Zos{ijk,:},Zss{ijk,:}];
scatter(X{ijk,:},Z{ijk,:},’filled’),grid on
%check angle
tangent = (Lss(j)/Nss(k))/h(i);
anglespecialsegment(ijk) = atand(tangent);
%% Name the Joint
jointbase{ijk} = table((1:numel(Xbase{ijk,:}))’,Xbase{ijk,:}’,Zbase{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointcolumn{ijk} = table((max(jointbase{ijk}.ID)+1:numel(Xcol{ijk,:})+max(jointbase{ijk}.ID))’,Xcol{ijk,:}’,Zcol{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointordinarysegment{ijk} = table((max(jointcolumn{ijk}.ID)+1:numel(Xos{ijk,:})+max(jointcolumn{ijk}.ID))’,Xos{ijk,:}’,Zos{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zcolumn),:);
jointbottomordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zbotbeam),:);
jointspecialsegment{ijk} = table((max(jointbottomordinarysegment{ijk}.ID)+1:numel(Xss{ijk,:})+max(jointbottomordinarysegment{ijk}.ID))’,Xss{ijk,:}’,Zss{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zcolumn),:);
jointbottomspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zbotbeam),:);
end
end
end
% Verify Variants Which Passed the Angle Requirement
tablecheck = table((1:numel(anglespecialsegment))’,totalspan,anglespecialsegment’,’VariableNames’,{‘VariantID’,’Total Span’,’Angle’});
VariantIDPassed = tablecheck.VariantID(tablecheck.Angle>=30 & tablecheck.Angle<=60);
jointbase = table((1:numel(jointbase))’,jointbase’,’VariableNames’,{‘VariantID’,’Joint Base’});
jointbase = jointbase(ismember(jointbase.VariantID,VariantIDPassed),:);
jointcolumn = table((1:numel(jointcolumn))’,jointcolumn’,’VariableNames’,{‘VariantID’,’Joint Column’});
jointcolumn = jointcolumn(ismember(jointcolumn.VariantID,VariantIDPassed),:);
jointtopordinarysegment = table((1:numel(jointtopordinarysegment))’,jointtopordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Top Ordinary Segment’});
jointtopordinarysegment = jointtopordinarysegment(ismember(jointtopordinarysegment.VariantID,VariantIDPassed),:);
jointbottomordinarysegment = table((1:numel(jointbottomordinarysegment))’,jointbottomordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Ordinary Segment’});
jointbottomordinarysegment = jointbottomordinarysegment(ismember(jointbottomordinarysegment.VariantID,VariantIDPassed),:);
jointtopspecialsegment = table((1:numel(jointtopspecialsegment))’,jointtopspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Top Special Segment’});
jointtopspecialsegment = jointtopspecialsegment(ismember(jointtopspecialsegment.VariantID,VariantIDPassed),:);
jointbottomspecialsegment = table((1:numel(jointbottomspecialsegment))’,jointbottomspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Special Segment’});
jointbottomspecialsegment = jointbottomspecialsegment(ismember(jointbottomspecialsegment.VariantID,VariantIDPassed),:);
Zbottombeam{ijk} = table((1:numel(Zbottombeam{ijk,:}))’,Zbottombeam{ijk,:}’,’VariableNames’,{‘VariantID’,’Z Bottom Beam’});
Zbottombeam = Zbottombeam(VariantIDPassed);
%% Name the Frame
% column
for i = 1:height(VariantIDPassed)
jointIcolumn = 0;
jointJcolumn = 0;
jointcolumnnew{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointcolumnnew{i,:} = vertcat(jointbase.("Joint Base"){i},jointcolumnnew{i});
for j = 1:height(jointcolumnnew{i,1})-2
jointIcolumn(j) = jointcolumnnew{i,1}.ID(j);
jointJcolumn(j) = jointcolumnnew{i,1}.ID(j+2);
end
framecolumn{i,:} = table((1:j)’,jointIcolumn’,jointJcolumn’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Name the Frame
% top ordinary segment (TOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endTOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointTOS{i,:} = vertcat(jointtopordinarysegment.("Joint Top Ordinary Segment"){i},endTOS{i});
jointTOSnew1{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H),:),2);
jointTOSnew2{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H*Ns),:),2);
jointTOSnew{i,:} = vertcat(jointTOSnew1{i},jointTOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew1{i,1})-1
jointI(j) = jointTOSnew1{i,1}.ID(j);
jointJ(j) = jointTOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(framecolumn{i,1}.("Frame ID"));
frameTOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS1{i,1}(median(1:height(frameTOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew2{i,1})-1
jointI(j) = jointTOSnew2{i,1}.ID(j);
jointJ(j) = jointTOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS1{i,1}.("Frame ID"));
frameTOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS2{i,1}(median(1:height(frameTOS2{i,1})),:) = [];
end
frameTOS = cellfun(@(varargin)vertcat(varargin{:}),frameTOS1,frameTOS2,’UniformOutput’,false);
%% Name the Frame
% bottom ordinary segment (BOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endBOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i}.Z),:);
jointBOS{i,:} = vertcat(jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i},endBOS{i});
jointBOSnew1{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(1)),:),2);
jointBOSnew2{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(2)),:),2);
jointBOSnew{i,:} = vertcat(jointBOSnew1{i},jointBOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBOSnew1{i,1})-1
jointI(j) = jointBOSnew1{i,1}.ID(j);
jointJ(j) = jointBOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS{i,1}.("Frame ID"));
frameBOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS1{i,1}(median(1:height(frameBOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ =0;
for j = 1:height(jointBOSnew2{i,1})-1
jointI(j) = jointBOSnew2{i,1}.ID(j);
jointJ(j) = jointBOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS1{i,1}.("Frame ID"));
frameBOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS2{i,1}(median(1:height(frameBOS2{i,1})),:) = [];
end
frameBOS = cellfun(@(varargin)vertcat(varargin{:}),frameBOS1,frameBOS2,’UniformOutput’,false);
%% Name the Frame
% top special segment (TSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointTSSnew1{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H),:),2);
jointTSSnew2{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H*Ns),:),2);
jointTSSnew{i,:} = vertcat(jointTSSnew1{i},jointTSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew1{i,1})-1
jointI(j) = jointTSSnew1{i,1}.ID(j);
jointJ(j) = jointTSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS{i,1}.("Frame ID"));
frameTSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew2{i,1})-1
jointI(j) = jointTSSnew2{i,1}.ID(j);
jointJ(j) = jointTSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS1{i,1}.("Frame ID"));
frameTSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameTSS = cellfun(@(varargin)vertcat(varargin{:}),frameTSS1,frameTSS2,’UniformOutput’,false);
%% Name the Frame
% bottom special segment (BSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointBSSnew1{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(1)),:),2);
jointBSSnew2{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(2)),:),2);
jointBSSnew{i,:} = vertcat(jointBSSnew1{i},jointBSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew1{i,1})-1
jointI(j) = jointBSSnew1{i,1}.ID(j);
jointJ(j) = jointBSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS{i,1}.("Frame ID"));
frameBSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew2{i,1})-1
jointI(j) = jointBSSnew2{i,1}.ID(j);
jointJ(j) = jointBSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBSS1{i,1}.("Frame ID"));
frameBSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameBSS = cellfun(@(varargin)vertcat(varargin{:}),frameBSS1,frameBSS2,’UniformOutput’,false);
%% Name the Frame
% diagonal ordinary segment (DOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tosleft{i,:} = frameTOS{i,1}(1:2:end,:);
tosright{i,:} = frameTOS{i,1}(2:2:end,:);
bosleft{i,:} = frameBOS{i,1}(1:2:end,:);
bosright{i,:} = frameBOS{i,1}(2:2:end,:);
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tosleft{i,1})
jointI(j) = tosleft{i,1}.JointI(j);
jointJ(j) = bosleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameBSS{i,1}.("Frame ID"));
frameDOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bosright{i,1})
jointI(j) = bosright{i,1}.JointI(j);
jointJ(j) = tosright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS1{i,1}.("Frame ID"));
frameDOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDOS = cellfun(@(varargin)vertcat(varargin{:}),frameDOS1,frameDOS2,’UniformOutput’,false);
%% Name the Frame
% diagonal special segment (DSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
tssright{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
bssright{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS{i,1}.("Frame ID"));
frameDSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bssright{i,1})
jointI(j) = bssright{i,1}.JointI(j);
jointJ(j) = tssright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDSS1{i,1}.("Frame ID"));
frameDSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDSS = cellfun(@(varargin)vertcat(varargin{:}),frameDSS1,frameDSS2,’UniformOutput’,false);
%% Name the Frame
% vertical special segment (VSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
endtss1{i,:} = max(jointTSSnew1{i,1}.ID);
endtss2{i,:} = max(jointTSSnew2{i,1}.ID);
endbss1{i,:} = max(jointBSSnew1{i,1}.ID);
endbss2{i,:} = max(jointBSSnew2{i,1}.ID);
endtss{i,:} = vertcat(endtss1{i},endtss2{i});
endbss{i,:} = vertcat(endbss1{i},endbss2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointI(j);
end
lastframenumber{i,:} = max(frameDSS{i,1}.("Frame ID"));
frameVSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:NumberStory
jointI(j) = endtss{i,:}(j);
jointJ(j) = endbss{i,:}(j);
end
lastframenumber{i,:} = max(frameVSS1{i,1}.("Frame ID"));
frameVSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameVSS = cellfun(@(varargin)vertcat(varargin{:}),frameVSS1,frameVSS2,’UniformOutput’,false);
%% Print ‘frame’ data to textline
txtframeCOLUMN = strings(height(framecolumn),1);
for i = 1:height(framecolumn)
T = framecolumn{i};
M = T{:,:};
txtframeCOLUMN(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTOS = strings(height(frameTOS),1);
for i = 1:height(frameTOS)
T = frameTOS{i};
M = T{:,:};
txtframeTOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBOS = strings(height(frameBOS),1);
for i = 1:height(frameBOS)
T = frameBOS{i};
M = T{:,:};
txtframeBOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTSS = strings(height(frameTSS),1);
for i = 1:height(frameTSS)
T = frameTSS{i};
M = T{:,:};
txtframeTSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBSS = strings(height(frameBSS),1);
for i = 1:height(frameBSS)
T = frameBSS{i};
M = T{:,:};
txtframeBSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDOS = strings(height(frameDOS),1);
for i = 1:height(frameDOS)
T = frameDOS{i};
M = T{:,:};
txtframeDOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDSS = strings(height(frameDSS),1);
for i = 1:height(frameDSS)
T = frameDSS{i};
M = T{:,:};
txtframeDSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeVSS = strings(height(frameVSS),1);
for i = 1:height(frameVSS)
T = frameVSS{i};
M = T{:,:};
txtframeVSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
%% Print ‘joint’ data to textline
txtjointBASE = strings(height(jointbase),1);
for i = 1:height(jointbase)
T = jointbase.("Joint Base"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBASE(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointCOLUMN = strings(height(jointcolumn),1);
for i = 1:height(jointcolumn)
T = jointcolumn.("Joint Column"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointCOLUMN(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTOS = strings(height(jointtopordinarysegment),1);
for i = 1:height(jointtopordinarysegment)
T = jointtopordinarysegment.("Joint Top Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBOS = strings(height(jointbottomordinarysegment),1);
for i = 1:height(jointbottomordinarysegment)
T = jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTSS = strings(height(jointtopspecialsegment),1);
for i = 1:height(jointtopspecialsegment)
T = jointtopspecialsegment.("Joint Top Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBSS = strings(height(jointbottomspecialsegment),1);
for i = 1:height(jointbottomspecialsegment)
T = jointbottomspecialsegment.("Joint Bottom Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
%% WRITE s2k Extension Files
VariantModel = compose(‘%d’, 1:height(VariantIDPassed));
lined= append(txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS);
for i = 1:numel(VariantModel)
writefile(VariantModel{i},txtjointBASE{i},txtjointCOLUMN{i},txtjointTOS{i},txtjointBOS{i},txtjointTSS{i},txtjointBSS{i},txtframeCOLUMN{i},txtframeTOS{i},txtframeBOS{i},txtframeTSS{i},txtframeBSS{i},txtframeDOS{i},txtframeDSS{i},txtframeVSS{i});
end
files = dir(‘*.s2k’);
files(:).name;
function writefile(C,txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS,txtframeCOLUMN,txtframeTOS,txtframeBOS,txtframeTSS,txtframeBSS,txtframeDOS,txtframeDSS,txtframeVSS)
fido = fopen("ModelVariant"+C+".s2k",’wt’);
newline = ‘n’;
line1=’File D:\MAGISTER\KULIAH\TESIS\S2K FILE\ModelVariant-%d.s2k was saved on m/d/yy at h:mm:ss’;
line2=’TABLE: "PROGRAM CONTROL"’;
line3=’ ProgramName=SAP2000 Version=25.0.0 ProgLevel=Ultimate LicenseNum=3010*1D6KZBK478DMQCT LicenseOS=Yes LicenseSC=Yes LicenseHT=No CurrUnits="KN, m, C" SteelCode="AISC 360-10" ConcCode="ACI 318-19" AlumCode="AA 2015" _’;
line4=’ ColdCode=AISI-16 RegenHinge=Yes’;
line5=’TABLE: "ACTIVE DEGREES OF FREEDOM"’;
line6=’ UX=Yes UY=No UZ=Yes RX=No RY=Yes RZ=No’;
line7=’TABLE: "ANALYSIS OPTIONS"’;
line8=’ Solver=Multithreaded SolverProc="Analysis Process" NumParallel=0 Force32Bit=No StiffCase=None GeomMod=None HingeOpt="In Elements" NumAThreads=0 MaxFileSize=0 NumDThreads=0 NumRThreads=0 _ UseMMFiles="Program Determined" AllowDiff=No’;
line9=’TABLE: "COORDINATE SYSTEMS"’;
line10=’ Name=GLOBAL Type=Cartesian X=0 Y=0 Z=0 AboutZ=0 AboutY=0 AboutX=0′;
line11=’TABLE: "GRID LINES"’;
line12=’ CoordSys=GLOBAL AxisDir=X GridID=A XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End AllVisible=Yes BubbleSize=1,5′;
line13=’ CoordSys=GLOBAL AxisDir=X GridID=B XRYZCoord=15 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line14=’ CoordSys=GLOBAL AxisDir=X GridID=C XRYZCoord=30 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line15=’ CoordSys=GLOBAL AxisDir=Y GridID=1 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=Start’;
line16=’ CoordSys=GLOBAL AxisDir=Z GridID=Z0 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line17=’ CoordSys=GLOBAL AxisDir=Z GridID=Z1 XRYZCoord=5 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line18=’ CoordSys=GLOBAL AxisDir=Z GridID=Z2 XRYZCoord=10 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line19=’TABLE: "MATERIAL PROPERTIES 01 – GENERAL"’;
line20=’ Material=4000Psi Type=Concrete Grade="’ + "f’c 4000 " + ‘psi"’+ ‘ SymType=Isotropic TempDepend=No Color=Green GUID=b0920fc0-a39b-46e4-a096-037f0f0739a7 Notes="Customary ‘+"f’c 4000 psi "+’01/02/2024 20:13:33"’;
line21=’ Material=BJ-37 Type=Steel Grade="Grade 50" SymType=Isotropic TempDepend=No Color=Magenta Notes="ASTM A992 Grade 50 01/02/2024 20:03:34"’;
line22=’TABLE: "MATERIAL PROPERTIES 02 – BASIC MECHANICAL PROPERTIES"’;
line23=’ Material=4000Psi UnitWeight=23,5631216161854 UnitMass=2,40276960558926 E1=24855578,0600518 G12=10356490,8583549 U12=0,2 A1=9,89999952793124E-06′;
line24=’ Material=BJ-37 UnitWeight=76,9728639422648 UnitMass=7,84904737995992 E1=199947978,795958 G12=76903068,7676762 U12=0,3 A1=1,16999994421006E-05′;
line25=’TABLE: "MATERIAL PROPERTIES 03A – STEEL DATA"’;
line26=’ Material=BJ-37 Fy=235000 Fu=352500 EffFy=235000 EffFu=352500 SSCurveOpt=Simple SSHysType=Kinematic SHard=0,015 SMax=0,11 SRup=0,17 FinalSlope=-0,1 CoupModType="Von Mises"’;
line27=’TABLE: "MATERIAL PROPERTIES 06 – DAMPING PARAMETERS"’;
line28=’ Material=4000Psi ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line29=’ Material=BJ-37 ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line30=’TABLE: "MATERIAL PROPERTIES 09 – ACCEPTANCE CRITERIA"’;
line31=’ Material=4000Psi IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,003 LSComp=-0,006 CPComp=-0,015 IgnoreTens=Yes’;
line32=’ Material=BJ-37 IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,005 LSComp=-0,01 CPComp=-0,02′;
line33=’TABLE: "FRAME SECTION PROPERTIES 01 – GENERAL"’;
line34=’ SectionName=ExampleWideFlanged Material=BJ-37 Shape="I/Wide Flange" t3=0,25 t2=0,15 tf=0,012 tw=0,008 t2b=0,15 tfb=0,012 FilletRadius=0,012 Area=0,005552 TorsConst=2,13418666666667E-07 I33=6,04638656154112E-05 _’;
line35=’ I22=6,76749435145855E-06 I23=-6,7762635780344E-21 AS2=0,00200790111881035 AS3=0,00357344416053972 S33Top=0,00048371092492329 S33Bot=0,00048371092492329 S22Left=9,02332580194473E-05 S22Right=9,02332580194473E-05 _’;
line36=’ Z33=0,000546402338734841 Z22=0,00013961366126516 R33=0,10435739412628 R22=0,0349131651083826 CGOffset3=-1,38777878078145E-17 CGOffset2=5,55111512312578E-17 EccV2=0 EccV3=0 Cw=9,558675E-08 ConcCol=No ConcBeam=No _’;
line37=’ Color=Blue TotalWt=60,3707599671425 TotalMass=6,15610399662034 FromFile=No AMod=1 A2Mod=1 A3Mod=1 JMod=1 I2Mod=1 I3Mod=1 MMod=1 WMod=1 Notes="Added 03/04/2024 20:08:55′;
line38=’TABLE: "LOAD PATTERN DEFINITIONS"’;
line39=’ LoadPat=DEAD DesignType=Dead SelfWtMult=1 GUID=d2c74fc0-a771-416d-b3dc-4b0a2047268d’;
line40=’ LoadPat=SUPERDEAD DesignType="Super Dead" SelfWtMult=0 GUID=91534b51-672f-4fb0-a037-d7225de00c69 Notes="Added 01/02/2024 20:08:11"’;
line41=’ LoadPat=LIVE DesignType=Live SelfWtMult=0 GUID=1f6f6fd1-e0f1-4fcb-bf3d-dc86bd53f1a8 Notes="Added 01/02/2024 20:08:16"’;
line42=’TABLE: "GROUPS 1 – DEFINITIONS"’;
line43=’ GroupName=All Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line44=’ GroupName=ST_Top Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line45=’ GroupName=ST_Bot Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line46=’ GroupName=ST_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line47=’ GroupName=ST_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line48=’ GroupName=OT_Top1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line49=’ GroupName=OT_Top2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Yellow’;
line49a=’ GroupName=OT_Bot1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line49b=’ GroupName=OT_Bot2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line49c=’ GroupName=OT_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line49d=’ GroupName=OT_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line49e=’ GroupName=Column_End Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line50=’TABLE: "JOINT PATTERN DEFINITIONS"’;
line51=’ Pattern=Default’;
line52=’TABLE: "MASS SOURCE"’;
line53=’ MassSource=MSSSRC1 Elements=Yes Masses=Yes Loads=Yes IsDefault=Yes LoadPat=DEAD Multiplier=1′;
line54=’ MassSource=MSSSRC1 LoadPat=SUPERDEAD Multiplier=1′;
line55=’ MassSource=MSSSRC1 LoadPat=LIVE Multiplier=0,5′;
line56=’TABLE: "LOAD CASE DEFINITIONS"’;
line57=’ Case=DEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=91b91585-f6e6-446e-ac30-362013fd8af9′;
line58=’ Case=MODAL Type=LinModal InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Other DesActOpt="Prog Det" DesignAct=Other AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=3e160405-efbf-45fb-ae06-c6da634ca183′;
line59=’ Case=SUPERDEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType="Super Dead" DesActOpt="Prog Det" DesignAct="Long-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=2ca565b7-af73-42e9-9208-0a0739594699′;
line60=’ Case=LIVE Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Live DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e969dd8f-56cc-40d7-af8a-0fba39157fcb’;
line61=’ Case="Gravity NLS" Type=NonStatic InitialCond=Zero MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line62=’ Case=Pushover-UX Type=NonStatic InitialCond="Gravity NLS" MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Quake DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line63=’TABLE: "CASE – STATIC 1 – LOAD ASSIGNMENTS"’;
line64=’ Case=DEAD LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line65=’ Case=SUPERDEAD LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line66=’ Case=LIVE LoadType="Load pattern" LoadName=LIVE LoadSF=1′;
line67=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line68=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line69=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=LIVE LoadSF=0,5′;
line70=’ Case=Pushover-UX LoadType=Accel LoadName="Accel UX" TransAccSF=-1′;
line71=’TABLE: "CASE – STATIC 2 – NONLINEAR LOAD APPLICATION"’;
line72=’ Case="Gravity NLS" LoadApp="Full Load" MonitorDOF=U1 MonitorJt=9′;
line73=’ Case=Pushover-UX LoadApp="Displ Ctrl" DisplType=Monitored TargetDispl=1 MonitorDOF=U1 MonitorJt=9′;
line74=’TABLE: "CASE – STATIC 4 – NONLINEAR PARAMETERS"’;
line75=’ Case="Gravity NLS" GeoNonLin=P-Delta ResultsSave="Final State" SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 _’;
line76=’ TFAccelFact=1 TFNoStop=No’;
line77=’ Case=Pushover-UX GeoNonLin=P-Delta ResultsSave="Multiple States" MinNumState=10 MaxNumState=100 PosIncOnly=Yes SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 _’;
line78=’ MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 TFAccelFact=1 TFNoStop=No’;
line79=’TABLE: "CASE – MODAL 1 – GENERAL"’;
line80=’ Case=MODAL ModeType=Eigen MaxNumModes=12 MinNumModes=1 EigenShift=0 EigenCutoff=0 EigenTol=1E-09 AutoShift=Yes’;
line81=’TABLE: "JOINT COORDINATES"’;
line82= append(txtjointBASE,txtjointCOLUMN,txtjointTOS,txtjointBOS,txtjointTSS,txtjointBSS);
line83=’TABLE: "CONNECTIVITY – FRAME"’;
line84= append(txtframeCOLUMN,txtframeTOS,txtframeBOS,txtframeTSS,txtframeBSS,txtframeDOS,txtframeDSS,txtframeVSS);
line85=’TABLE: "END TABLE DATA"’;
combine1 = append(line1,newline,line2,newline,line3,newline,line4,newline,line5,newline,line6,newline,line7,newline,line8,newline,line9,newline,line10,newline,line11,newline,line12,newline,line13,newline,line14,newline,line15,newline,line16,newline,line17,newline,line18,newline,line19,newline,line20,newline,line21,newline,line22,newline,line23,newline,line24,newline,line25,newline,line26,newline,line27,newline,line28,newline,line29,newline,line30,newline,line31,newline,line32,newline,line33,newline,line34,newline,line35,newline,line36);
combine2 = append(combine1,newline,line37,newline,line38,newline,line39,newline,line40,newline,line41,newline,line42,newline,line43,newline,line44,newline,line45,newline,line46,newline,line47,newline,line48,newline,line49,newline,line49a,newline,line49b,newline,line49c,newline,line49d,newline,line49e,newline,line50,newline,line51,newline,line52,newline,line53,newline,line54,newline,line55,newline,line56,newline,line57,newline,line58,newline,line59,newline,line60,newline,line61,newline,line62,newline,line63,newline,line64,newline,line65,newline,line66,newline,line67,newline,line68,newline);
combine3 = append(combine2,line69,newline,line70,newline,line71,newline,line72,newline,line73,newline,line74,newline,line75,newline,line76,newline,line77,newline,line78,newline,line79,newline,line80,newline,line81,newline,line82,newline,line83,newline,line84,newline,line85);
fprintf(fido,combine3,C);
fclose(fido);
end
and second problem is why the result inside the file is different between when i Run the matlab by stepping (not single-run) and when i do one time running. When i do stepping-run one-by one the result is same with what my ittention. Because each file doesnt do double writing (just end in line no.85 (END TABLE DATA). The result will be like this:
But when i do one-time running it happened like this :
then how to stop double writing like that ? writefile, sprintf, text file, txt MATLAB Answers — New Questions
Unable to plot all lines on the same graph
I have written my equations with no error messages, and for some reason when it comes to plotting the graph I am only able to plot a couple of the lines ( when the code is ran).
% Constants
% ceiling
R1 = 0.01126172832; % Value of resistance R1
R2 = 0.3449615264; % Value of resistance R2
R3 = 3.642793719*10^-6; % Value of resistance R3
C1 = 54551.538; % Value of capacitance C1
C2 = 14220.95348; % Value of capacitance C2
C3 = 25734.0951; % Value of capacitance C3
Q_ceiling = 131.6056667;
%floor
R4 = 0.01070907326; % Value of resistance R4
R5 = 0.1640164882; % Value of resistance R5
R6 = 3.464028232*10^-6; % Value of resistance R6
C4 = 57366.738; % Value of capacitance C4
C5 = 7477.421738; % Value of capacitance C5
C6 = 27062.1351; % Value of capacitance C6
Q_floor = 138.3973924; % Value of Q
% wall with window
R7 = 0.0104376743; % Value of resistance R7
R8 = 0.3197196698; % Value of resistance R8
R9 = 3.376239713*10^-6; % Value of resistance R9
C7 = 58858.38; % Value of capacitance C7
C8 = 15343.69725; % Value of capacitance C8
C9 = 27765.801; % Value of capacitance C9
Q_windowwall = 141.9970071; % Value of Qwindowwall
%sidewall
R10 = 9.367616659*10^-3; % Value of resistance R10
R11 = 0.2869423992; % Value of resistance R11
R12 = 3.030111735*10^-6; % Value of resistance R12
C10 = 65581.74; % Value of capacitance C10
C11 = 17096.39925; % Value of capacitance C11
C12 = 30937.473; % Value of capacitance C12
Q_sidewall = 158.2172462; % Value of Qsidewall
% BH
R13 = 0.01992037022; % Value of resistance R13
R14 = 0.610187098 ; % Value of resistance R14
R15 = 0.01610893939; % Value of resistance R15
C13 = 30840.0192; % Value of capacitance C13
C14 = 8039.63544; % Value of capacitance C14
C15 = 15686.66403; % Value of capacitance C15
Q_BH = 74.0135789; % Value of QBH
% REAR DOORS
R16 = 0.02676244689; % Value of resistance R16
R17 = 0.8197688908; % Value of resistance R17
R18 = 8.656759486*10^-6; % Value of resistance R18
C16 = 22955.472; % Value of capacitance C16
C17 = 5984.2254; % Value of capacitance C17
C18 = 10828.9944; % Value of capacitance C18
Q_doors = 55.38053069; % Value of QDOORS
% Time vector for a 2-hour period (in seconds)
t = 0:0.01:2 *3600;
% Calculation of ∆T1_ceiling
deltaT1_ceiling = R1*Q_ceiling*(1 – exp(-1/(R1*C1)*t)) + R2*Q_ceiling*(1 – exp(-1/(R2*C2)*t)) + R3*Q_ceiling*(1 – exp(-1/(R3*C3)*t));
% Calculation of ∆T1_floor
deltaT1_floor= R4*Q_floor*(1 – exp(-1/(R4*C4)*t)) + R5*Q_floor*(1 – exp(-1/(R5*C5)*t)) + R6*Q_windowwall*(1 – exp(-1/(R6*C6)*t));
% Calculation of ∆T1_windowwall
deltaT1_windowwall= R7*Q_windowwall*(1 – exp(-1/(R7*C7)*t)) + R8*Q_windowwall*(1 – exp(-1/(R8*C8)*t)) + R9*Q_windowwall*(1 – exp(-1/(R9*C9)*t));
%Calculation of ∆T1_sidewall
deltaT1_sidewall= R10*Q_sidewall*(1 – exp(-1/(R10*C10)*t)) + R11*Q_sidewall*(1 – exp(-1/(R11*C11)*t)) + R12*Q_sidewall*(1 – exp(-1/(R12*C12)*t));
%Calculation of ∆T1_BH
deltaT1_BH= R13*Q_BH*(1 – exp(-1/(R13*C13)*t)) + R14*Q_BH*(1 – exp(-1/(R14*C14)*t)) + R15*Q_BH*(1 – exp(-1/(R15*C15)*t));
% Calculation of ∆T1_DOORS
deltaT1_doors= R16*Q_doors*(1 – exp(-1/(R16*C16)*t)) + R17*Q_doors*(1 – exp(-1/(R17*C17)*t)) + R18*Q_doors*(1 – exp(-1/(R18*C18)*t));
% Convert time to hours for plotting
t_hours = t / 3600; % Convert time from seconds to hours
%plotting
plot(t_hours, deltaT1_ceiling);
hold on;
plot(t_hours, deltaT1_sidewall);
plot(t_hours, deltaT1_doors);
plot(t_hours, deltaT1_BH);
plot(t_hours, deltaT1_windowwall);
plot(t_hours, deltaT1_floor);
hold off;I have written my equations with no error messages, and for some reason when it comes to plotting the graph I am only able to plot a couple of the lines ( when the code is ran).
% Constants
% ceiling
R1 = 0.01126172832; % Value of resistance R1
R2 = 0.3449615264; % Value of resistance R2
R3 = 3.642793719*10^-6; % Value of resistance R3
C1 = 54551.538; % Value of capacitance C1
C2 = 14220.95348; % Value of capacitance C2
C3 = 25734.0951; % Value of capacitance C3
Q_ceiling = 131.6056667;
%floor
R4 = 0.01070907326; % Value of resistance R4
R5 = 0.1640164882; % Value of resistance R5
R6 = 3.464028232*10^-6; % Value of resistance R6
C4 = 57366.738; % Value of capacitance C4
C5 = 7477.421738; % Value of capacitance C5
C6 = 27062.1351; % Value of capacitance C6
Q_floor = 138.3973924; % Value of Q
% wall with window
R7 = 0.0104376743; % Value of resistance R7
R8 = 0.3197196698; % Value of resistance R8
R9 = 3.376239713*10^-6; % Value of resistance R9
C7 = 58858.38; % Value of capacitance C7
C8 = 15343.69725; % Value of capacitance C8
C9 = 27765.801; % Value of capacitance C9
Q_windowwall = 141.9970071; % Value of Qwindowwall
%sidewall
R10 = 9.367616659*10^-3; % Value of resistance R10
R11 = 0.2869423992; % Value of resistance R11
R12 = 3.030111735*10^-6; % Value of resistance R12
C10 = 65581.74; % Value of capacitance C10
C11 = 17096.39925; % Value of capacitance C11
C12 = 30937.473; % Value of capacitance C12
Q_sidewall = 158.2172462; % Value of Qsidewall
% BH
R13 = 0.01992037022; % Value of resistance R13
R14 = 0.610187098 ; % Value of resistance R14
R15 = 0.01610893939; % Value of resistance R15
C13 = 30840.0192; % Value of capacitance C13
C14 = 8039.63544; % Value of capacitance C14
C15 = 15686.66403; % Value of capacitance C15
Q_BH = 74.0135789; % Value of QBH
% REAR DOORS
R16 = 0.02676244689; % Value of resistance R16
R17 = 0.8197688908; % Value of resistance R17
R18 = 8.656759486*10^-6; % Value of resistance R18
C16 = 22955.472; % Value of capacitance C16
C17 = 5984.2254; % Value of capacitance C17
C18 = 10828.9944; % Value of capacitance C18
Q_doors = 55.38053069; % Value of QDOORS
% Time vector for a 2-hour period (in seconds)
t = 0:0.01:2 *3600;
% Calculation of ∆T1_ceiling
deltaT1_ceiling = R1*Q_ceiling*(1 – exp(-1/(R1*C1)*t)) + R2*Q_ceiling*(1 – exp(-1/(R2*C2)*t)) + R3*Q_ceiling*(1 – exp(-1/(R3*C3)*t));
% Calculation of ∆T1_floor
deltaT1_floor= R4*Q_floor*(1 – exp(-1/(R4*C4)*t)) + R5*Q_floor*(1 – exp(-1/(R5*C5)*t)) + R6*Q_windowwall*(1 – exp(-1/(R6*C6)*t));
% Calculation of ∆T1_windowwall
deltaT1_windowwall= R7*Q_windowwall*(1 – exp(-1/(R7*C7)*t)) + R8*Q_windowwall*(1 – exp(-1/(R8*C8)*t)) + R9*Q_windowwall*(1 – exp(-1/(R9*C9)*t));
%Calculation of ∆T1_sidewall
deltaT1_sidewall= R10*Q_sidewall*(1 – exp(-1/(R10*C10)*t)) + R11*Q_sidewall*(1 – exp(-1/(R11*C11)*t)) + R12*Q_sidewall*(1 – exp(-1/(R12*C12)*t));
%Calculation of ∆T1_BH
deltaT1_BH= R13*Q_BH*(1 – exp(-1/(R13*C13)*t)) + R14*Q_BH*(1 – exp(-1/(R14*C14)*t)) + R15*Q_BH*(1 – exp(-1/(R15*C15)*t));
% Calculation of ∆T1_DOORS
deltaT1_doors= R16*Q_doors*(1 – exp(-1/(R16*C16)*t)) + R17*Q_doors*(1 – exp(-1/(R17*C17)*t)) + R18*Q_doors*(1 – exp(-1/(R18*C18)*t));
% Convert time to hours for plotting
t_hours = t / 3600; % Convert time from seconds to hours
%plotting
plot(t_hours, deltaT1_ceiling);
hold on;
plot(t_hours, deltaT1_sidewall);
plot(t_hours, deltaT1_doors);
plot(t_hours, deltaT1_BH);
plot(t_hours, deltaT1_windowwall);
plot(t_hours, deltaT1_floor);
hold off; I have written my equations with no error messages, and for some reason when it comes to plotting the graph I am only able to plot a couple of the lines ( when the code is ran).
% Constants
% ceiling
R1 = 0.01126172832; % Value of resistance R1
R2 = 0.3449615264; % Value of resistance R2
R3 = 3.642793719*10^-6; % Value of resistance R3
C1 = 54551.538; % Value of capacitance C1
C2 = 14220.95348; % Value of capacitance C2
C3 = 25734.0951; % Value of capacitance C3
Q_ceiling = 131.6056667;
%floor
R4 = 0.01070907326; % Value of resistance R4
R5 = 0.1640164882; % Value of resistance R5
R6 = 3.464028232*10^-6; % Value of resistance R6
C4 = 57366.738; % Value of capacitance C4
C5 = 7477.421738; % Value of capacitance C5
C6 = 27062.1351; % Value of capacitance C6
Q_floor = 138.3973924; % Value of Q
% wall with window
R7 = 0.0104376743; % Value of resistance R7
R8 = 0.3197196698; % Value of resistance R8
R9 = 3.376239713*10^-6; % Value of resistance R9
C7 = 58858.38; % Value of capacitance C7
C8 = 15343.69725; % Value of capacitance C8
C9 = 27765.801; % Value of capacitance C9
Q_windowwall = 141.9970071; % Value of Qwindowwall
%sidewall
R10 = 9.367616659*10^-3; % Value of resistance R10
R11 = 0.2869423992; % Value of resistance R11
R12 = 3.030111735*10^-6; % Value of resistance R12
C10 = 65581.74; % Value of capacitance C10
C11 = 17096.39925; % Value of capacitance C11
C12 = 30937.473; % Value of capacitance C12
Q_sidewall = 158.2172462; % Value of Qsidewall
% BH
R13 = 0.01992037022; % Value of resistance R13
R14 = 0.610187098 ; % Value of resistance R14
R15 = 0.01610893939; % Value of resistance R15
C13 = 30840.0192; % Value of capacitance C13
C14 = 8039.63544; % Value of capacitance C14
C15 = 15686.66403; % Value of capacitance C15
Q_BH = 74.0135789; % Value of QBH
% REAR DOORS
R16 = 0.02676244689; % Value of resistance R16
R17 = 0.8197688908; % Value of resistance R17
R18 = 8.656759486*10^-6; % Value of resistance R18
C16 = 22955.472; % Value of capacitance C16
C17 = 5984.2254; % Value of capacitance C17
C18 = 10828.9944; % Value of capacitance C18
Q_doors = 55.38053069; % Value of QDOORS
% Time vector for a 2-hour period (in seconds)
t = 0:0.01:2 *3600;
% Calculation of ∆T1_ceiling
deltaT1_ceiling = R1*Q_ceiling*(1 – exp(-1/(R1*C1)*t)) + R2*Q_ceiling*(1 – exp(-1/(R2*C2)*t)) + R3*Q_ceiling*(1 – exp(-1/(R3*C3)*t));
% Calculation of ∆T1_floor
deltaT1_floor= R4*Q_floor*(1 – exp(-1/(R4*C4)*t)) + R5*Q_floor*(1 – exp(-1/(R5*C5)*t)) + R6*Q_windowwall*(1 – exp(-1/(R6*C6)*t));
% Calculation of ∆T1_windowwall
deltaT1_windowwall= R7*Q_windowwall*(1 – exp(-1/(R7*C7)*t)) + R8*Q_windowwall*(1 – exp(-1/(R8*C8)*t)) + R9*Q_windowwall*(1 – exp(-1/(R9*C9)*t));
%Calculation of ∆T1_sidewall
deltaT1_sidewall= R10*Q_sidewall*(1 – exp(-1/(R10*C10)*t)) + R11*Q_sidewall*(1 – exp(-1/(R11*C11)*t)) + R12*Q_sidewall*(1 – exp(-1/(R12*C12)*t));
%Calculation of ∆T1_BH
deltaT1_BH= R13*Q_BH*(1 – exp(-1/(R13*C13)*t)) + R14*Q_BH*(1 – exp(-1/(R14*C14)*t)) + R15*Q_BH*(1 – exp(-1/(R15*C15)*t));
% Calculation of ∆T1_DOORS
deltaT1_doors= R16*Q_doors*(1 – exp(-1/(R16*C16)*t)) + R17*Q_doors*(1 – exp(-1/(R17*C17)*t)) + R18*Q_doors*(1 – exp(-1/(R18*C18)*t));
% Convert time to hours for plotting
t_hours = t / 3600; % Convert time from seconds to hours
%plotting
plot(t_hours, deltaT1_ceiling);
hold on;
plot(t_hours, deltaT1_sidewall);
plot(t_hours, deltaT1_doors);
plot(t_hours, deltaT1_BH);
plot(t_hours, deltaT1_windowwall);
plot(t_hours, deltaT1_floor);
hold off; graph, plot MATLAB Answers — New Questions
How to change methods access to public in App Designer
Hello, I’m currrently creating an app in App Designer MATLAB. I’m trying to change the header names of a table that is being read in. There are 27 columns so my approach is to read in a MAT file with the header names. App Designer is making it difficult to load the file. I saw an example where the method was switched to public instead of private to make it accessible. How is this possible? The area is grayed out and I’m unsure how to switch it to public.Hello, I’m currrently creating an app in App Designer MATLAB. I’m trying to change the header names of a table that is being read in. There are 27 columns so my approach is to read in a MAT file with the header names. App Designer is making it difficult to load the file. I saw an example where the method was switched to public instead of private to make it accessible. How is this possible? The area is grayed out and I’m unsure how to switch it to public. Hello, I’m currrently creating an app in App Designer MATLAB. I’m trying to change the header names of a table that is being read in. There are 27 columns so my approach is to read in a MAT file with the header names. App Designer is making it difficult to load the file. I saw an example where the method was switched to public instead of private to make it accessible. How is this possible? The area is grayed out and I’m unsure how to switch it to public. appdesigner, load mat MATLAB Answers — New Questions
What is the correct normalization for a flat top window?
Hi, I have a question about FFT. Considering that I have a data vector of accelerations sampled with an accelerometer and that I want to apply a flat top window, in order to obtain the most accurate amplitude in the FFT, what would be the right code for normalization in this specific case?
I tried this one, but I’m not sure if it’s correct:
N=numel(data);
w=flattopwin(N);
X=2*fft(data.*w)/sum(w);
Thanks in advance for you help.Hi, I have a question about FFT. Considering that I have a data vector of accelerations sampled with an accelerometer and that I want to apply a flat top window, in order to obtain the most accurate amplitude in the FFT, what would be the right code for normalization in this specific case?
I tried this one, but I’m not sure if it’s correct:
N=numel(data);
w=flattopwin(N);
X=2*fft(data.*w)/sum(w);
Thanks in advance for you help. Hi, I have a question about FFT. Considering that I have a data vector of accelerations sampled with an accelerometer and that I want to apply a flat top window, in order to obtain the most accurate amplitude in the FFT, what would be the right code for normalization in this specific case?
I tried this one, but I’m not sure if it’s correct:
N=numel(data);
w=flattopwin(N);
X=2*fft(data.*w)/sum(w);
Thanks in advance for you help. fft, signal processing MATLAB Answers — New Questions
New Planner experience in Teams showing all tasks except Project tasks
I have the new Planner experience in Teams. In My Tasks and My Day sections I can see Planner tasks, Loop tasks, Flagged email tasks but I don’t see tasks from Premium Plans a.k.a. Projects. Everything that I have read says that I should be seeing my tasks from Premium Plans here as well. Anyone else experiencing the same issue?
I have the new Planner experience in Teams. In My Tasks and My Day sections I can see Planner tasks, Loop tasks, Flagged email tasks but I don’t see tasks from Premium Plans a.k.a. Projects. Everything that I have read says that I should be seeing my tasks from Premium Plans here as well. Anyone else experiencing the same issue? Read More
Is there any available pricing for Copilot for Finance?
I’d like to get this on my plan of record with IT and want to estimate a budget but have no idea of the pricing model for this offering.
I’d like to get this on my plan of record with IT and want to estimate a budget but have no idea of the pricing model for this offering. Read More
New Planner Experience not showing Premium Plan (MS Project) tasks
I have the new Planner experience in Teams. In My Tasks and My Day sections I can see Planner tasks, Loop tasks, Flagged email tasks but I don’t see tasks from Premium Plans a.k.a. Projects. Everything that I have read says that I should be seeing my tasks from Premium Plans here as well. Anyone else experiencing the same issue?
I have the new Planner experience in Teams. In My Tasks and My Day sections I can see Planner tasks, Loop tasks, Flagged email tasks but I don’t see tasks from Premium Plans a.k.a. Projects. Everything that I have read says that I should be seeing my tasks from Premium Plans here as well. Anyone else experiencing the same issue? Read More
03 Azure Machine Learning and OSS Model Fine tuning
Hyperparameter optimization, also known as hyperparameter tuning, is a fundamental challenge in the field of machine learning. It involves the selection of an optimal set of hyperparameters for a given learning algorithm. Hyperparameters are parameters that dictate the behavior of the learning process, while other parameters, such as node weights, are learned from the data.
A machine learning model can often require different constraints, weights, or learning rates to effectively capture diverse data patterns. These adjustable measures, known as hyperparameters, must be carefully tuned to ensure that the model can successfully solve the machine learning problem at hand. Hyperparameter optimization seeks to find a combination of hyperparameters that yields an optimal model, minimizing a predefined loss function on independent data.
To achieve this, an objective function is utilized, which takes a set of hyperparameters as input and returns the corresponding loss. The goal is to find the set of hyperparameters that maximizes the generalization performance of the model. Cross-validation is commonly employed to estimate this performance and aid in the selection of optimal hyperparameter values. By maximizing the generalization performance, hyperparameter optimization plays a crucial role in enhancing the overall effectiveness and accuracy of machine learning models.
In this post we will cover the open-source tools and Azure Machine learning tools around hyperparameter tuning. There are three main techniques used for hyperparameter, Grid Search, Random Search, Bayesian Search and more commonly used for Neural Networks, gradient based optimization.
Grid Search
In the realm of hyperparameter optimization, the conventional approach has been to employ grid search or parameter sweep. This technique involves exhaustively exploring a predetermined subset of hyperparameters for a learning algorithm. To guide the grid search algorithm, a performance metric is selected, often determined through cross-validation on the training set or evaluation on a dedicated validation set.
Grid search operates by systematically testing different combinations of hyperparameters within the defined subset. This method, however, can become computationally expensive, especially when dealing with a large number of hyperparameters or a wide range of possible values. Despite its limitations, grid search remains widely used due to its simplicity and interpretability.
During the grid search process, various performance metrics are measured for each combination of hyperparameters. These metrics aid in assessing the model’s effectiveness and allow for the identification of hyperparameter configurations that lead to optimal performance. By evaluating the model’s performance on either the training set or a separate validation set, grid search facilitates the selection of the most appropriate hyperparameter values.
While grid search has proven to be a valuable technique, alternative methods have emerged to address its shortcomings, such as the computationally efficient and automated approaches of Bayesian optimization and random search. These advanced methods provide more sophisticated ways to explore the hyperparameter space and discover optimal configurations, revolutionizing the field of hyperparameter optimization.
sklearn.model_selection.GridSearchCV — scikit-learn 1.4.2 documentation
Random Search
Random Search offers an alternative to the exhaustive enumeration of all possible combinations of hyperparameters by randomly selecting them. This approach can be applied not only to discrete settings but also to continuous and mixed spaces, providing greater flexibility. Random Search has been found to outperform Grid Search, particularly in scenarios where only a small number of hyperparameters significantly impact the final performance of the machine learning algorithm.
In cases where the optimization problem exhibits a low intrinsic dimensionality, Random Search proves to be particularly effective. This refers to situations where the hyperparameters’ interdependencies are limited, allowing for a more efficient exploration of the hyperparameter space. Moreover, Random Search lends itself to embarrassingly parallel implementation, meaning that it can be easily distributed across multiple computing resources for faster processing.
One of the advantages of Random Search is its ability to incorporate prior knowledge by specifying the distribution from which to sample hyperparameters. This enables domain experts to guide the search process based on their understanding of the problem at hand. Despite its simplicity, Random Search remains a significant baseline against which new hyperparameter optimization methods can be compared.
While Random Search has been instrumental in advancing hyperparameter optimization, it is important to note that other sophisticated techniques, such as Bayesian optimization, have emerged as promising alternatives. These methods leverage probabilistic models to intelligently explore the hyperparameter space and efficiently find optimal configurations. The continuous development of new approaches continues to enhance the field of hyperparameter optimization, offering exciting opportunities for improving the performance and efficiency of machine learning models.
sklearn.model_selection.RandomizedSearchCV — scikit-learn 1.4.2 documentation
Bayesian Search
Bayesian optimization is a powerful method for globally optimizing noisy black-box functions. When applied to hyperparameter optimization, Bayesian optimization constructs a probabilistic model that captures the relationship between hyperparameter values, and the objective function evaluated on a validation set. Through an iterative process, Bayesian optimization intelligently selects hyperparameter configurations based on the current model, evaluates their performance, and updates the model to gather valuable information about the function and, more importantly, the location of the optimum.
The key idea behind Bayesian optimization is to strike a balance between exploration and exploitation. Exploration involves selecting hyperparameters that yield uncertain outcomes, while exploitation focuses on hyperparameters that are expected to be close to the optimum. By carefully navigating this trade-off, Bayesian optimization effectively explores the hyperparameter space, gradually narrowing down the search to regions with higher potential for optimal performance.
In practice, Bayesian optimization has demonstrated superior performance compared to traditional methods such as grid search and random search. This advantage stems from its ability to reason about the quality of experiments before actually running them. By leveraging the probabilistic model, Bayesian optimization can make informed decisions about which hyperparameter configurations are most likely to lead to better results, thereby reducing the number of evaluations required.
The efficiency and effectiveness of Bayesian optimization have been widely observed in various domains. Researchers and practitioners have embraced this approach due to its ability to achieve better outcomes with fewer evaluations, making it an invaluable tool for hyperparameter optimization.
skopt.BayesSearchCV — scikit-optimize 0.8.1 documentation
Hyperparameter optimization – Wikipedia
Azure
Having familiarized ourselves with the foundational aspects of hyperparameter tuning, a natural inquiry arises: Does Azure Machine Learning (AML) provide support for hyperparameter tuning? The answer to this question is undoubtedly affirmative, as AML offers comprehensive hyperparameter tuning capabilities. Detailed documentation on this topic can be accessed in the link below, providing users with valuable guidance and information.
Hyperparameter tuning a model (v2) – Azure Machine Learning | Microsoft Learn
AML, through its Python SDK V2, facilitates hyperparameter tuning by offering three distinct algorithms: Grid, Random, and Bayesian. These algorithms empower users to effectively explore the hyperparameter search space and optimize their machine learning models. To leverage the hyperparameter tuning capabilities in AML, the following essential steps can be followed:
Define the parameter search space for your trial: Specify the range and feasible values for each hyperparameter that will undergo tuning.
Specify the sampling algorithm for your sweep job: Select the desired algorithm that will be employed to sample hyperparameter configurations during the tuning process.
Specify the objective to optimize: Define the performance metric or objective function that will be utilized to evaluate and compare the various hyperparameter configurations.
Specify an early termination policy for low-performing jobs: Establish criteria that will automatically terminate underperforming jobs during the hyperparameter tuning process.
Define limits for the sweep job: Set the maximum number of iterations or allocate resources according to your requirements for the hyperparameter tuning experiment.
Launch an experiment with the defined configuration: Initiate the hyperparameter tuning experiment by utilizing the specified settings and parameters.
Visualize the training jobs: Monitor and analyze the progress and outcomes of the hyperparameter tuning experiment, including the performance of individual training jobs.
Select the best configuration for your model: Upon completion of the hyperparameter tuning experiment, identify the hyperparameter configuration that yielded the most favorable performance, and incorporate it into your machine learning model.
Principal author:
Shep Sheppard | Senior Customer Engineer, FastTrack for ISV and Startups
Other contributors:
Yoav Dobrin Principal Customer Engineer, FastTrack for ISV and Startups
Jones Jebaraj | Senior Customer Engineer, FastTrack for ISV and Startups
Olga Molocenco-Ciureanu | Customer Engineer, FastTrack for ISV and Startups
Microsoft Tech Community – Latest Blogs –Read More
sick to death of new outlook replacing standard mail app
Every week the new outlook auto switchs over from the standard mail box .
I click the slider button to disapble the new outlook again and it asks my why i want dont want the new outlook mail box ,i skip this as i have filled it in so many times GRrrrr .
I dont like the new outlook ,its to busy and has to many options that i just dont want or need .
I like the simple mail box that came with windows 11 just fine .
Every week without fail it it upgraded its selt to the new outlook.
Im sick of this crap , stop puching your crap software at me ,i dont want it , i wish i had kept my macbook!
Every week the new outlook auto switchs over from the standard mail box .I click the slider button to disapble the new outlook again and it asks my why i want dont want the new outlook mail box ,i skip this as i have filled it in so many times GRrrrr . I dont like the new outlook ,its to busy and has to many options that i just dont want or need .I like the simple mail box that came with windows 11 just fine .Every week without fail it it upgraded its selt to the new outlook. Im sick of this crap , stop puching your crap software at me ,i dont want it , i wish i had kept my macbook! Read More
AWS S3 to SQL Server
I have a file on Amazon S3 that updates daily, and it’s in SQL format. With these options, can I select a specific database to create and insert all the data into it in SQL Server?
Essentially, I’m asking if I can transfer data from Amazon S3 to SQL Server and, once imported, run SQL queries directly on the SQL Server?
I have a file on Amazon S3 that updates daily, and it’s in SQL format. With these options, can I select a specific database to create and insert all the data into it in SQL Server?Essentially, I’m asking if I can transfer data from Amazon S3 to SQL Server and, once imported, run SQL queries directly on the SQL Server? Read More
New Teams App Browser version – Channel Tab – entire Website link converted to lower case
New Teams App Browser Version:
Classic Teams App – Web Version or Teams Desktop/Native:
I have recently encountered an issue with the Teams website link feature in the NEW Teams app in Browser Version. When opening the website link using “open in browser”, it converts the entire URL to lowercase and causing the website link to fail rendering.However, the same tab link functions correctly when opened from the “Classic Teams app -web version” or “Teams desktop/native”. Example: New Teams App Browser Version:Sample website link opens in a new tab when clicked on “Open in browser”:http://localhost:7101/report.jsp?pp=%252f%2540report%252fusers%252fadmin%252ffifa18_v1 Classic Teams App – Web Version or Teams Desktop/Native:Sample website link opens in a new tab when clicked on “Open in browser”:http://localhost:7101/Report.jsp?pp=%252F%2540Report%252FUsers%252FAdmin%252FFIFA18_V1 Read More