Category: News
How to remove highlight on previously selected feature in geojson data on Azure Map polygon layer
I’ve been trying to fix the following code so that when a user clicks on a feature in the geojson data, the selected polygon is highlighted. And when user clicks on another polygon, the previously selected polygon/feature is no longer highlighted and the currently selected polygon is highlighted. Can anybody see what I’m doing wrong?
map.events.add(‘ready’, function () {
//Change the cursor of the mouse when it is over the map to be a pointer.
map.getCanvasContainer().style.cursor = ‘pointer’;
//Create a data source and add it to the map.
ds = new atlas.source.DataSource();
//Load jsonData file
fetch(jsonData)
.then(response => response.json())
.then(results => {
if (results.features[1].properties.CNTY == county_name) {
ds.add(results.features);
}
})//end then
.catch(error => console.error(‘Error loading GeoJSON:’, error));
//Add jsonData to sources
map.sources.add(ds);
//Add a layer for rendering a different color polygon when clicked
var polygonLayer = new atlas.layer.PolygonLayer(ds, null, {
fillColor: “rgba(176,48,96, 0.5)” //maroon
})
map.layers.add(polygonLayer, ‘labels’);
var selectedLine = new atlas.layer.LineLayer(ds, null, {
strokeColor: ‘black’,
strokeWidth: 1
});
map.layers.add(selectedLine, ‘labels’);
//Add click events to polygonLayer
map.events.add(‘click’, polygonLayer, function (e) {
selected = e.shapes[0];
//Add a layer for rendering a different color polygon when clicked
var polygonClickedLayer = new atlas.layer.PolygonLayer(ds, null, {
fillColor: ‘rgb(102, 255, 0)’, //green
//Only polygons with a “FUID” property with a value of selectedID will be rendered.
filter: [‘==’, [‘get’, ‘FUID’], selected.properties.FUID]
})
map.layers.add(polygonClickedLayer, ‘labels’);
//Add a layer for rendering a different polygon border color when clicked
var selectedLineLayer = new atlas.layer.LineLayer(ds, null, {
strokeColor: ‘orange’,
strokeWidth: 2,
//Only polygons with a “FUID” property with a value of selectedID will be rendered.
filter: [‘==’, [‘get’, ‘FUID’], selected.properties.FUID]
});
map.layers.add(selectedLineLayer, ‘labels’);
ftrCentroid = calculateFieldCentroid(selected);
map.setCamera({
zoom: 15,
center: ftrCentroid
});
});
});
I’ve been trying to fix the following code so that when a user clicks on a feature in the geojson data, the selected polygon is highlighted. And when user clicks on another polygon, the previously selected polygon/feature is no longer highlighted and the currently selected polygon is highlighted. Can anybody see what I’m doing wrong?map.events.add(‘ready’, function () {
//Change the cursor of the mouse when it is over the map to be a pointer.
map.getCanvasContainer().style.cursor = ‘pointer’;
//Create a data source and add it to the map.
ds = new atlas.source.DataSource();
//Load jsonData file
fetch(jsonData)
.then(response => response.json())
.then(results => {
if (results.features[1].properties.CNTY == county_name) {
ds.add(results.features);
}
})//end then
.catch(error => console.error(‘Error loading GeoJSON:’, error));
//Add jsonData to sources
map.sources.add(ds);
//Add a layer for rendering a different color polygon when clicked
var polygonLayer = new atlas.layer.PolygonLayer(ds, null, {
fillColor: “rgba(176,48,96, 0.5)” //maroon
})
map.layers.add(polygonLayer, ‘labels’);
var selectedLine = new atlas.layer.LineLayer(ds, null, {
strokeColor: ‘black’,
strokeWidth: 1
});
map.layers.add(selectedLine, ‘labels’);
//Add click events to polygonLayer
map.events.add(‘click’, polygonLayer, function (e) {
selected = e.shapes[0];
//Add a layer for rendering a different color polygon when clicked
var polygonClickedLayer = new atlas.layer.PolygonLayer(ds, null, {
fillColor: ‘rgb(102, 255, 0)’, //green
//Only polygons with a “FUID” property with a value of selectedID will be rendered.
filter: [‘==’, [‘get’, ‘FUID’], selected.properties.FUID]
})
map.layers.add(polygonClickedLayer, ‘labels’);
//Add a layer for rendering a different polygon border color when clicked
var selectedLineLayer = new atlas.layer.LineLayer(ds, null, {
strokeColor: ‘orange’,
strokeWidth: 2,
//Only polygons with a “FUID” property with a value of selectedID will be rendered.
filter: [‘==’, [‘get’, ‘FUID’], selected.properties.FUID]
});
map.layers.add(selectedLineLayer, ‘labels’);
ftrCentroid = calculateFieldCentroid(selected);
map.setCamera({
zoom: 15,
center: ftrCentroid
});
});
}); Read More
Azure Advisor with Troubleshooting Guides to improve your Azure Postgres Flexible Server performance
Azure Advisor provides a personalized approach to receiving recommendations for your server by analyzing its configuration and telemetry data. This service aims to enhance various aspects of your server, including reliability, cost efficiency, security, operational excellence, and performance. By leveraging Azure Advisor, you gain access to tailored, proactive, and actionable recommendations designed to help your server operate at its optimal level.
You can now receive new recommendations that include checks for long-running queries, orphaned prepared transactions, databases approaching the 1 billion transaction usage limit (to prevent potential transaction wraparound scenarios), and servers exceeding the 80% bloat ratio. These new recommendations are seamlessly integrated with the troubleshooting guides available on the Azure Portal: Troubleshooting guides – Azure Database for PostgreSQL – Flexible Server | Microsoft Learn.
You can use these troubleshooting guides to help implement the Azure Advisor Performance recommendations for your Azure Database for Postgres Flexible Server. When you receive a recommendation, you will be directed to the appropriate troubleshooting guides. Be sure to follow the prerequisites section to ensure that all necessary data is provided before proceeding with the troubleshooting steps.
Let us walk through an example of a long-running transaction recommendation and see how the integration of troubleshooting guides can assist you in resolving the issue:
1. For the recommendation on Long Running Transactions, Go to Help -> Troubleshooting guides -> High CPU Usage -> Long Running Transactions as shown in the visual. This visual highlights the troubleshooting guides available on the portal, illustrating the various scenarios they can help you identify and resolve any server issues.
2. This will provide you with PIDs for the long running transactions on the server.
3. There is a dropdown to pick a specific PID which shows you the details of the PID as below. You can go through each PID and understand what is causing the issue.
4. We also provide you with recommendations on what steps need to be taken to resolve the issue.
5. You may have to follow additional steps for all the PIDs identified as long running and resolve them based on the recommendation provided.
In conclusion, leveraging Azure Advisor and the integrated troubleshooting guides can significantly enhance the performance, reliability, and efficiency of your Azure Database for Postgres Flexible Server. By proactively addressing recommendations such as long-running queries, orphaned prepared transactions, transaction limits, and bloat ratios, you can ensure your server operates at its best.
We encourage you to explore the Azure Portal and utilize these tools to stay ahead of potential issues. Start implementing the Azure Advisor performance recommendations today and make use of the detailed troubleshooting guides to maintain a robust and high-performing database environment.
Acknowledgement: This post was co-authored by Guy Bowerman and Gayathri Paderla.
Microsoft Tech Community – Latest Blogs –Read More
How to clear the workspace from within a program?
I have a program that must have the workspace clear when it runs or it returns invalid results. I don’t want the user to need to remember to type CLEAR ALL before running. How can I get the same effect from within a program (at the start)?I have a program that must have the workspace clear when it runs or it returns invalid results. I don’t want the user to need to remember to type CLEAR ALL before running. How can I get the same effect from within a program (at the start)? I have a program that must have the workspace clear when it runs or it returns invalid results. I don’t want the user to need to remember to type CLEAR ALL before running. How can I get the same effect from within a program (at the start)? clear all, inprogram clear, workspace clear MATLAB Answers — New Questions
How to Reduce Oscillations (not noise) in a Signal?
How can oscillations be reduced in signals similar to the one shown in Figure 1 to achieve results like those in Figure 2? Please note that it is not a denoising or smoothing problem.How can oscillations be reduced in signals similar to the one shown in Figure 1 to achieve results like those in Figure 2? Please note that it is not a denoising or smoothing problem. How can oscillations be reduced in signals similar to the one shown in Figure 1 to achieve results like those in Figure 2? Please note that it is not a denoising or smoothing problem. signal processing, oscillation MATLAB Answers — New Questions
Simulink model taking longer to open starting in MATLAB R2018b
Starting in R2018b, my Simulink model is taking a significantly longer time to open. Why?
My model uses custom code that I specified in the Configuration Parameters > Simulation Target > Custom Code > Source Files and Libraries panes.Starting in R2018b, my Simulink model is taking a significantly longer time to open. Why?
My model uses custom code that I specified in the Configuration Parameters > Simulation Target > Custom Code > Source Files and Libraries panes. Starting in R2018b, my Simulink model is taking a significantly longer time to open. Why?
My model uses custom code that I specified in the Configuration Parameters > Simulation Target > Custom Code > Source Files and Libraries panes. custom, open, open_system, getfrontendoptions, simparsecustomcode MATLAB Answers — New Questions
Does Matlab automatically vectorize for loops?
I currently have Python code that takes 1.5 hours to calculate 450+ million Levenshtein distances between 30,011 text labels of no more than 20 characters each. Currently migrating it to Matlab to see the JiT compilation allows optimizations of flow control. The Python implementation uses Anaconda’s CPython, so no JiT, and there is a distinct possibility that Matlab could be much faster.
Years ago, I recall reading that Matlab automatically vectorizes for loops. I cannot find any such mentions now. Is this just assumed to be part of the JiT compilation?
There will be 2 levels of for-loops, one nested within the other, to iterate over matrix rows and columns. Each iteration will call editDistance, so I don’t know if that will prevent vectorization, even if automated vectorization was available.I currently have Python code that takes 1.5 hours to calculate 450+ million Levenshtein distances between 30,011 text labels of no more than 20 characters each. Currently migrating it to Matlab to see the JiT compilation allows optimizations of flow control. The Python implementation uses Anaconda’s CPython, so no JiT, and there is a distinct possibility that Matlab could be much faster.
Years ago, I recall reading that Matlab automatically vectorizes for loops. I cannot find any such mentions now. Is this just assumed to be part of the JiT compilation?
There will be 2 levels of for-loops, one nested within the other, to iterate over matrix rows and columns. Each iteration will call editDistance, so I don’t know if that will prevent vectorization, even if automated vectorization was available. I currently have Python code that takes 1.5 hours to calculate 450+ million Levenshtein distances between 30,011 text labels of no more than 20 characters each. Currently migrating it to Matlab to see the JiT compilation allows optimizations of flow control. The Python implementation uses Anaconda’s CPython, so no JiT, and there is a distinct possibility that Matlab could be much faster.
Years ago, I recall reading that Matlab automatically vectorizes for loops. I cannot find any such mentions now. Is this just assumed to be part of the JiT compilation?
There will be 2 levels of for-loops, one nested within the other, to iterate over matrix rows and columns. Each iteration will call editDistance, so I don’t know if that will prevent vectorization, even if automated vectorization was available. vectorization, jit MATLAB Answers — New Questions
Bluetooth Drivers on AVD Hostpool
Dear AVD Program team,
Does AVD hostpool based on pre-built images support Bluetooth drivers pre-installed and configured?Does AVD hostpool based on custom images allow and support Bluetooth drivers pre-installation?Does local bluetooth resources from AVD Windows client can be redirected via hostpool RDP properties or any other approaches?
If above options are not available, is there any roadmap to enable this feature on Bluetooth drivers on AVD hostppol, and by what timelines?
Dear AVD Program team,Does AVD hostpool based on pre-built images support Bluetooth drivers pre-installed and configured?Does AVD hostpool based on custom images allow and support Bluetooth drivers pre-installation?Does local bluetooth resources from AVD Windows client can be redirected via hostpool RDP properties or any other approaches?If above options are not available, is there any roadmap to enable this feature on Bluetooth drivers on AVD hostppol, and by what timelines? Read More
Problème de copilote dans PowerPoint Macbook
Bonjour,
J’ai acheté une licence Copilote en fin de semaine. Ça fonctionne très bien dans Word et Excel, par contre quand je l’active sur PowerPoint, il démarre puis tout disparait et il n’y a plus rien dans l’espace Copilot.
Je suis sur un Macbook Pro, toutes mes applications sont à jour.
Est-ce normale ? Suis-je le seul ? Que puis-je faire ?
Merci,
Bonjour, J’ai acheté une licence Copilote en fin de semaine. Ça fonctionne très bien dans Word et Excel, par contre quand je l’active sur PowerPoint, il démarre puis tout disparait et il n’y a plus rien dans l’espace Copilot. Je suis sur un Macbook Pro, toutes mes applications sont à jour. Est-ce normale ? Suis-je le seul ? Que puis-je faire ? Merci, Read More
Android MAM App configuration blocks MDM app settings
Hi everyone,
I am running into a problem with Android Outlook app configuration.
I set an app config profile for Outlook to block contact sync for managed apps and a BYOD MAM scenario. The profile can’t be set for specific device types. I just want to apply on unmanaged devices.
The Problem is, users with a managed device who also want to use managed apps on their personal device get the same Outlook config profile on both devices, what results in managed devices unable to sync contacts to the native contact app.
Apart from using only one device type, do you have any ideas how to solve this issue?
Thanks, Simon
Hi everyone, I am running into a problem with Android Outlook app configuration. I set an app config profile for Outlook to block contact sync for managed apps and a BYOD MAM scenario. The profile can’t be set for specific device types. I just want to apply on unmanaged devices. The Problem is, users with a managed device who also want to use managed apps on their personal device get the same Outlook config profile on both devices, what results in managed devices unable to sync contacts to the native contact app. Apart from using only one device type, do you have any ideas how to solve this issue? Thanks, Simon Read More
Windows service on local server needs to consume files from SharePoint folder
I have a Windows Service that needs to consume files from a cloud based SharePoint folder.
I’ve found lots of info on mapping drives or using sync to make it available in OneDrive but as best I can tell that would only work in the context of a user session.
Is there a way to map a SP folder to a drive in a way that it would be available to that service?
Should I use Power Automate to copy files down instead?
Using PA I would want to pull it down using PA running on the server to minimize firewall config
Thanks in advance!
I have a Windows Service that needs to consume files from a cloud based SharePoint folder.I’ve found lots of info on mapping drives or using sync to make it available in OneDrive but as best I can tell that would only work in the context of a user session.Is there a way to map a SP folder to a drive in a way that it would be available to that service?Should I use Power Automate to copy files down instead?Using PA I would want to pull it down using PA running on the server to minimize firewall config Thanks in advance! Read More
Calculating Daily Hours entered in Sprint
Hello,
We are assigned 3 weeks Sprints, with in those sprints we can have up to 20 stories. We log our time in 15 minutes under the Effort section of the Story. Is there a query or other mechanism which shows how much time you have logged for the day all stories combined? I need to log a minimum of 7 hours and would like to check total time documented throughout the day.
Thanks so much!
Jeffrey
Hello,We are assigned 3 weeks Sprints, with in those sprints we can have up to 20 stories. We log our time in 15 minutes under the Effort section of the Story. Is there a query or other mechanism which shows how much time you have logged for the day all stories combined? I need to log a minimum of 7 hours and would like to check total time documented throughout the day.Thanks so much!Jeffrey Read More
Navigating the Generative AI Landscape with Azure AI Services: Insights from Customer Round Table
Introduction
The adoption of Generative AI (GenAI) technologies is accelerating, driven by the transformative potential they offer across various sectors. Recently, we hosted a customer round table conference at Microsoft Build, focusing on the journeys and adoption of GenAI using Azure AI services. Industry leaders from diverse fields shared their experiences, challenges, and strategies, providing invaluable insights into the practical application of Generative AI.
Azure AI Services: A Pillar in Generative AI Use Cases
Azure AI services play a crucial role in enabling businesses to leverage Generative AI effectively. These services provide the necessary infrastructure and tools to build, deploy, and scale AI applications. With services and features like the Azure OpenAI, Assistants API and Co-pilot Studio, Azure AI empowers organizations to create interactive and responsive AI solutions tailored to their specific needs. Security and privacy are also integral components of Azure AI, ensuring that AI deployments are robust and compliant with industry standards. Below are some of the insights from customers across different industries.
Scaling and Maturing in Generative AI: Insights from Consulting
A consulting firm highlighted their success in building the AI applications and the pivotal role of upskilling and developing repeatable blueprints. These strategies not only accelerated their learning curve but also supported their advancement to a mature stage in their Large Language Models (LLMs) adoption. The firm now successfully scales their Generative AI applications to more than 150,000 users, showcasing the robust capability of Azure AI to handle large-scale user bases efficiently.
Challenges in Keeping Pace: An IT Company’s Story
An IT company discussed the challenges of keeping up with rapid advancements in Generative AI technology. They are currently enabling Generative AI co-pilots for developers but find it difficult to optimize these tools within their organizational framework. This reflects a common challenge across the industry: integrating cutting-edge technology in a way that complements existing workflows and systems. Azure AI and Azure Machine Learning offer pre-built models and services that can be easily integrated into existing applications. These services provide APIs and connectors that simplify the incorporation of AI and ML into current workflows.
Story Integrating Generative AI capabilities into traditional Software Development
Multiple customers expressed interest in understanding how Generative AI capabilities can be integrated into traditional software development life cycles and programming languages. There is a keen interest in exploring potential use cases that could revolutionize operations and customer service across the industries.
Operational Efficiency and DevOps: Device Manufacturer’s Experience
A device manufacturer shared their journey of embedding LLM applications within their DevOps workflows. They discussed the nuances of LLMOps and how it differs from traditional operations, highlighting the operational efficiencies gained through Generative AI integration.
Hospitality Industry Exploration
A hospitality company was eager to learn and explore embedding Generative AI into their business operations to enhance customer experience and streamline service delivery. This reflects a broader trend of industries seeking to leverage AI to add value to their customer interactions and internal processes.
Health Insurance Innovations
A health insurance provider discussed automating claims and Electronic Medical Records (EMR), which could significantly reduce processing times and errors. At Microsoft, we are dedicated to helping customers and partners leverage AI in healthcare by bridging data, AI, and trust. Our goal is to accelerate digital transformation through trusted, secure, and scalable platforms and tools that enable data management, analysis, sharing, and the development, deployment, and monitoring of AI solutions.
Multi-Agent Scenarios in Manufacturing and Office Supplies
AutoGen is a framework for simplifying the orchestration, optimization, and automation of LLM workflows. It offers customizable and conversable agents that leverage the strongest capabilities of the most advanced LLMs, like GPT-4, while addressing their limitations by integrating with humans and tools and having conversations between multiple agents via automated chat. Manufacturing and office supplies customers explored multi-agent scenarios using the framework, potentially enhancing customer interaction and operational automation.
AI COE in Oil and Gas
The AI Center of Excellence (COE) team from an Oil and Gas company has been instrumental in showcasing the transformative power of AI. They have shared valuable insights into their long-standing AI journey, emphasizing a well-established execution rhythm that has become a cornerstone of their operations. This rhythm allows for the continuous improvement and integration of AI technologies, ensuring they remain at the forefront of innovation.
Conclusion
The round table provided a panoramic view of how various industries are navigating their Generative AI adoption journeys. From operational integration to scaling user bases and addressing security concerns, the insights shared underscore the dynamic nature of AI technology and its impact across sectors.
Nick Brady, a seasoned program manager from the Azure OpenAI team, shared his expertise with customers on building AI products designed to accelerate AI development. He detailed the strategic approach and best practices employed by his team, focusing on creating scalable, secure, and user-friendly AI solutions. Kranthi Manchikanti and Marc Nehme from Azure specialized AI Tech strategy team also provided valuable guidance on overcoming common challenges and maximizing the potential of AI technologies in various industries. As Azure continues to evolve its AI services, these dialogues are invaluable for shaping a more informed, efficient, and innovative adoption path for businesses worldwide.
This conference has set the stage for ongoing collaboration and innovation in the Generative AI space, promising exciting developments ahead for Azure AI users and the broader tech community.
Microsoft Tech Community – Latest Blogs –Read More
Error calling … This call-site expects more outputs than this function can supply. P-code function ‘checkNonlinearInputs.p’ produced an error.
Good evening,
I am currently working on a parallelipiped driving simulator with 3-DoF (heave, roll and pitch) that has 4 actuators on the corners, so I cannot use inverse kinematic to obtain the length of the four actuators (z1 is the rear right actuator, z2 front right and so on anti clockwise). So I decided to use Maple to write the kinematic solution (the varibles with subscript g) and the constraints, and to use a constrained minimization to find the length of actuators. However, if I use a single target to try the optimization(theta_t, phi_t, z_t), Simulink does not signal any error while using a trajectory of more points, Simulink gives me the following error "Error calling ‘Opt/mycon’. This call-site expects more outputs than this function can supply. P-code function ‘checkNonlinearInputs.p’ produced an error.". I leave the code of the MATLAB function block below, which receives as input the two angles and the heave and has as output the four actuators length. How can I solve this problem to obtain a workink real-time optimization? Thanks in advance.
function [z1, z2, z3, z4] = Opt(theta_t, phi_t, z_t)
l = 0.82;
L = 1.6;
% theta_t = 1.5*pi/180;
% phi_t = 1.5*pi/180;
% z_t = 0.05;
%theta_g = atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
%phi_g = -atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l));
% x_g = ((-2*z(3) + 2*z(4))*z(1) + L^2)/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
% y_g = ((-z(3)^2 + (-2*z(1) + z(2) + z(4))*z(3) + l^2 + 2*z(1)*z(2) – z(2)*z(4))*L^2 + l^2*(z(3) – z(4))^2)/(2*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l);
% z_g = L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
fun = @(z)120*(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – theta_t)^2 + 40*(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)) – phi_t)^2 …
+ 1*(L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) +1*(l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))) – z_t)^2;
lb = [0, 0, 0, 0];
ub = [0.1, 0.1, 0.1, 0.1];
if theta_t < 0.4*pi/180
options = optimoptions(‘fmincon’,’Display’,’iter’,’Algorithm’,’sqp’, ‘ConstraintTolerance’, 1e-17, ‘StepTolerance’, 1e-10);
else
options = optimoptions(‘fmincon’,’Display’,’iter’,’Algorithm’,’sqp’, ‘ConstraintTolerance’, 1e-18, ‘StepTolerance’, 1e-10);
end
function [c,ceq] = mycon(z)
l = 0.82;
L = 1.6;
c = [atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – 3.5*pi/180;
-atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – 3.5*pi/180;
-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)) – 2.5*pi/180;
-(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) – 2.5*pi/180];
ceq = [-sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) – 0.8000000000*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + ((-2*z(3) + 2*z(4))*z(1) + L^2)/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(2) – 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(3) – 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(4) + 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) – 0.8000000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + ((-z(3)^2 + (-2*z(1) + z(2) + z(4))*z(3) + l^2 + 2*z(1)*z(2) – z(2)*z(4))*L^2 + l^2*(z(3) – z(4))^2)/(2*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l);
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) + 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
];
end
Z = fmincon(fun, [0.05, 0.05, 0.05, 0.05], [], [], [], [], lb, ub , @mycon, options);
z1 = Z(1);
z2 = Z(2);
z3 = Z(3);
z4 = Z(4);
endGood evening,
I am currently working on a parallelipiped driving simulator with 3-DoF (heave, roll and pitch) that has 4 actuators on the corners, so I cannot use inverse kinematic to obtain the length of the four actuators (z1 is the rear right actuator, z2 front right and so on anti clockwise). So I decided to use Maple to write the kinematic solution (the varibles with subscript g) and the constraints, and to use a constrained minimization to find the length of actuators. However, if I use a single target to try the optimization(theta_t, phi_t, z_t), Simulink does not signal any error while using a trajectory of more points, Simulink gives me the following error "Error calling ‘Opt/mycon’. This call-site expects more outputs than this function can supply. P-code function ‘checkNonlinearInputs.p’ produced an error.". I leave the code of the MATLAB function block below, which receives as input the two angles and the heave and has as output the four actuators length. How can I solve this problem to obtain a workink real-time optimization? Thanks in advance.
function [z1, z2, z3, z4] = Opt(theta_t, phi_t, z_t)
l = 0.82;
L = 1.6;
% theta_t = 1.5*pi/180;
% phi_t = 1.5*pi/180;
% z_t = 0.05;
%theta_g = atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
%phi_g = -atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l));
% x_g = ((-2*z(3) + 2*z(4))*z(1) + L^2)/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
% y_g = ((-z(3)^2 + (-2*z(1) + z(2) + z(4))*z(3) + l^2 + 2*z(1)*z(2) – z(2)*z(4))*L^2 + l^2*(z(3) – z(4))^2)/(2*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l);
% z_g = L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
fun = @(z)120*(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – theta_t)^2 + 40*(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)) – phi_t)^2 …
+ 1*(L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) +1*(l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))) – z_t)^2;
lb = [0, 0, 0, 0];
ub = [0.1, 0.1, 0.1, 0.1];
if theta_t < 0.4*pi/180
options = optimoptions(‘fmincon’,’Display’,’iter’,’Algorithm’,’sqp’, ‘ConstraintTolerance’, 1e-17, ‘StepTolerance’, 1e-10);
else
options = optimoptions(‘fmincon’,’Display’,’iter’,’Algorithm’,’sqp’, ‘ConstraintTolerance’, 1e-18, ‘StepTolerance’, 1e-10);
end
function [c,ceq] = mycon(z)
l = 0.82;
L = 1.6;
c = [atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – 3.5*pi/180;
-atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – 3.5*pi/180;
-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)) – 2.5*pi/180;
-(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) – 2.5*pi/180];
ceq = [-sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) – 0.8000000000*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + ((-2*z(3) + 2*z(4))*z(1) + L^2)/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(2) – 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(3) – 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(4) + 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) – 0.8000000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + ((-z(3)^2 + (-2*z(1) + z(2) + z(4))*z(3) + l^2 + 2*z(1)*z(2) – z(2)*z(4))*L^2 + l^2*(z(3) – z(4))^2)/(2*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l);
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) + 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
];
end
Z = fmincon(fun, [0.05, 0.05, 0.05, 0.05], [], [], [], [], lb, ub , @mycon, options);
z1 = Z(1);
z2 = Z(2);
z3 = Z(3);
z4 = Z(4);
end Good evening,
I am currently working on a parallelipiped driving simulator with 3-DoF (heave, roll and pitch) that has 4 actuators on the corners, so I cannot use inverse kinematic to obtain the length of the four actuators (z1 is the rear right actuator, z2 front right and so on anti clockwise). So I decided to use Maple to write the kinematic solution (the varibles with subscript g) and the constraints, and to use a constrained minimization to find the length of actuators. However, if I use a single target to try the optimization(theta_t, phi_t, z_t), Simulink does not signal any error while using a trajectory of more points, Simulink gives me the following error "Error calling ‘Opt/mycon’. This call-site expects more outputs than this function can supply. P-code function ‘checkNonlinearInputs.p’ produced an error.". I leave the code of the MATLAB function block below, which receives as input the two angles and the heave and has as output the four actuators length. How can I solve this problem to obtain a workink real-time optimization? Thanks in advance.
function [z1, z2, z3, z4] = Opt(theta_t, phi_t, z_t)
l = 0.82;
L = 1.6;
% theta_t = 1.5*pi/180;
% phi_t = 1.5*pi/180;
% z_t = 0.05;
%theta_g = atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
%phi_g = -atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l));
% x_g = ((-2*z(3) + 2*z(4))*z(1) + L^2)/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
% y_g = ((-z(3)^2 + (-2*z(1) + z(2) + z(4))*z(3) + l^2 + 2*z(1)*z(2) – z(2)*z(4))*L^2 + l^2*(z(3) – z(4))^2)/(2*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l);
% z_g = L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
fun = @(z)120*(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – theta_t)^2 + 40*(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)) – phi_t)^2 …
+ 1*(L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) +1*(l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))) – z_t)^2;
lb = [0, 0, 0, 0];
ub = [0.1, 0.1, 0.1, 0.1];
if theta_t < 0.4*pi/180
options = optimoptions(‘fmincon’,’Display’,’iter’,’Algorithm’,’sqp’, ‘ConstraintTolerance’, 1e-17, ‘StepTolerance’, 1e-10);
else
options = optimoptions(‘fmincon’,’Display’,’iter’,’Algorithm’,’sqp’, ‘ConstraintTolerance’, 1e-18, ‘StepTolerance’, 1e-10);
end
function [c,ceq] = mycon(z)
l = 0.82;
L = 1.6;
c = [atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – 3.5*pi/180;
-atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)) – 3.5*pi/180;
-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)) – 2.5*pi/180;
-(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) – 2.5*pi/180];
ceq = [-sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) – 0.8000000000*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + ((-2*z(3) + 2*z(4))*z(1) + L^2)/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(2) – 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(3) – 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(4) + 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) + 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) – 0.8000000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + ((-z(3)^2 + (-2*z(1) + z(2) + z(4))*z(3) + l^2 + 2*z(1)*z(2) – z(2)*z(4))*L^2 + l^2*(z(3) – z(4))^2)/(2*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l);
-cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*cos(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)))*z(1) + 0.8000000000*cos(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l)))*sin(atan(-(z(3) – z(4))/sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))) – 0.4100000000*sin(-atan(L*(z(2) – z(3))/(sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*l))) + L*(z(2) + z(4))/(2*sqrt(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2)*sqrt(((L^2 + l^2)*z(3)^2 + (-2*L^2*z(2) – 2*l^2*z(4))*z(3) + (l^2 + z(2)^2)*L^2 + l^2*z(4)^2)/(l^2*(L^2 + z(3)^2 – 2*z(3)*z(4) + z(4)^2))));
];
end
Z = fmincon(fun, [0.05, 0.05, 0.05, 0.05], [], [], [], [], lb, ub , @mycon, options);
z1 = Z(1);
z2 = Z(2);
z3 = Z(3);
z4 = Z(4);
end real time optimization MATLAB Answers — New Questions
Arduino Uno /Simulink: Sample Time not updating with different values
Figure 1: Simulink Model Figure 2: Sample Time @ 0.01
I am using Simulink (R2024a). I am using a pendulum to try to purposely get a scope of aliasing with the signal coming from the Arduino Uno. When I input the SampleTime (0.01), the program outputs a sine wave as expected.
Figure 3: Sine Wave at Sample Time @ 0.01 & Stop Time @10.0
When I change the Stop Time to 30.0 sec and ensure the Simulation pacing is 1:1, it outputs a sine wave and runs the whole simulation.
Figure 4: Sine Wave Sample Time @ 0.01 & StopTime @ 30.0
However, when I change the Sample time to any other value, the program doesn’t work as intended. The simulation is done in 1 sec even though the Simulation Pacing is a 1:1 ratio. It does get some aliasing, but it looks very incomplete.
Figure 5: Incomplete Aliasing with Sample Time @ 1.0 & Stop Time @ 30.0
The end result is supposed to look like this.
Figure 6: Goal of Aliasing graph on older MATLAB release
The diagnostic viewer reports no errors.
I have alternated with using different hardware (arduino board vs computer) and they both do not run correctly. I have experimented with different Sample Times, Stop Times, and 3D Array/Timespace/2DArrays (To Workspace) with no change or success.
I am thinking it has something to do with the updated version vs the older version that this experiment was based on.Figure 1: Simulink Model Figure 2: Sample Time @ 0.01
I am using Simulink (R2024a). I am using a pendulum to try to purposely get a scope of aliasing with the signal coming from the Arduino Uno. When I input the SampleTime (0.01), the program outputs a sine wave as expected.
Figure 3: Sine Wave at Sample Time @ 0.01 & Stop Time @10.0
When I change the Stop Time to 30.0 sec and ensure the Simulation pacing is 1:1, it outputs a sine wave and runs the whole simulation.
Figure 4: Sine Wave Sample Time @ 0.01 & StopTime @ 30.0
However, when I change the Sample time to any other value, the program doesn’t work as intended. The simulation is done in 1 sec even though the Simulation Pacing is a 1:1 ratio. It does get some aliasing, but it looks very incomplete.
Figure 5: Incomplete Aliasing with Sample Time @ 1.0 & Stop Time @ 30.0
The end result is supposed to look like this.
Figure 6: Goal of Aliasing graph on older MATLAB release
The diagnostic viewer reports no errors.
I have alternated with using different hardware (arduino board vs computer) and they both do not run correctly. I have experimented with different Sample Times, Stop Times, and 3D Array/Timespace/2DArrays (To Workspace) with no change or success.
I am thinking it has something to do with the updated version vs the older version that this experiment was based on. Figure 1: Simulink Model Figure 2: Sample Time @ 0.01
I am using Simulink (R2024a). I am using a pendulum to try to purposely get a scope of aliasing with the signal coming from the Arduino Uno. When I input the SampleTime (0.01), the program outputs a sine wave as expected.
Figure 3: Sine Wave at Sample Time @ 0.01 & Stop Time @10.0
When I change the Stop Time to 30.0 sec and ensure the Simulation pacing is 1:1, it outputs a sine wave and runs the whole simulation.
Figure 4: Sine Wave Sample Time @ 0.01 & StopTime @ 30.0
However, when I change the Sample time to any other value, the program doesn’t work as intended. The simulation is done in 1 sec even though the Simulation Pacing is a 1:1 ratio. It does get some aliasing, but it looks very incomplete.
Figure 5: Incomplete Aliasing with Sample Time @ 1.0 & Stop Time @ 30.0
The end result is supposed to look like this.
Figure 6: Goal of Aliasing graph on older MATLAB release
The diagnostic viewer reports no errors.
I have alternated with using different hardware (arduino board vs computer) and they both do not run correctly. I have experimented with different Sample Times, Stop Times, and 3D Array/Timespace/2DArrays (To Workspace) with no change or success.
I am thinking it has something to do with the updated version vs the older version that this experiment was based on. matlab, simulink, arduino MATLAB Answers — New Questions
not enough input arguments when using function functions.
Hi, when I call heun(u0,n,dt,f), the error is:
Not enough input arguments.
Error in f (line 7)
mat = zeros(n);
Any ideas why? It’s like the f function hasn’t even read the parameters I put into it.
Thanks.Hi, when I call heun(u0,n,dt,f), the error is:
Not enough input arguments.
Error in f (line 7)
mat = zeros(n);
Any ideas why? It’s like the f function hasn’t even read the parameters I put into it.
Thanks. Hi, when I call heun(u0,n,dt,f), the error is:
Not enough input arguments.
Error in f (line 7)
mat = zeros(n);
Any ideas why? It’s like the f function hasn’t even read the parameters I put into it.
Thanks. function functions, matlab MATLAB Answers — New Questions
Why does my third-party scheduler .conf not appear when attempting to Discover Clusters?
Why does my third-party scheduler .conf not appear when attempting to Discover Clusters?Why does my third-party scheduler .conf not appear when attempting to Discover Clusters? Why does my third-party scheduler .conf not appear when attempting to Discover Clusters? MATLAB Answers — New Questions
combine information from 2 tabs in 1 file based on common information (EAN)
I could not download the info needed in 1 file so I have downloaded 2 files.
i combined the 2 in 1 file 2 tabs.
1 file has amongst other info: EAN and article name.
file 2 has among other, EAN and stock qtt
how can I now import the stock qtt from tab 2 in tab 1 based on the EAN
so: if EAN = 1234567891011 the stock should be …..
quess can be doe by formule
I could not download the info needed in 1 file so I have downloaded 2 files. i combined the 2 in 1 file 2 tabs.1 file has amongst other info: EAN and article name.file 2 has among other, EAN and stock qtthow can I now import the stock qtt from tab 2 in tab 1 based on the EANso: if EAN = 1234567891011 the stock should be …..quess can be doe by formule Read More
Managed Metadata in new MS List in SharePoint
Just noticed the new change to the SharePoint lists moving to MS List. Only some of my lists were updated and some were not so I attempted to recreate a simple list with 1 managed metadata column and a couple of people columns.
The first thing I noticed what that I couldn’t paste into the Managed Metadata column in grid edit mode. The hover over suggests that these fields can only be edited in the popup form.
Quite a limiting feature if you ask me.
Just noticed the new change to the SharePoint lists moving to MS List. Only some of my lists were updated and some were not so I attempted to recreate a simple list with 1 managed metadata column and a couple of people columns. The first thing I noticed what that I couldn’t paste into the Managed Metadata column in grid edit mode. The hover over suggests that these fields can only be edited in the popup form. Quite a limiting feature if you ask me. Read More
Il mio OneDrive è bloccato su iPhone e iPad.
Il mio OneDrive è bloccato su iPhone e su Ipad, non su computer. Microsoft non mi invia il codice necessario per resettare la password di accesso. Su OneDrive ho 244 giga di file
Il mio OneDrive è bloccato su iPhone e su Ipad, non su computer. Microsoft non mi invia il codice necessario per resettare la password di accesso. Su OneDrive ho 244 giga di file Read More
Value filters on multiple value columns in a Pivot Table
Greetings,
I know how to utilize the ‘Value Filters’ functionality in order to filter Pivot Table data. Is there a way to filter on the values in 2 separate columns? I need my Pivot table results to show rows that have a counts >1K AND an Index comparison value <1.00. Currently, I can only do one filter or the other, but not both – is there a way to do this?
Thank you!
Greetings, I know how to utilize the ‘Value Filters’ functionality in order to filter Pivot Table data. Is there a way to filter on the values in 2 separate columns? I need my Pivot table results to show rows that have a counts >1K AND an Index comparison value <1.00. Currently, I can only do one filter or the other, but not both – is there a way to do this? Thank you! Read More