DrYOUSSEF

20 Reputation

0 Badges

0 years, 204 days

MaplePrimes Activity


These are replies submitted by DrYOUSSEF

Tank You very much , it's it's useful for me 

@mmcdara  thank you 

code :

% Define the symbolic variables
syms R1 R2 Omega beta  
% Define the equations
EQ1 = (1/16)*beta^2*Omega^2*R2^6 + 0.4500000000e-1*Omega^2*beta*R2^4 + (Omega^4 - 1.9919*Omega^2 + 1)*R2^2 - 0.225e-1*Omega^2*R1^2;
EQ2 = (.2916*Omega^6 + 0.900e-1)*R1^6 + (2.19456*Omega^4 - 4.80*Omega^2 + 4.80)*R1^4 + (64*Omega^4 - 123.870976*Omega^2 + 64)*R1^2 - 10.24*R2^2;
EQ3 = 0.3164062500e-4*Omega^2*R1^8 + 0.1687500000e-2*Omega^2*(-Omega^2+1)R1^6 + 0.225e-1*Omega^2(-Omega^2+1)^2*R1^4 - 0.3600e-2*Omega^2*R1^2*R2^2 + .16*(Omega^2-1)^2*R2^4;  
% Create a function for the equations
eqns = [EQ1; EQ2; EQ3];  
% Define the range of beta values
beta_values = 0.001:0.01:1.5;  
% Initialize arrays to store
solutions solutions_R1 = [];
solutions_R2 = [];
solutions_Omega = [];  
% Create a function handle for fsolve
equations = matlabFunction(eqns, 'Vars', {beta, R1, R2, Omega});
% Solve the equations for each beta value
for i = 1:length(beta_values)     beta_val = beta_values(i);        
  % Solve the system of equations for the current beta value  
  initial_guess = [1, 1, 1]; % Initial guess for R1, R2, Omega    
  solution = fsolve(@(x) equations(beta_val, x(1), x(2), x(3)), initial_guess);    
  % Store the solutions in arrays    
  solutions_R1(i) = solution(1);    
  solutions_R2(i) = solution(2);    
  solutions_Omega(i) = solution(3);
end
betaN=[0,0.25,0.5,0.75,1,1.5];
R1N=[0.3834,0.2853,0.238,0.208,0.188,0.1604];
R2N=[0.316,0.2329,0.1935,0.169,0.1524,0.129];
% Plot the solutions
figure(111)
plot(beta_values, solutions_R1,betaN,R1N,'o')
xlabel('\beta')
ylabel('R1') title('R1 vs Beta')
figure(211)
plot(beta_values, solutions_R2,betaN,R2N,'o')
xlabel('\beta')
ylabel('R2')
title('R2 vs Beta')
figure(311) plot(beta_values, solutions_Omega)
xlabel('\beta')
ylabel('Omega')
title('Omega vs Beta')

Page 1 of 1