Why am i recieveing only one output even though my input is a matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
clear all
close all %hertzian contact calculator for a sphere
clc;
format long
F= 5000 ;
v1=0.3;
v2=0.3;
E1=700000
E2=700000;
d1=10 ;
d2=100 ;
b=(1/d1)+(1/d2)
m1=(1-v1^2)/E1
m2=(1-v2^2)/E2
a0=0.76241947
a=[ 0.182 : 0.1 : 2.286];
z=[];
U=[];
Q=[];
OK=[];
Pmax=[];
qxy=[];
Pmax=(3*F)./(2*pi*(a.^2));
z= 0.48.*a;
U=(2.*(1+(z.^2/a.^2))) %for simplification of qxy equation --> should not provide only one output!
Q= (1./U); %for simplification of qxy equation
OK=(1-(abs(z./a)*(atan(1/(z./a))))) %for simplification of qxy equation --> does not divide due to a matrix erorr!!
qxy=-Pmax.*(((OK).*(1+v1))-Q)
plot(a,Pmax)
% I am trying to make a hertzian contact stress calculator for spheres
% i need to find "qxy" values for each iteration of "a" but i dont understand
% why the "u" variable creates only one output. After that i also need to plot "qxy" with a values.
% I would really appriciate your solution to my issue and also a feedback
% for the code would really be appriciated. thank you in advance
댓글 수: 0
채택된 답변
KSSV
2022년 11월 3일
You need to use element by element operations.
clc; clear all ;
clear all
close all %hertzian contact calculator for a sphere
clc;
format long
F= 5000 ;
v1=0.3;
v2=0.3;
E1=700000
E2=700000;
d1=10 ;
d2=100 ;
b=(1/d1)+(1/d2)
m1=(1-v1^2)/E1
m2=(1-v2^2)/E2
a0=0.76241947
a=[ 0.182 : 0.1 : 2.286];
z=[];
U=[];
Q=[];
OK=[];
Pmax=[];
qxy=[];
Pmax=(3*F)./(2*pi*(a.^2));
z= 0.48.*a;
U=(2.*(1+(z.^2/a.^2))) %for simplification of qxy equation --> should not provide only one output!
Q= (1./U); %for simplification of qxy equation
OK=(1-(abs(z./a).*(atan(1./(z./a))))) %for simplification of qxy equation --> does not divide due to a matrix erorr!!
%<------- the above equation is changed
qxy=-Pmax.*(((OK).*(1+v1))-Q)
plot(a,Pmax)
% I am trying to make a hertzian contact stress calculator for spheres
% i need to find "qxy" values for each iteration of "a" but i dont understand
% why the "u" variable creates only one output. After that i also need to plot "qxy" with a values.
% I would really appriciate your solution to my issue and also a feedback
% for the code would really be appriciated. thank you in advance
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!