Category: Matlab
Category Archives: Matlab
I want to install an MATLAB 2024 Update 6 but it is only showing Update 2 do I have to reinstall?
I have MATLAB 2024a installed (it has update 2) — it shows that no updates are available when I check for updates in the GUI. I just received an email from MATHWORKS that I bug I reported has been fixed in UPDATE 6. When I go to the licenses to install this update, it seems to be saying that I need to uninstall the previous version and start over. Is this really what I need to do? Seems unreasonable…..I have MATLAB 2024a installed (it has update 2) — it shows that no updates are available when I check for updates in the GUI. I just received an email from MATHWORKS that I bug I reported has been fixed in UPDATE 6. When I go to the licenses to install this update, it seems to be saying that I need to uninstall the previous version and start over. Is this really what I need to do? Seems unreasonable….. I have MATLAB 2024a installed (it has update 2) — it shows that no updates are available when I check for updates in the GUI. I just received an email from MATHWORKS that I bug I reported has been fixed in UPDATE 6. When I go to the licenses to install this update, it seems to be saying that I need to uninstall the previous version and start over. Is this really what I need to do? Seems unreasonable….. update installation MATLAB Answers — New Questions
paretosearch does not satisfy nonlinear constraints
I want to make V<=0.001 at a position where Wn=1, but the non-linear constraint cannot do it. I am sure there is this answer. The following is my program。
https://drive.mathworks.com/sharing/df23a873-b7f8-420c-b085-dedccef7860cI want to make V<=0.001 at a position where Wn=1, but the non-linear constraint cannot do it. I am sure there is this answer. The following is my program。
https://drive.mathworks.com/sharing/df23a873-b7f8-420c-b085-dedccef7860c I want to make V<=0.001 at a position where Wn=1, but the non-linear constraint cannot do it. I am sure there is this answer. The following is my program。
https://drive.mathworks.com/sharing/df23a873-b7f8-420c-b085-dedccef7860c multi-objective optimization MATLAB Answers — New Questions
What is the maximum size of *.mat file?
What is the maximum size of *.mat file?
What is the maximum size of HDF5 file?What is the maximum size of *.mat file?
What is the maximum size of HDF5 file? What is the maximum size of *.mat file?
What is the maximum size of HDF5 file? mat file MATLAB Answers — New Questions
Is this a bug of MATLAB?
% Here is my code
[vpa(str2sym(‘asin(1)*2’),100);vpa(str2sym(‘pi’),100)]
The output is:
3.1415926535897932384626433832795
3.1415926535897932384626433832795
I think the correct answer should be longer. Is it a bug or an expected behavior?% Here is my code
[vpa(str2sym(‘asin(1)*2’),100);vpa(str2sym(‘pi’),100)]
The output is:
3.1415926535897932384626433832795
3.1415926535897932384626433832795
I think the correct answer should be longer. Is it a bug or an expected behavior? % Here is my code
[vpa(str2sym(‘asin(1)*2’),100);vpa(str2sym(‘pi’),100)]
The output is:
3.1415926535897932384626433832795
3.1415926535897932384626433832795
I think the correct answer should be longer. Is it a bug or an expected behavior? symbolic, matlab, mathematics MATLAB Answers — New Questions
Working With Inverse of Polynomials
Hello, this is my first post in this form and I am new to MatLab. I would like to take the inverse of a polynomial in factored form and express the answer in polynomial form. For example, I wish to convert 10/((x+3)^2(x+5)) in regular polynomial form.Hello, this is my first post in this form and I am new to MatLab. I would like to take the inverse of a polynomial in factored form and express the answer in polynomial form. For example, I wish to convert 10/((x+3)^2(x+5)) in regular polynomial form. Hello, this is my first post in this form and I am new to MatLab. I would like to take the inverse of a polynomial in factored form and express the answer in polynomial form. For example, I wish to convert 10/((x+3)^2(x+5)) in regular polynomial form. polynomial MATLAB Answers — New Questions
Simscape forces and torques: Centrifugal, gravitational, accelerative
Goodafternoon ‘u all,
I’m actually working with simscape and I was wondering if any way exist to get from a multibody model acting forces components, ad function of kinematic conditions. In simpler words, how can I get centrifugal, coriolis, gravitations, and accelerative forces components action on a mass or body of the system? Let’s assume as first approximation we’re working with rigid body (but I imagine would be in any case a good approximation also for other cases). I don’t see any evident methd for getting them easily, unless repeating all required onerous calculations (futile to say I’m not going for :-D). In robotic toolbox all these components are directly derived from internal jacobians and kinematcs conditions. I was guessing any similar feature also exist in simscape. Remarks, I’m currently using simscape under simulink environment.
Suggestions?
Best regardsGoodafternoon ‘u all,
I’m actually working with simscape and I was wondering if any way exist to get from a multibody model acting forces components, ad function of kinematic conditions. In simpler words, how can I get centrifugal, coriolis, gravitations, and accelerative forces components action on a mass or body of the system? Let’s assume as first approximation we’re working with rigid body (but I imagine would be in any case a good approximation also for other cases). I don’t see any evident methd for getting them easily, unless repeating all required onerous calculations (futile to say I’m not going for :-D). In robotic toolbox all these components are directly derived from internal jacobians and kinematcs conditions. I was guessing any similar feature also exist in simscape. Remarks, I’m currently using simscape under simulink environment.
Suggestions?
Best regards Goodafternoon ‘u all,
I’m actually working with simscape and I was wondering if any way exist to get from a multibody model acting forces components, ad function of kinematic conditions. In simpler words, how can I get centrifugal, coriolis, gravitations, and accelerative forces components action on a mass or body of the system? Let’s assume as first approximation we’re working with rigid body (but I imagine would be in any case a good approximation also for other cases). I don’t see any evident methd for getting them easily, unless repeating all required onerous calculations (futile to say I’m not going for :-D). In robotic toolbox all these components are directly derived from internal jacobians and kinematcs conditions. I was guessing any similar feature also exist in simscape. Remarks, I’m currently using simscape under simulink environment.
Suggestions?
Best regards simscape, multibody, forces MATLAB Answers — New Questions
Plotting Complex Functions.
I intend to do a taylor series expansion at t=0. I would like to plot the coefficients of each Taylor term in the complex plane, using the surf function.
I tried Taylor(F) , Series (F) somewhere there is an error. The function is product of two gaussians, with two parameters mentioned above. This Gaussian contains other constants, Some are symbolic, while some have pre determined values.
Can some one help me out.
Thanks.I intend to do a taylor series expansion at t=0. I would like to plot the coefficients of each Taylor term in the complex plane, using the surf function.
I tried Taylor(F) , Series (F) somewhere there is an error. The function is product of two gaussians, with two parameters mentioned above. This Gaussian contains other constants, Some are symbolic, while some have pre determined values.
Can some one help me out.
Thanks. I intend to do a taylor series expansion at t=0. I would like to plot the coefficients of each Taylor term in the complex plane, using the surf function.
I tried Taylor(F) , Series (F) somewhere there is an error. The function is product of two gaussians, with two parameters mentioned above. This Gaussian contains other constants, Some are symbolic, while some have pre determined values.
Can some one help me out.
Thanks. complex intergaration, taylor series MATLAB Answers — New Questions
Plot grraph , srink is problem
the following code is plot the graph I want to change the Y axis value so that the box and plot on x -axis does concide , I try it using limit commmand but it just srink the graph
x=-1000:25:975
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
plot(x,u_RDTM,’o’,x,u_exact)
xlim([-1844 2054])
ylim([-6950633103752 1818593846248])the following code is plot the graph I want to change the Y axis value so that the box and plot on x -axis does concide , I try it using limit commmand but it just srink the graph
x=-1000:25:975
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
plot(x,u_RDTM,’o’,x,u_exact)
xlim([-1844 2054])
ylim([-6950633103752 1818593846248]) the following code is plot the graph I want to change the Y axis value so that the box and plot on x -axis does concide , I try it using limit commmand but it just srink the graph
x=-1000:25:975
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
plot(x,u_RDTM,’o’,x,u_exact)
xlim([-1844 2054])
ylim([-6950633103752 1818593846248]) graphiical representation MATLAB Answers — New Questions
Syntax error , Component: Simulink, Category: Block error
I am trying to create user defined function theta_2dot of inverted pedulum (cart and pole) using following formulas which is giving me syntax error
Formulas are : -(l*m*cos(u(3))*sin(u(3))*u(4)^2 + F*cos(u(3)) – g*m*sin(u(3)) – M*g*sin(u(3)))/(l*(M + m – m*cos(u(3))^2))
I would like to know correct format for above formulas.
Thank you, AaronI am trying to create user defined function theta_2dot of inverted pedulum (cart and pole) using following formulas which is giving me syntax error
Formulas are : -(l*m*cos(u(3))*sin(u(3))*u(4)^2 + F*cos(u(3)) – g*m*sin(u(3)) – M*g*sin(u(3)))/(l*(M + m – m*cos(u(3))^2))
I would like to know correct format for above formulas.
Thank you, Aaron I am trying to create user defined function theta_2dot of inverted pedulum (cart and pole) using following formulas which is giving me syntax error
Formulas are : -(l*m*cos(u(3))*sin(u(3))*u(4)^2 + F*cos(u(3)) – g*m*sin(u(3)) – M*g*sin(u(3)))/(l*(M + m – m*cos(u(3))^2))
I would like to know correct format for above formulas.
Thank you, Aaron simulink, block error MATLAB Answers — New Questions
boolean to double signals
hello
I want to create PWM signal generator blocks in Simulink which has blanking time also. but i have problem with finding the right block and configuration. I used "Transport delay" or "Variable Time delay" or "dead zone". there is the problem with boolean to double signal in varible time delay and transpor delay.
please help me
thankshello
I want to create PWM signal generator blocks in Simulink which has blanking time also. but i have problem with finding the right block and configuration. I used "Transport delay" or "Variable Time delay" or "dead zone". there is the problem with boolean to double signal in varible time delay and transpor delay.
please help me
thanks hello
I want to create PWM signal generator blocks in Simulink which has blanking time also. but i have problem with finding the right block and configuration. I used "Transport delay" or "Variable Time delay" or "dead zone". there is the problem with boolean to double signal in varible time delay and transpor delay.
please help me
thanks simulink MATLAB Answers — New Questions
how to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
how to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
Actually i am writing a matlab code for training in Matlan onramp and didn’t getting how to solve the abovehow to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
Actually i am writing a matlab code for training in Matlan onramp and didn’t getting how to solve the above how to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
Actually i am writing a matlab code for training in Matlan onramp and didn’t getting how to solve the above create a function, modify a function MATLAB Answers — New Questions
How can I calculate the forces and moments on servo arms and couplers in a Stewart platform simulation using MATLAB
I am currently working on developing a Stewart platform and have calculated the inverse kinematic. I’ve also created a Simscape Multibody simulation, utilizing revolute joints (driven by angle inputs), brick solids, and spherical joints. From this simulation, I extracted the joint torques necessary to drive the top platform based on a given input trajectory. This data has helped me select appropriate motors and spherical joints.
Now, I need to determine the forces and moments applied to the servo arms and couplers. My goal is to ensure that the servo arms do not twist and the couplers do not buckle under load. Could you advise on how I can calculate these forces and moments using MATLAB, or would it be more appropriate to use another tool for this analysis?
The mechanical members in question are highlighted in the attached pictures.I am currently working on developing a Stewart platform and have calculated the inverse kinematic. I’ve also created a Simscape Multibody simulation, utilizing revolute joints (driven by angle inputs), brick solids, and spherical joints. From this simulation, I extracted the joint torques necessary to drive the top platform based on a given input trajectory. This data has helped me select appropriate motors and spherical joints.
Now, I need to determine the forces and moments applied to the servo arms and couplers. My goal is to ensure that the servo arms do not twist and the couplers do not buckle under load. Could you advise on how I can calculate these forces and moments using MATLAB, or would it be more appropriate to use another tool for this analysis?
The mechanical members in question are highlighted in the attached pictures. I am currently working on developing a Stewart platform and have calculated the inverse kinematic. I’ve also created a Simscape Multibody simulation, utilizing revolute joints (driven by angle inputs), brick solids, and spherical joints. From this simulation, I extracted the joint torques necessary to drive the top platform based on a given input trajectory. This data has helped me select appropriate motors and spherical joints.
Now, I need to determine the forces and moments applied to the servo arms and couplers. My goal is to ensure that the servo arms do not twist and the couplers do not buckle under load. Could you advise on how I can calculate these forces and moments using MATLAB, or would it be more appropriate to use another tool for this analysis?
The mechanical members in question are highlighted in the attached pictures. simscape, matlab, force analysis, simulink, inverse kinematics, stuart’s platform MATLAB Answers — New Questions
STM32F4xx SPI Block Error
I’m working with a customized embedded system with stm32f410C8 processor in simulink R2024a. I’m using the latest version of embedded coder support package for STM32 procesors(version 24.1.3). The goal is communicating with a sensor over SPI. In a simple model I have added just a SPI Tranmit block.When I set chip select calling mehod to "Provided by the SPI peripherial" there is no error in model building process. but when I set chip select calling mehod to "Expilicit GPIO calls" I got this strange error without any hints to debug
### Starting build procedure for: H4CAModel
### Build procedure for H4CAModel aborted due to an error.
Build Summary
Top model targets built:
Model Action Rebuild Reason
=====================================================================
H4CAModel Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 0.63179s
Unrecognized field name "Signal".
I have done many projects with this support package but with other processors like stm32h7 series and i didn’t encountered this error. The point to be noted in this case is that SPI blocks for STM32F4xx processors have been added to suport package recently(R2024a).
Every little tip can go a long way.
Thanks.I’m working with a customized embedded system with stm32f410C8 processor in simulink R2024a. I’m using the latest version of embedded coder support package for STM32 procesors(version 24.1.3). The goal is communicating with a sensor over SPI. In a simple model I have added just a SPI Tranmit block.When I set chip select calling mehod to "Provided by the SPI peripherial" there is no error in model building process. but when I set chip select calling mehod to "Expilicit GPIO calls" I got this strange error without any hints to debug
### Starting build procedure for: H4CAModel
### Build procedure for H4CAModel aborted due to an error.
Build Summary
Top model targets built:
Model Action Rebuild Reason
=====================================================================
H4CAModel Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 0.63179s
Unrecognized field name "Signal".
I have done many projects with this support package but with other processors like stm32h7 series and i didn’t encountered this error. The point to be noted in this case is that SPI blocks for STM32F4xx processors have been added to suport package recently(R2024a).
Every little tip can go a long way.
Thanks. I’m working with a customized embedded system with stm32f410C8 processor in simulink R2024a. I’m using the latest version of embedded coder support package for STM32 procesors(version 24.1.3). The goal is communicating with a sensor over SPI. In a simple model I have added just a SPI Tranmit block.When I set chip select calling mehod to "Provided by the SPI peripherial" there is no error in model building process. but when I set chip select calling mehod to "Expilicit GPIO calls" I got this strange error without any hints to debug
### Starting build procedure for: H4CAModel
### Build procedure for H4CAModel aborted due to an error.
Build Summary
Top model targets built:
Model Action Rebuild Reason
=====================================================================
H4CAModel Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 0.63179s
Unrecognized field name "Signal".
I have done many projects with this support package but with other processors like stm32h7 series and i didn’t encountered this error. The point to be noted in this case is that SPI blocks for STM32F4xx processors have been added to suport package recently(R2024a).
Every little tip can go a long way.
Thanks. stm32f4xx, spi transmit MATLAB Answers — New Questions
Problema despues de ejecutar comando “addpath”
Holas:
Estoy usando Matlb 2021b en una PC-Win10.
Dado que no tengo derechos de administrador, cada vez que iniciaba un programa ejecutaba el comando "addpath" incluyendo el directorio que queria se incluyera:
addpath(genpath(‘c:Userspr8331C-ccar0_NuBES1_Nextcloud1____K_I_T54_m’),’-begin’)
Desde hace un tiempo ya empece a percatar que matlab empieza a tener error que no permite que se ejecuten mis codigos (que ya funcionaban previamente).
Por ejemplo estoy tratando de ejecutar mi funcion para buscar la ruta de un archivo:
function [rutArchivo, Dir, Archivo, Extension] = f_PathFile()
% anteriormente llamada f_VenetanaBuscaArchivo => le estoy cambiando el nombre para poder recordarme más facil
%
% Funcion que busca el path de un archivo seleccionado en la ventana.
% Para filtrar por extension en la busqueda primeramente se abre ventana preguntando la extension a buscar
%
% InPUT:
%==========
% No requiere
%
% OutPUT:
%==========
% rutArchivo: string, Ruta del archivo
% Dir: string, path del archivo
% Archivo: string, nombre del archivo
% Ext_ string, extension del archivo
%
% addpath(genpath(‘\sccfs-home.scc.kit.eduhomeMATLAB’),’-begin’) %esta línea agrega todas las subcarpetas de la Carpeta Matlab para asi leer las funciones sin problema
% addpath(genpath(‘c:Userspr8331C-ccar0_NuBES1_Nextcloud1____K_I_T54_m’),’-begin’) %esta línea agrega todas las subcarpetas de la Carpeta Matlab para asi leer las funciones sin problema
%%
defaultValue = {‘txt’};
disp([‘°fff starting f_PathFile’])
titleBar = ‘InPut’; % Click sobre archivo a seleccionar: ‘;
userPrompt = {‘Extencion a usar para la búsqueda: ‘ };
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Extension = [‘*.’ char(Entrada(1,1))];
%%
TiituloBarra = [‘Busqueda filtrada para archivos del tipo: ‘ Extension];
disp([‘ffff ‘ TiituloBarra]);
[File,Dir] = uigetfile(Extension, TiituloBarra);
rutArchivo = [Dir File];
disp([‘#fff Selected PathFile: ‘ rutArchivo])
end
Cuando se trata de ejecutar la linea de:
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Obtengo el siguiente error y el programa deja de funcinar, hasa que reinicie matlab nuevamente.
Error: File: system_dependent.m Line: 1 Column: 24
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
Error in usejava (line 44)
isok = system_dependent(‘useJava’,feature);
Error in matlab.ui.internal.utils.checkJVMError (line 14)
if ~isdecaf && ~usejava(‘jvm’)
Error in warnfiguredialog (line 8)
matlab.ui.internal.utils.checkJVMError;
Error in dialog (line 42)
warnfiguredialog(‘dialog’);
Error in inputdlg (line 147)
InputFig=dialog( …
Error in f_PathFile (line 26)
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Alguna sugerencia?Holas:
Estoy usando Matlb 2021b en una PC-Win10.
Dado que no tengo derechos de administrador, cada vez que iniciaba un programa ejecutaba el comando "addpath" incluyendo el directorio que queria se incluyera:
addpath(genpath(‘c:Userspr8331C-ccar0_NuBES1_Nextcloud1____K_I_T54_m’),’-begin’)
Desde hace un tiempo ya empece a percatar que matlab empieza a tener error que no permite que se ejecuten mis codigos (que ya funcionaban previamente).
Por ejemplo estoy tratando de ejecutar mi funcion para buscar la ruta de un archivo:
function [rutArchivo, Dir, Archivo, Extension] = f_PathFile()
% anteriormente llamada f_VenetanaBuscaArchivo => le estoy cambiando el nombre para poder recordarme más facil
%
% Funcion que busca el path de un archivo seleccionado en la ventana.
% Para filtrar por extension en la busqueda primeramente se abre ventana preguntando la extension a buscar
%
% InPUT:
%==========
% No requiere
%
% OutPUT:
%==========
% rutArchivo: string, Ruta del archivo
% Dir: string, path del archivo
% Archivo: string, nombre del archivo
% Ext_ string, extension del archivo
%
% addpath(genpath(‘\sccfs-home.scc.kit.eduhomeMATLAB’),’-begin’) %esta línea agrega todas las subcarpetas de la Carpeta Matlab para asi leer las funciones sin problema
% addpath(genpath(‘c:Userspr8331C-ccar0_NuBES1_Nextcloud1____K_I_T54_m’),’-begin’) %esta línea agrega todas las subcarpetas de la Carpeta Matlab para asi leer las funciones sin problema
%%
defaultValue = {‘txt’};
disp([‘°fff starting f_PathFile’])
titleBar = ‘InPut’; % Click sobre archivo a seleccionar: ‘;
userPrompt = {‘Extencion a usar para la búsqueda: ‘ };
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Extension = [‘*.’ char(Entrada(1,1))];
%%
TiituloBarra = [‘Busqueda filtrada para archivos del tipo: ‘ Extension];
disp([‘ffff ‘ TiituloBarra]);
[File,Dir] = uigetfile(Extension, TiituloBarra);
rutArchivo = [Dir File];
disp([‘#fff Selected PathFile: ‘ rutArchivo])
end
Cuando se trata de ejecutar la linea de:
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Obtengo el siguiente error y el programa deja de funcinar, hasa que reinicie matlab nuevamente.
Error: File: system_dependent.m Line: 1 Column: 24
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
Error in usejava (line 44)
isok = system_dependent(‘useJava’,feature);
Error in matlab.ui.internal.utils.checkJVMError (line 14)
if ~isdecaf && ~usejava(‘jvm’)
Error in warnfiguredialog (line 8)
matlab.ui.internal.utils.checkJVMError;
Error in dialog (line 42)
warnfiguredialog(‘dialog’);
Error in inputdlg (line 147)
InputFig=dialog( …
Error in f_PathFile (line 26)
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Alguna sugerencia? Holas:
Estoy usando Matlb 2021b en una PC-Win10.
Dado que no tengo derechos de administrador, cada vez que iniciaba un programa ejecutaba el comando "addpath" incluyendo el directorio que queria se incluyera:
addpath(genpath(‘c:Userspr8331C-ccar0_NuBES1_Nextcloud1____K_I_T54_m’),’-begin’)
Desde hace un tiempo ya empece a percatar que matlab empieza a tener error que no permite que se ejecuten mis codigos (que ya funcionaban previamente).
Por ejemplo estoy tratando de ejecutar mi funcion para buscar la ruta de un archivo:
function [rutArchivo, Dir, Archivo, Extension] = f_PathFile()
% anteriormente llamada f_VenetanaBuscaArchivo => le estoy cambiando el nombre para poder recordarme más facil
%
% Funcion que busca el path de un archivo seleccionado en la ventana.
% Para filtrar por extension en la busqueda primeramente se abre ventana preguntando la extension a buscar
%
% InPUT:
%==========
% No requiere
%
% OutPUT:
%==========
% rutArchivo: string, Ruta del archivo
% Dir: string, path del archivo
% Archivo: string, nombre del archivo
% Ext_ string, extension del archivo
%
% addpath(genpath(‘\sccfs-home.scc.kit.eduhomeMATLAB’),’-begin’) %esta línea agrega todas las subcarpetas de la Carpeta Matlab para asi leer las funciones sin problema
% addpath(genpath(‘c:Userspr8331C-ccar0_NuBES1_Nextcloud1____K_I_T54_m’),’-begin’) %esta línea agrega todas las subcarpetas de la Carpeta Matlab para asi leer las funciones sin problema
%%
defaultValue = {‘txt’};
disp([‘°fff starting f_PathFile’])
titleBar = ‘InPut’; % Click sobre archivo a seleccionar: ‘;
userPrompt = {‘Extencion a usar para la búsqueda: ‘ };
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Extension = [‘*.’ char(Entrada(1,1))];
%%
TiituloBarra = [‘Busqueda filtrada para archivos del tipo: ‘ Extension];
disp([‘ffff ‘ TiituloBarra]);
[File,Dir] = uigetfile(Extension, TiituloBarra);
rutArchivo = [Dir File];
disp([‘#fff Selected PathFile: ‘ rutArchivo])
end
Cuando se trata de ejecutar la linea de:
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Obtengo el siguiente error y el programa deja de funcinar, hasa que reinicie matlab nuevamente.
Error: File: system_dependent.m Line: 1 Column: 24
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
Error in usejava (line 44)
isok = system_dependent(‘useJava’,feature);
Error in matlab.ui.internal.utils.checkJVMError (line 14)
if ~isdecaf && ~usejava(‘jvm’)
Error in warnfiguredialog (line 8)
matlab.ui.internal.utils.checkJVMError;
Error in dialog (line 42)
warnfiguredialog(‘dialog’);
Error in inputdlg (line 147)
InputFig=dialog( …
Error in f_PathFile (line 26)
Entrada = inputdlg(userPrompt,titleBar, [1 35], defaultValue);
Alguna sugerencia? administrator, addpath, jave error MATLAB Answers — New Questions
System stability in control system engineering
The mathematical model of a systemis given by:
x ̈ +(x^2- η) x ̇ +w^(2 )x=0
For w=1
Show that a stable equilibrium point becomes unstable as the parameter 𝜂 is varied from -1 in +1 using phase plane analysis.
At what value of 𝜂 does the instability occur?
What happens to the system after the equilibrium point becomes unstable?The mathematical model of a systemis given by:
x ̈ +(x^2- η) x ̇ +w^(2 )x=0
For w=1
Show that a stable equilibrium point becomes unstable as the parameter 𝜂 is varied from -1 in +1 using phase plane analysis.
At what value of 𝜂 does the instability occur?
What happens to the system after the equilibrium point becomes unstable? The mathematical model of a systemis given by:
x ̈ +(x^2- η) x ̇ +w^(2 )x=0
For w=1
Show that a stable equilibrium point becomes unstable as the parameter 𝜂 is varied from -1 in +1 using phase plane analysis.
At what value of 𝜂 does the instability occur?
What happens to the system after the equilibrium point becomes unstable? control system MATLAB Answers — New Questions
SSO for Linux and Mac users, setup guidance for multiple users.
Hello MATLAB Community,
I’m reaching out to understand the implications of MATLAB’s transition from traditional license servers to Single Sign-On (SSO) for Linux and Mac users.
How will this transition impact users on Linux and Mac systems? Are there specific considerations or additional steps required for these platforms to ensure continued access and functionality?
Could someone provide guidance on how to set up MATLAB SSO for multiple users on Linux and Mac systems within a business or educational institution? Any best practices or detailed instructions for managing SSO for a larger group across these operating systems would be very helpful.
Any detailed information or guidance on these topics would be greatly appreciated.Hello MATLAB Community,
I’m reaching out to understand the implications of MATLAB’s transition from traditional license servers to Single Sign-On (SSO) for Linux and Mac users.
How will this transition impact users on Linux and Mac systems? Are there specific considerations or additional steps required for these platforms to ensure continued access and functionality?
Could someone provide guidance on how to set up MATLAB SSO for multiple users on Linux and Mac systems within a business or educational institution? Any best practices or detailed instructions for managing SSO for a larger group across these operating systems would be very helpful.
Any detailed information or guidance on these topics would be greatly appreciated. Hello MATLAB Community,
I’m reaching out to understand the implications of MATLAB’s transition from traditional license servers to Single Sign-On (SSO) for Linux and Mac users.
How will this transition impact users on Linux and Mac systems? Are there specific considerations or additional steps required for these platforms to ensure continued access and functionality?
Could someone provide guidance on how to set up MATLAB SSO for multiple users on Linux and Mac systems within a business or educational institution? Any best practices or detailed instructions for managing SSO for a larger group across these operating systems would be very helpful.
Any detailed information or guidance on these topics would be greatly appreciated. sso, matlab, linux, mac, license server MATLAB Answers — New Questions
HDL Coder and Bitstream Programming Insight Needed
I am trying to program the DAC PL-DDR Transmit example ( https://www.mathworks.com/help/hdlcoder/ug/hdl-dac-PL-DDR4-transmit.html ) to my ZCU216 board. I have already asked a question about this a few days ago but will make this one more broad to give it a better chance of being answered.
When generating and programming the bitstream, I ensure that the AXI4 Stream Interface is 128 bits wide. However, when I run the addAXI4StreamInterface() function, a prequisite to writing to the port from MATLAB for testing purposes, I am getting data mismatch errors that can be resolved by changing the inteface width to 64 bits. So, clearly the programmed FPGA is expecting the function to request 64 bits and not 128.
My question is: what kind of troubleshooting steps are aviailable for an issue like this? Trying to explore these functions, you run into .p files quickly, so it’s been impossible so far to see what’s going on under the hood.I am trying to program the DAC PL-DDR Transmit example ( https://www.mathworks.com/help/hdlcoder/ug/hdl-dac-PL-DDR4-transmit.html ) to my ZCU216 board. I have already asked a question about this a few days ago but will make this one more broad to give it a better chance of being answered.
When generating and programming the bitstream, I ensure that the AXI4 Stream Interface is 128 bits wide. However, when I run the addAXI4StreamInterface() function, a prequisite to writing to the port from MATLAB for testing purposes, I am getting data mismatch errors that can be resolved by changing the inteface width to 64 bits. So, clearly the programmed FPGA is expecting the function to request 64 bits and not 128.
My question is: what kind of troubleshooting steps are aviailable for an issue like this? Trying to explore these functions, you run into .p files quickly, so it’s been impossible so far to see what’s going on under the hood. I am trying to program the DAC PL-DDR Transmit example ( https://www.mathworks.com/help/hdlcoder/ug/hdl-dac-PL-DDR4-transmit.html ) to my ZCU216 board. I have already asked a question about this a few days ago but will make this one more broad to give it a better chance of being answered.
When generating and programming the bitstream, I ensure that the AXI4 Stream Interface is 128 bits wide. However, when I run the addAXI4StreamInterface() function, a prequisite to writing to the port from MATLAB for testing purposes, I am getting data mismatch errors that can be resolved by changing the inteface width to 64 bits. So, clearly the programmed FPGA is expecting the function to request 64 bits and not 128.
My question is: what kind of troubleshooting steps are aviailable for an issue like this? Trying to explore these functions, you run into .p files quickly, so it’s been impossible so far to see what’s going on under the hood. hdl coder, zcu216, dac, ddr MATLAB Answers — New Questions
Performing operations on row elements in a matrix
So I’m creating some simple examples on trying to perform operations between rows in a matrix such as division. I have a matrix where:
my_mat = [2 4 6 8; 4 8 12 16]
which looks like so when printed.
my_mat =
2 4 6 8
4 8 12 16
and what I’m trying to do now is to divide the elements of the first row with the corresponding neighbouring ones which is the second row in this case since it’s only a 2×4 matrix. This means 2/4, 4/8, 6/12 and 8/16
Then perhaps printing out the result as the output
0.5
0.5
0.5
0.5
How do i perform row operations in a single matrix?
I’ve looked into bsxfun but apparently i can’t figure out the way to perform row operations with it.So I’m creating some simple examples on trying to perform operations between rows in a matrix such as division. I have a matrix where:
my_mat = [2 4 6 8; 4 8 12 16]
which looks like so when printed.
my_mat =
2 4 6 8
4 8 12 16
and what I’m trying to do now is to divide the elements of the first row with the corresponding neighbouring ones which is the second row in this case since it’s only a 2×4 matrix. This means 2/4, 4/8, 6/12 and 8/16
Then perhaps printing out the result as the output
0.5
0.5
0.5
0.5
How do i perform row operations in a single matrix?
I’ve looked into bsxfun but apparently i can’t figure out the way to perform row operations with it. So I’m creating some simple examples on trying to perform operations between rows in a matrix such as division. I have a matrix where:
my_mat = [2 4 6 8; 4 8 12 16]
which looks like so when printed.
my_mat =
2 4 6 8
4 8 12 16
and what I’m trying to do now is to divide the elements of the first row with the corresponding neighbouring ones which is the second row in this case since it’s only a 2×4 matrix. This means 2/4, 4/8, 6/12 and 8/16
Then perhaps printing out the result as the output
0.5
0.5
0.5
0.5
How do i perform row operations in a single matrix?
I’ve looked into bsxfun but apparently i can’t figure out the way to perform row operations with it. image processing, matlab, rows, matrix MATLAB Answers — New Questions
How to Use Future System States to Make Real-Time Decisions in Simulink?
I would like to implement the following function in my Simulink model:
At time instant ti, I need to calculate the value of an ODE function using an integrator block over the next 2 seconds, i.e., the time span is [ti, ti+2]. Then, I want to retrieve the system states at time ti+2 and use this information to make a decision on the execution commands at the current time ti.
Does anyone have suggestions on how to approach this problem? Thanks in advance.I would like to implement the following function in my Simulink model:
At time instant ti, I need to calculate the value of an ODE function using an integrator block over the next 2 seconds, i.e., the time span is [ti, ti+2]. Then, I want to retrieve the system states at time ti+2 and use this information to make a decision on the execution commands at the current time ti.
Does anyone have suggestions on how to approach this problem? Thanks in advance. I would like to implement the following function in my Simulink model:
At time instant ti, I need to calculate the value of an ODE function using an integrator block over the next 2 seconds, i.e., the time span is [ti, ti+2]. Then, I want to retrieve the system states at time ti+2 and use this information to make a decision on the execution commands at the current time ti.
Does anyone have suggestions on how to approach this problem? Thanks in advance. simulink MATLAB Answers — New Questions
Hello everyone i am solving multi degree freedom of system by using Newmarks beta method in which loading function F(x,v). When i am ruing the code, the result i
% dynamic analysis using direct integration method
% % the porbleme is: Mx”+Cx’+Kx=(C1+K1) *eps*cos(Omeg*t)+K2* eps^2cos(Omeg*t)^2
clc;
clear all
format short e
%close all
m=[18438.6 0 0;0 13761 0;0 0 9174];
disp(‘ mass matrix’)
m;
[ns,ms]=size(m);
% if forces are acting at degrees of freedom
m=[40000 0 0;0 20000 0;0 0 20000];
c0=[0 0 0;0 -8000 8000;0 -8000 8000];
c1=[0 0 0;0 -4000 8000;0 -8000 4000];
k0=[30000 -10000 0;-10000 20000 -10000;0 -10000 10000];
k1=[30000 -10000 0;-10000 50000 -10000;0 -10000 50000];
k2=[30000 -10000 0;-10000 20000 -40000;0 -40000 10000];
% disp(‘ force at various degrees of freedom’);
% f;
%if base ground acceleration is given
% dis=’disp.dat’
% di=load(dis)
% % convert to equivalent nodal loads
% for i=1:ns
% f(:,i)=-di*m(i,i)
% end
disp(‘ damping matrix’)
c0;
disp(‘ stiffness matrix’)
k0;
format long;
kim=inv(k0)*m;
[evec,ev]=eig(kim);
for i=1:ns
omega(i)=1/sqrt(ev(i,i));
end
disp(‘ natural frequencies’)
omega;
% give gamma=0.5 and beta=0.25 for Newmark average accln method
%gama=0.5;
%beta=0.25;
%give gamma=0.5 and beta=0.1667 for Newmark linear accln method
gama=0.5;
beta=0.167;
%give initial conditions for displacements
u0=[0 0.01 0.05];
disp(‘ initial displacements’)
u0;
%give initial condition for velocities
v0=[0. 0. 0.];
%y0=[0;0.01;0.05;0;0;0];
disp(‘ initial velocities’)
v0;
om=5; eps=0.01;
IM=inv(m);
X=u0′; Z=v0′;
tt=0;
% S1=-IM*k0+IM*k1*eps.*cos(om*tt)+IM*k2*eps^2.*cos(om*tt)^2;
% S2=-IM*c0+IM*c1*eps.*cos(om*tt);
dt=0.02;
S=k2*dt^2*beta*eps^2*cos(om*tt)^2+k1*dt^2*beta*eps*cos(om*tt)+…
c1*gama*dt*eps*cos(om*tt)+k0*dt^2*beta+c0*gama*dt+m;
S1=k1*eps.*cos(om*tt)+k2*eps^2.*cos(om*tt)^2;
S2=c1*eps.*cos(om*tt);
f(1,:)=(S1*X+S2*Z);
%for i=1:ns
a0=-inv(m)*(f(1,:)’+c0*v0’+k0*u0′);
%end
kba=k0+(gama/(beta*dt))*c0+(1/(beta*dt*dt))*m;
kin=inv(kba);
aa=(1/(beta*dt))*m+(gama/beta)*c0;
bb=(1/(2.0*beta))*m+dt*(gama/(2.0*beta)-1)*c0;
u(1,:)=u0;
v(1,:)=v0;
a(1,:)=a0;
t=linspace(0,5,251);
for i=2:10%251
X=u(i-1,:)’; Z=v(i-1,:)’;
S1=k1*eps.*cos(om*tt)+k2*eps^2.*cos(om*tt)^2;
S2=c1*eps.*cos(om*tt);
f(i,:)=(S1*X+S2*Z); %%%%% ??????
df=f(i,:)-f(i-1,:);
dfb(i,:)=df+v(i-1,:)*aa’+a(i-1,:)*bb’;
du(i,:)=dfb(i,:)*kin;
dv(i,:)=(gama/(beta*dt))*du(i,:)-(gama/beta)*v(i-1,:)+dt*…
(1-gama/(2.0*beta))*a(i-1,:);
da(i,:)=(1/(beta*dt^2))*du(i,:)-(1/(beta*dt))*v(i-1,:)-(1/(2.0*beta))*a(i-1,:);
u(i,:)=u(i-1,:)+du(i,:);
v(i,:)=v(i-1,:)+dv(i,:);
a(i,:)=a(i-1,:)+da(i,:);
end
%figure(1);
hold on
plot(tt,u(:,1),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof displacement’);
title(‘ displacement response of the roof’);
%figure(2);
hold on
plot(tt,u(:,2),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof velocity’);
title(‘velocity response of the roof’);
%figure(3);
hold on
plot(tt,u(:,3),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof acceleration’);
title(‘ acceleration response of the roof’)% dynamic analysis using direct integration method
% % the porbleme is: Mx”+Cx’+Kx=(C1+K1) *eps*cos(Omeg*t)+K2* eps^2cos(Omeg*t)^2
clc;
clear all
format short e
%close all
m=[18438.6 0 0;0 13761 0;0 0 9174];
disp(‘ mass matrix’)
m;
[ns,ms]=size(m);
% if forces are acting at degrees of freedom
m=[40000 0 0;0 20000 0;0 0 20000];
c0=[0 0 0;0 -8000 8000;0 -8000 8000];
c1=[0 0 0;0 -4000 8000;0 -8000 4000];
k0=[30000 -10000 0;-10000 20000 -10000;0 -10000 10000];
k1=[30000 -10000 0;-10000 50000 -10000;0 -10000 50000];
k2=[30000 -10000 0;-10000 20000 -40000;0 -40000 10000];
% disp(‘ force at various degrees of freedom’);
% f;
%if base ground acceleration is given
% dis=’disp.dat’
% di=load(dis)
% % convert to equivalent nodal loads
% for i=1:ns
% f(:,i)=-di*m(i,i)
% end
disp(‘ damping matrix’)
c0;
disp(‘ stiffness matrix’)
k0;
format long;
kim=inv(k0)*m;
[evec,ev]=eig(kim);
for i=1:ns
omega(i)=1/sqrt(ev(i,i));
end
disp(‘ natural frequencies’)
omega;
% give gamma=0.5 and beta=0.25 for Newmark average accln method
%gama=0.5;
%beta=0.25;
%give gamma=0.5 and beta=0.1667 for Newmark linear accln method
gama=0.5;
beta=0.167;
%give initial conditions for displacements
u0=[0 0.01 0.05];
disp(‘ initial displacements’)
u0;
%give initial condition for velocities
v0=[0. 0. 0.];
%y0=[0;0.01;0.05;0;0;0];
disp(‘ initial velocities’)
v0;
om=5; eps=0.01;
IM=inv(m);
X=u0′; Z=v0′;
tt=0;
% S1=-IM*k0+IM*k1*eps.*cos(om*tt)+IM*k2*eps^2.*cos(om*tt)^2;
% S2=-IM*c0+IM*c1*eps.*cos(om*tt);
dt=0.02;
S=k2*dt^2*beta*eps^2*cos(om*tt)^2+k1*dt^2*beta*eps*cos(om*tt)+…
c1*gama*dt*eps*cos(om*tt)+k0*dt^2*beta+c0*gama*dt+m;
S1=k1*eps.*cos(om*tt)+k2*eps^2.*cos(om*tt)^2;
S2=c1*eps.*cos(om*tt);
f(1,:)=(S1*X+S2*Z);
%for i=1:ns
a0=-inv(m)*(f(1,:)’+c0*v0’+k0*u0′);
%end
kba=k0+(gama/(beta*dt))*c0+(1/(beta*dt*dt))*m;
kin=inv(kba);
aa=(1/(beta*dt))*m+(gama/beta)*c0;
bb=(1/(2.0*beta))*m+dt*(gama/(2.0*beta)-1)*c0;
u(1,:)=u0;
v(1,:)=v0;
a(1,:)=a0;
t=linspace(0,5,251);
for i=2:10%251
X=u(i-1,:)’; Z=v(i-1,:)’;
S1=k1*eps.*cos(om*tt)+k2*eps^2.*cos(om*tt)^2;
S2=c1*eps.*cos(om*tt);
f(i,:)=(S1*X+S2*Z); %%%%% ??????
df=f(i,:)-f(i-1,:);
dfb(i,:)=df+v(i-1,:)*aa’+a(i-1,:)*bb’;
du(i,:)=dfb(i,:)*kin;
dv(i,:)=(gama/(beta*dt))*du(i,:)-(gama/beta)*v(i-1,:)+dt*…
(1-gama/(2.0*beta))*a(i-1,:);
da(i,:)=(1/(beta*dt^2))*du(i,:)-(1/(beta*dt))*v(i-1,:)-(1/(2.0*beta))*a(i-1,:);
u(i,:)=u(i-1,:)+du(i,:);
v(i,:)=v(i-1,:)+dv(i,:);
a(i,:)=a(i-1,:)+da(i,:);
end
%figure(1);
hold on
plot(tt,u(:,1),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof displacement’);
title(‘ displacement response of the roof’);
%figure(2);
hold on
plot(tt,u(:,2),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof velocity’);
title(‘velocity response of the roof’);
%figure(3);
hold on
plot(tt,u(:,3),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof acceleration’);
title(‘ acceleration response of the roof’) % dynamic analysis using direct integration method
% % the porbleme is: Mx”+Cx’+Kx=(C1+K1) *eps*cos(Omeg*t)+K2* eps^2cos(Omeg*t)^2
clc;
clear all
format short e
%close all
m=[18438.6 0 0;0 13761 0;0 0 9174];
disp(‘ mass matrix’)
m;
[ns,ms]=size(m);
% if forces are acting at degrees of freedom
m=[40000 0 0;0 20000 0;0 0 20000];
c0=[0 0 0;0 -8000 8000;0 -8000 8000];
c1=[0 0 0;0 -4000 8000;0 -8000 4000];
k0=[30000 -10000 0;-10000 20000 -10000;0 -10000 10000];
k1=[30000 -10000 0;-10000 50000 -10000;0 -10000 50000];
k2=[30000 -10000 0;-10000 20000 -40000;0 -40000 10000];
% disp(‘ force at various degrees of freedom’);
% f;
%if base ground acceleration is given
% dis=’disp.dat’
% di=load(dis)
% % convert to equivalent nodal loads
% for i=1:ns
% f(:,i)=-di*m(i,i)
% end
disp(‘ damping matrix’)
c0;
disp(‘ stiffness matrix’)
k0;
format long;
kim=inv(k0)*m;
[evec,ev]=eig(kim);
for i=1:ns
omega(i)=1/sqrt(ev(i,i));
end
disp(‘ natural frequencies’)
omega;
% give gamma=0.5 and beta=0.25 for Newmark average accln method
%gama=0.5;
%beta=0.25;
%give gamma=0.5 and beta=0.1667 for Newmark linear accln method
gama=0.5;
beta=0.167;
%give initial conditions for displacements
u0=[0 0.01 0.05];
disp(‘ initial displacements’)
u0;
%give initial condition for velocities
v0=[0. 0. 0.];
%y0=[0;0.01;0.05;0;0;0];
disp(‘ initial velocities’)
v0;
om=5; eps=0.01;
IM=inv(m);
X=u0′; Z=v0′;
tt=0;
% S1=-IM*k0+IM*k1*eps.*cos(om*tt)+IM*k2*eps^2.*cos(om*tt)^2;
% S2=-IM*c0+IM*c1*eps.*cos(om*tt);
dt=0.02;
S=k2*dt^2*beta*eps^2*cos(om*tt)^2+k1*dt^2*beta*eps*cos(om*tt)+…
c1*gama*dt*eps*cos(om*tt)+k0*dt^2*beta+c0*gama*dt+m;
S1=k1*eps.*cos(om*tt)+k2*eps^2.*cos(om*tt)^2;
S2=c1*eps.*cos(om*tt);
f(1,:)=(S1*X+S2*Z);
%for i=1:ns
a0=-inv(m)*(f(1,:)’+c0*v0’+k0*u0′);
%end
kba=k0+(gama/(beta*dt))*c0+(1/(beta*dt*dt))*m;
kin=inv(kba);
aa=(1/(beta*dt))*m+(gama/beta)*c0;
bb=(1/(2.0*beta))*m+dt*(gama/(2.0*beta)-1)*c0;
u(1,:)=u0;
v(1,:)=v0;
a(1,:)=a0;
t=linspace(0,5,251);
for i=2:10%251
X=u(i-1,:)’; Z=v(i-1,:)’;
S1=k1*eps.*cos(om*tt)+k2*eps^2.*cos(om*tt)^2;
S2=c1*eps.*cos(om*tt);
f(i,:)=(S1*X+S2*Z); %%%%% ??????
df=f(i,:)-f(i-1,:);
dfb(i,:)=df+v(i-1,:)*aa’+a(i-1,:)*bb’;
du(i,:)=dfb(i,:)*kin;
dv(i,:)=(gama/(beta*dt))*du(i,:)-(gama/beta)*v(i-1,:)+dt*…
(1-gama/(2.0*beta))*a(i-1,:);
da(i,:)=(1/(beta*dt^2))*du(i,:)-(1/(beta*dt))*v(i-1,:)-(1/(2.0*beta))*a(i-1,:);
u(i,:)=u(i-1,:)+du(i,:);
v(i,:)=v(i-1,:)+dv(i,:);
a(i,:)=a(i-1,:)+da(i,:);
end
%figure(1);
hold on
plot(tt,u(:,1),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof displacement’);
title(‘ displacement response of the roof’);
%figure(2);
hold on
plot(tt,u(:,2),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof velocity’);
title(‘velocity response of the roof’);
%figure(3);
hold on
plot(tt,u(:,3),’k’);
xlabel(‘ time in secs’);
ylabel(‘ roof acceleration’);
title(‘ acceleration response of the roof’) thank you MATLAB Answers — New Questions