palce parameter value after using "solve" for a parametric eqn
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
Im trying to place parameter values after I solved parametric eqn.
now Im using for loop and solving the eqn 360 times. is there any beter way to do so?
here is my code:
clear all,clc;
syms t2 t3 ;
a=30;b=60;c=50;d=70;
t3s=zeros(1,360);
for t1=1:1:360
eqns=[a*cosd(t1)+b*cosd(t2)+c*cosd(t3)==70,a*sind(t1)+b*sind(t2)+c*sind(t3)==0];
s=solve(eqns,t2,t3);
t3s(t1)=double(vpa(180+s.t3(2)));
%vpa(s.t2)
end
Réponses (1)
Maybe geometrical approach?
clc,clear
a = 30;
b = 60;
c = 50;
d = 70;
[t1,t2,t3] = meshgrid(0:20:360); % create 3D matrices for each variable
f1 = a*cosd(t1)+b*cosd(t2)+c*cosd(t3)-70;
f2 = a*sind(t1)+b*sind(t2)+c*sind(t3);
cla
p1 = isosurface(t1,t2,t3,f1,0); % first surface patch
p2 = isosurface(t1,t2,t3,f2,0); % second surface patch
patch(p1,'facecolor','r'); % display
patch(p2,'facecolor','b');
[~,fv] = SurfaceIntersection(p1,p2); % find intersection curves
patch('faces',fv.faces,...
'vertices',fv.vertices,...
'linewidth',2,...
'edgecolor','g')
axis vis3d equal
light

SurfaceIntersection function
Cette question est clôturée.
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!