How to solve 2 equations with 2 unknowns and for Loop
Show older comments
Hi
I have two equations with 2 unknowns K_23 and nu_12.
And I would like to solve these equations but for different V_f(i) value for each i
Thanks
lambda_0=7.0246;
mu_0=1.3380;
nu_0=0.42;
A_3=-3.0399;
A_4=1.0302;
A=-0.8873;
E_11=53.3299;
E_22=5.3694;
G_23=1.5959;
syms K_23 nu_12
for i =1:1:200
V_f(i)=i*0.005;
eq1(i)= K_23(i)== (lambda_0+mu_0)*((1+nu_0)*(1-2*nu_0))/ ...
( 1-nu_0*(1+2*nu_12(i))+V_f(i)*(2*(nu_12(i)-nu_0)*A_3(i)+(1-nu_0*(1+2*nu_12(i)))*A_4(i))/A(i));
eq2(i)= nu_12(i)^2== ((E_11(i)/E_22(i))-(E_11(i)/4)*((1/mu_23(i))+(1/K_23(i))));
sol(i)=solve(eq1(i),eq2(i))
K23value(i)=double(sol.K_23(i))
nu12value(i)=double(sol.nu_12(i))
end
Answers (1)
- remove all (i) parts
- try vpasolve (numerical solver) insteaf of solve (symbolical solver). Your equations can be too complicated for symbolical solver

Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!