Reddit Programming
206 subscribers
1.22K photos
123K links
I will send you newest post from subreddit /r/programming
Download Telegram
using fmincon [k_opt, fval] = fmincon(@(k) calc_diff(k, M, T_wanted, tolerance), k_init, A, b, [], [], ... [k1_lb, k2_lb, k3_lb], [k1_ub, k2_ub, k3_ub], [], options); % Store the optimized values and the objective function value k_opt_values(i, :) = k_opt; opt_fun_values(i) = fval; % Store the minimized difference % Early stopping condition if the difference is within tolerance if fval <= tolerance disp(['Early stopping at iteration ', num2str(i), ' with error: ', num2str(fval)]); k_opt_values = k_opt_values(1:i, :); opt_fun_values = opt_fun_values(1:i); break; end end end % Function to calculate the difference (objective function) function diff = calc_diff(k_vals, M, T_wanted, tolerance) % Extract stiffness values k1 = k_vals(1); k2 = k_vals(2); k3 = k_vals(3); % Construct the stiffness matrix K = stiffness_matrix(k1, k2, k3); % Solve the eigenvalue problem [~, eigenvalues] = eig(K, M); omega = sqrt(diag(eigenvalues)); % Calculate the periods T_calculated = 2 * pi ./ omega; % Calculate the difference between calculated and wanted periods diff = sum((T_calculated - T_wanted).^2); % Use square of differences % Early stopping if tolerance is met max_diff = max(abs(T_calculated - T_wanted)); if max_diff <= tolerance diff = 0; % Stop further evaluations if the tolerance is met end end % Function to create stiffness matrix function K = stiffness_matrix(k1, k2, k3) K = [k1+k2, -k2, 0; -k2, k2+k3, -k3; 0, -k3, k3]; end <!-- SC_ON --> submitted by /u/Warm_Supermarket_765 (https://www.reddit.com/user/Warm_Supermarket_765)
[link] (https://rotorlab.tamu.edu/me617/HD%207%20Modal%20Analysis%20Undamped%20MDOF.pdf) [comments] (https://www.reddit.com/r/programming/comments/1g8l9a3/help_eigenvalue_problem_optimization/)
We just won Startup Weekend Zilina with our dev-focused startup!🚀
https://www.reddit.com/r/programming/comments/1g8obs1/we_just_won_startup_weekend_zilina_with_our/

<!-- SC_OFF -->Hey everyone! My team and I just won Startup Weekend Zilina with a product aimed at helping junior developers create portfolios that stand out to employers! Funny thing is, I actually missed buying the ticket to the event but decided to show up on the day anyway to see if I could get in—and I’m so glad I did! Ended up joining an incredible team, and we worked non-stop all weekend to bring our idea to life. I’m super proud of what we built and of every teammate. It’s been an amazing experience working together! The product makes it super easy for junior devs to create professional portfolios straight from their GitHub projects—no design skills needed, just focus on your code. We are finishing MVP, but core product is functional. If you are interested, shot me DM or join waitlist. Thanks! <!-- SC_ON --> submitted by /u/Absinthko (https://www.reddit.com/user/Absinthko)
[link] (https://blinkfolio.framer.website/) [comments] (https://www.reddit.com/r/programming/comments/1g8obs1/we_just_won_startup_weekend_zilina_with_our/)