solve a vector of independent equations with only one variable
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Pooneh Shah Malekpoor
 il 18 Feb 2021
  
    
    
    
    
    Risposto: Walter Roberson
      
      
 il 18 Feb 2021
            Hello
Could anyone please guide me as to how solve this system of vector equations(EQ), so it would give me a vector of solutions for d? I just get 0!!!It is worthy to note that phi and n are double parameters and beta(i) is a vector of numbers defined previously.
    syms d   
        QQ=sym(zeros(n,1));
          i=1:n;
              EQ = cos(beta(i))+(((sin(beta(i)))*tan(phi*pi/180))/d)-0.2;
              QQ=solve(EQ,d,'Real',true);
0 Commenti
Risposta accettata
  Walter Roberson
      
      
 il 18 Feb 2021
                      EQ = cos(beta(i))+(((sin(beta(i)))*tan(phi*pi/180))/d)-0.2;
Your beta and phi are constants, and the implied equation for solve is that the value must equal 0. So we have
0 == cos(beta(i))+(((sin(beta(i)))*tan(phi*pi/180))/d)-0.2
0.2 == cos(beta(i)) + (((sin(beta(i)))*tan(phi*pi/180))/d)
0.2 - cos(beta(i)) == sin(beta(i)))*tan(phi*pi/180) / d
d = sin(beta(i)))*tan(phi*pi/180) / (0.2 - cos(beta(i)))
Giving you the vectorized calculation
d = sin(beta) .* tan(phi*pi/180) ./ (0.2 - cos(beta));
No solve() needed.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Numerical Integration and Differential Equations in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

